# AFT: A Sensorimotor Cortex for Coding Agents with IDE and OS Capabilities

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/cortexkit-aft
Generated for open source discovery and AI-assisted research.

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
OSRepos URL: https://osrepos.com/repo/cortexkit-aft

## 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.

## Topics

- agent-framework
- ai-agents
- opencode
- pi-coding-agent
- rust
- developer-tools
- code-intelligence
- semantic-search

## Repository Information

Last analyzed by OSRepos: Wed Sep 02 2026 17:39:06 GMT+0100 (Western European Summer Time)
Detail views: 0
GitHub clicks: 0

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction
AFT, 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.

## Why Use AFT and Its Benefits
AFT significantly enhances agent productivity and reduces token usage by offering a rich set of tools categorized into three core functions:

*   **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.
*   **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.
*   **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.

By providing these capabilities, AFT transforms how AI agents interact with code, making them more efficient, accurate, and robust.

## Installation
Getting started with AFT is straightforward. Use the following command to set up AFT:

bash
npx @cortexkit/aft@latest setup


This 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.

## Examples
AFT offers a comprehensive suite of tools for various coding agent tasks. Here are a few examples of its capabilities:

*   **Structured Code Perception**:
    *   `aft_outline`: Get a structured view of all symbols in a file or directory.
    *   `aft_search`: Find code by meaning using hybrid semantic and lexical retrieval.
    *   `aft_inspect`: Generate a codebase health report with LSP errors, warnings, and metrics.
*   **Precise Code Manipulation**:
    *   `edit`: Perform symbol-aware find/replace operations or batch edits across multiple files.
    *   `aft_refactor`: Execute workspace-wide symbol moves, function extractions, or inlining.
    *   `aft_import`: Add, remove, or organize imports in a language-aware manner.
*   **Robust Environment Management**:
    *   `bash`: Execute shell commands with output compression and background task support.
    *   `aft_safety`: Utilize a per-file undo stack and named checkpoints for recovery.

For a complete list and detailed usage, refer to the official documentation.

## Links
*   **GitHub Repository**: [https://github.com/cortexkit/aft](https://github.com/cortexkit/aft){:target="_blank"}
*   **Crates.io**: [https://crates.io/crates/agent-file-tools](https://crates.io/crates/agent-file-tools){:target="_blank"}
*   **npm (@cortexkit/aft)**: [https://www.npmjs.com/package/@cortexkit/aft](https://www.npmjs.com/package/@cortexkit/aft){:target="_blank"}
*   **Discord**: [https://discord.gg/DSa65w8wuf](https://discord.gg/DSa65w8wuf){:target="_blank"}