$ cat ~/map/aft.md
aft
Sensorimotor-cortex layer that ships thin adapters for Pi and OpenCode, replacing raw read/write/edit/bash with semantic operations.
tools✓ Oct 16
Facts
- repository
- github.com/cortexkit/aft ↗
- GitHub Stars
- ★ 324
- Forks
- 39
- license
- MIT
- npm / mo
- —
- last push
- Oct 16, 2026
install
npx @cortexkit/aft@latest setup## TL;DR
Sensorimotor-cortex layer for coding agents: a Rust binary with thin adapters that, for pi, replaces the built-in read, write, edit, and grep tools with tree-sitter-backed, symbol-aware versions and adds an aft_ tool family on top.
## Key points
- $For pi, setup replaces the built-in read, write, edit, and grep tools with AFT-backed versions and adds the aft_ tool family on top — the agent keeps calling the same tool names, now backed by tree-sitter parsing, indexed search, output compression, and symbol-aware operations.
- $Sensory tools: aft_outline lists every symbol in a file, directory, or remote URL; aft_zoom inspects one symbol (callgraph: true adds callers/callees); aft_search does hybrid semantic + lexical retrieval with local, OpenAI-compatible, or Ollama embedding backends; aft_inspect reports LSP errors, TODOs, metrics, dead code, unused exports, and duplicates.
- $Motor tools: edit with fuzzy find/replace or named-symbol replacement, batch edits and multi-file transactions; write with auto-created directories, backup, and formatting; apply_patch with atomic rollback; aft_refactor for workspace-wide symbol move, function extraction, and inlining; aft_import for language-aware import organization; ast_grep_search/ast_grep_replace for structural patterns.
- $Brainstem layer: bash with per-command output compression, background tasks that survive restarts (bash_status, bash_kill, bash_watch), PTY sessions for REPLs and terminal apps, and aft_safety — a per-file undo stack with named checkpoints that persists across bridge and host restarts.
- $npx @cortexkit/aft@latest setup auto-detects which harnesses are installed and configures each; --harness pi targets pi. At runtime one persistent aft process per project root is shared across sessions, speaking JSON over stdio; data lives under ~/.local/share/cortexkit/aft/.
- $Configured via aft.jsonc at user or project level; npx @cortexkit/aft@latest doctor prints recent usage and what removal would leave behind, and pi remove npm:@cortexkit/aft-pi unregisters it from pi.
## FAQ
Q How exactly does it change pi's tools?
The pi adapter hoists the host's built-in tool slots — the agent keeps calling read, write, edit, and grep, but they are now backed by tree-sitter parsing, trigram-indexed search, output compression, and symbol-aware operations, with the aft_ family registered on top.
Q How do I uninstall it from pi?
Run pi remove npm:@cortexkit/aft-pi (pi uninstall is an alias), which removes AFT from pi's package list in ~/.pi/agent/settings.json; then delete the config files and data directories described in the docs/config.md uninstall paths.
## References
- README (quick start, cortex, architecture) ↗
- Tool reference (docs/tools.md) ↗
- Configuration reference (docs/config.md) ↗
## Related entries
$ Pi for VS Code
VS Code extension hosting the real pi TUI in the sidebar over a pseudo-terminal — not a chat-panel reimplementation.
$ pi-coding-agent-action
GitHub Action that runs the pi coding agent in CI for comment-driven reviews, audits, and PR triage.
$ pi-tmux-orchestrator
Pi extension + dependency-free Python CLI for coordinating implementer, reviewer, and optional probe agents in a monitorable tmux grid with a per-run Unix-socket broker.
Last updated: Aug 31, 2026