{"name":"AFT: A Sensorimotor Cortex for Coding Agents with IDE and OS Capabilities","description":"AFT provides coding agents with advanced IDE and OS capabilities, acting as a sensorimotor cortex for perception and action within a codebase. It enhances agent productivity and reduces token usage by offering structured code perception, precise symbol-aware edits, and background task management. Part of the CortexKit family, AFT integrates with platforms like OpenCode and Pi to elevate agent interaction with code.","github":"https://github.com/cortexkit/aft","url":"https://osrepos.com/repo/cortexkit-aft","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/cortexkit-aft","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/cortexkit-aft.md","json":"https://osrepos.com/repo/cortexkit-aft.json","topics":["agent-framework","ai-agents","opencode","pi-coding-agent","rust","developer-tools","code-intelligence","semantic-search"],"keywords":["agent-framework","ai-agents","opencode","pi-coding-agent","rust","developer-tools","code-intelligence","semantic-search"],"stars":null,"summary":"AFT provides coding agents with advanced IDE and OS capabilities, acting as a sensorimotor cortex for perception and action within a codebase. It enhances agent productivity and reduces token usage by offering structured code perception, precise symbol-aware edits, and background task management. Part of the CortexKit family, AFT integrates with platforms like OpenCode and Pi to elevate agent interaction with code.","content":"## Introduction\nAFT, part of the CortexKit family, provides coding agents with a sophisticated IDE and OS environment. It acts as a \"sensorimotor cortex,\" bridging an agent's reasoning with the codebase by enabling structured perception and precise action. This innovative approach helps agents interact with code more effectively, moving beyond basic `read` and `bash` commands to symbol-aware operations and intelligent code navigation.\n\n## Why Use AFT and Its Benefits\nAFT significantly enhances agent productivity and reduces token usage by offering a rich set of tools categorized into three core functions:\n\n*   **Sensory Cortex: Perceive.** This allows agents to \"see\" the codebase with structure and meaning. Instead of raw text, agents can use tools like `aft_outline` to view file symbols, `aft_zoom` to inspect specific functions, and `aft_search` for semantic code retrieval. `aft_callgraph` helps trace dependencies, while `aft_inspect` provides codebase health reports. Fast `grep` and `glob` are also included, powered by trigram indexing.\n*   **Motor Cortex: Act.** AFT empowers agents to \"act\" on the codebase with precision, manipulating code at the symbol level rather than line numbers. Tools like `edit` support fuzzy matching and batch edits, `write` handles file creation with formatting, and `apply_patch` enables atomic multi-file changes. Advanced features include `aft_refactor` for workspace-wide symbol moves and `aft_import` for language-aware import management. `ast_grep_search` and `ast_grep_replace` offer structural code manipulation.\n*   **Brainstem: Keep it Alive.** This autonomic layer manages long-running tasks, noisy output, and recovery, freeing the agent's attention. `bash` execution includes command rewriting and output compression. Agents can spawn `background tasks`, manage PTY sessions, and benefit from `aft_safety` with a per-file undo stack and named checkpoints, ensuring codebase recoverability.\n\nBy providing these capabilities, AFT transforms how AI agents interact with code, making them more efficient, accurate, and robust.\n\n## Installation\nGetting started with AFT is straightforward. Use the following command to set up AFT:\n\nbash\nnpx @cortexkit/aft@latest setup\n\n\nThis command auto-detects installed harnesses (like OpenCode or Pi) and configures them. For OpenCode, it replaces built-in `read`, `write`, `edit`, and `apply_patch` with AFT-backed versions and adds the `aft_` tool family. For Pi, it replaces `read`, `write`, `edit`, and `grep`, also adding the `aft_` family.\n\n## Examples\nAFT offers a comprehensive suite of tools for various coding agent tasks. Here are a few examples of its capabilities:\n\n*   **Structured Code Perception**:\n    *   `aft_outline`: Get a structured view of all symbols in a file or directory.\n    *   `aft_search`: Find code by meaning using hybrid semantic and lexical retrieval.\n    *   `aft_inspect`: Generate a codebase health report with LSP errors, warnings, and metrics.\n*   **Precise Code Manipulation**:\n    *   `edit`: Perform symbol-aware find/replace operations or batch edits across multiple files.\n    *   `aft_refactor`: Execute workspace-wide symbol moves, function extractions, or inlining.\n    *   `aft_import`: Add, remove, or organize imports in a language-aware manner.\n*   **Robust Environment Management**:\n    *   `bash`: Execute shell commands with output compression and background task support.\n    *   `aft_safety`: Utilize a per-file undo stack and named checkpoints for recovery.\n\nFor a complete list and detailed usage, refer to the official documentation.\n\n## Links\n*   **GitHub Repository**: [https://github.com/cortexkit/aft](https://github.com/cortexkit/aft){:target=\"_blank\"}\n*   **Crates.io**: [https://crates.io/crates/agent-file-tools](https://crates.io/crates/agent-file-tools){:target=\"_blank\"}\n*   **npm (@cortexkit/aft)**: [https://www.npmjs.com/package/@cortexkit/aft](https://www.npmjs.com/package/@cortexkit/aft){:target=\"_blank\"}\n*   **Discord**: [https://discord.gg/DSa65w8wuf](https://discord.gg/DSa65w8wuf){:target=\"_blank\"}","metrics":{"detailViews":0,"githubClicks":0},"dates":{"published":null,"modified":"2026-09-02T16:39:06.000Z"}}