# FastContext **FastContext is a Microsoft subagent that does a coding agent's repository exploration for it, then hands back compact `file:line` citations instead of dumping code into the main agent's context.** Python, MIT. The problem it targets: the main agent burns tokens and pollutes its own reasoning by reading and grepping broadly before it can act. FastContext splits exploration from solving. The main agent asks "where is X", FastContext goes and finds it, and only the evidence comes back. Reported result: up to **60.3% less** token burden on the main agent and up to **+5.5 points** end-to-end on benchmarks. ## How it works - **Delegated, read-only.** It uses only `Read`, `Glob`, and `Grep`; it cannot modify files. Exploration can't cause damage. - **Parallel tool calls.** Independent reads and searches fire at once. - **Citation output.** Results come back as machine-readable `file_path:line_range` blocks, not prose or raw snippets. - **Trainable.** Supports 4B–30B models tuned via SFT and task-grounded RL, running on any OpenAI-compatible endpoint. This is the same "stop the agent from grep-cycling" goal as [[CodeGraph]] and [[CocoIndexCode]], but a different shape. Those pre-build an index; FastContext explores live as a disposable read-only subagent. It pairs naturally with token-cutting layers like [[Headroom]]. ## Usage ```bash uv tool install . # Python 3.12+ fastcontext --query "Find auth files" --max-turns 6 --traj .fastcontext/trajectory.jsonl ``` Also usable programmatically via `make_fastcontext_agent()`. Evaluated on SWE-bench Multilingual / Pro / SWE-QA and integrates as a subagent in Mini-SWE-Agent. ## References - https://github.com/microsoft/fastcontext ## Related - [[CodeGraph]] - [[CocoIndexCode]] - [[Headroom]] - [[Context Engineering]] - [[AI Retrieval Patterns]] - [[Claude Code]]