AFT plugin

A plugin for OpenCode and Pi that swaps read, edit and grep for structure-aware versions and adds semantic search and PTY

  • 340 ★ on the repository
  • Last commit
  • MIT
Plugin

Broad access

Why this level

  • It replaces the standard read, write and edit tools, so any plugin bug touches the whole working directory
  • It runs shell commands, background tasks and PTY sessions and downloads an executable binary on first start
All reasons and checks

cortexkit/aft

Install

Works in

Manual install

npx @cortexkit/aft@latest setup

Detects installed harnesses (OpenCode, Pi, OMP) and configures each. The `--harness` flag picks one.

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • It replaces the standard read, write and edit tools, so any plugin bug touches the whole working directory
  • It runs shell commands, background tasks and PTY sessions and downloads an executable binary on first start

This is third-party code. Review the repository files before installing.

What it does

AFT runs on a Rust binary and plugs into OpenCode, Pi and OMP. It replaces the built-in `read`, `write`, `edit` and `grep` (and `apply_patch` in OpenCode) with versions built on tree-sitter parsing and indexed search, and adds a family of `aft_` tools next to them. The agent still sees the usual names of the standard tools. For reading code there are `aft_outline` (symbols of a file or directory), `aft_zoom` (one symbol with its call graph), `aft_search` (search by meaning), `aft_callgraph` and `aft_inspect` (LSP errors, TODOs, dead code, duplicates). Edits work at symbol level: `edit` replaces a function by name, `ast_grep_replace` rewrites code by an AST pattern, `aft_import` tidies imports. Every change is parsed, formatted and backed up. For the shell AFT supplies `bash` with compression of noisy output (tests, installers, `docker ps`, `kubectl`), background tasks with `bash_status`, `bash_kill` and `bash_watch`, and interactive PTY sessions. The `aft_safety` command keeps an undo stack and checkpoints. Installation is one command: `npx @cortexkit/aft@latest setup` finds your agents and configures them.

Who it is for. OpenCode and Pi users whose agents burn tokens on whole-file reads and break edits when lines shift.

Good fit when

  • The agent reads whole files and the token bill grows: `aft_outline` and `aft_zoom` return structure and a single symbol
  • A refactor spans the whole workspace and edits by line number keep breaking
  • Tests and installers clog the context with hundreds of lines of output
  • A long build runs in the background with `background: true` and is watched through `bash_watch`
  • The agent needs an interactive REPL or editor in a PTY session

Not a fit when

  • You work in Claude Code, Cursor or Codex: AFT supports OpenCode, Pi and OMP
  • The built-in `read` and `edit` suit you: the plugin replaces the agent's standard tools
  • You need published benchmarks: the authors promise them later
  • The environment forbids downloading a binary at the first session start

Example request

Show the structure of `src/server.ts` with aft_outline and zoom into the handleAuth function together with its call graph

Limitations

  • Works only with OpenCode, Pi and OMP (through the Pi plugin), other agents are not supported.
  • The `aft` binary downloads at the first session start.
  • There is no uninstall command: registration is removed by hand in the OpenCode config or with `pi remove npm:@cortexkit/aft-pi`, and data and configs are deleted separately.
  • Installation changes the agent configuration: the replaced `read`, `write` and `edit` apply in every project.

How to disable. In OpenCode remove `@cortexkit/aft-opencode` from the plugin array in `~/.config/opencode/opencode.jsonc` (and from tui.jsonc if setup added it there). In Pi run `pi remove npm:@cortexkit/aft-pi`. Config files and data are listed in `docs/config.md`, the uninstall paths section. Before removing, `npx @cortexkit/aft@latest doctor` shows what will be left behind.

FAQ

How do I install AFT in OpenCode?

Run `npx @cortexkit/aft@latest setup --harness opencode`. The command registers the `@cortexkit/aft-opencode` plugin in the OpenCode config, and the binary downloads at the next session start.

What does AFT change in the built-in tools?

In OpenCode it replaces `read`, `write`, `edit` and `apply_patch`, in Pi `read`, `write`, `edit` and `grep`. The names stay the same, while tree-sitter parsing, indexed search and backups work underneath.

Does AFT work with Claude Code?

No. The README names three supported environments: OpenCode, Pi and OMP.

Which languages does AFT support?

TypeScript, JavaScript, Python, Rust, Go, C and C++, Java, Kotlin, Swift, Ruby, PHP and more, the full list is in the README table. Every listed language gets structural outline and edits, refactoring only some.

How do I check the AFT installation?

`npx @cortexkit/aft@latest doctor` checks the environment, `doctor --fix` repairs what it finds and `doctor lsp` inspects language servers.

Discussion

No questions or reviews yet.

Plugins

A Claude Code and Codex plugin with skills for code research, tests, refactoring and independent review of finished changes

PluginExtended access454Repository stars

A Rust coding agent with a native GUI, a terminal mode, an ACP mode for Zed and an MCP server

CLIBroad access189Repository stars

A Windows plugin for OpenCode Desktop that sets edit boundaries, screens commands and ties test results to the current code.

PluginExtended access113Repository stars

55 skills for Claude Code, Codex, OpenCode and Pi: code review, security audit, feature development, frontend design and Hugging Face

PluginBroad access554Repository stars

Parses repositories into UniAST trees and gives agents MCP tools for finding functions, dependencies and code references

MCP serverBroad access389Repository stars

Skills for commits, review and ZenTao plus a status line, gateway balance and session logs for Claude Code, Codex, OpenCode.

PluginExtended access179Repository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
AFT (this card)no340
cclspnonot required675plugs LSP servers into Claude Code over MCP, while AFT replaces the tools of OpenCode and Pi
code-index-mcpnonot required162a SQLite code index with MCP search tools, while AFT adds symbol edits and a shell layer

README in short

The README presents AFT as a "sensorimotor cortex" for agents and splits the tools into three groups: perceiving code, acting on it and keeping the environment alive. Then come a quick start, uninstall steps, its place in the CortexKit family, a table of supported languages and the architecture.

README badge

Report a problem