Stop burning tokens on code Claude already read.
Focal is an MCP server that gives Claude Code structural awareness of your codebase — symbols, dependencies, blast radius — so it retrieves exactly the context it needs instead of re-reading entire files every session.
| Metric | Without Focal | With Focal | Improvement |
|---|---|---|---|
| Tokens per compaction recovery | 55,344 | ~1,700 | 32x fewer |
| Tokens to understand a file | 16,931 | 3,598 | 4.7x fewer |
| Cost per recovery (Opus) | $0.83 | $0.03 | 97% cheaper |
| Tool call latency | — | <30ms | imperceptible |
| Disk overhead | — | 816 KB | trivial |
Full methodology and raw data: benchmarks/bench.md.
- Install Focal from the VS Code Marketplace.
- Open a project. The extension downloads the binary, configures MCP, and generates a
CLAUDE.mdwith tool guidance. - Use Claude Code as usual. Focal serves context automatically.
cd your-project
focal --initThat writes .mcp.json in your project root. Claude Code picks up the MCP server on its next session.
git clone https://github.com/InfraWhisperer/focal.git
cd focal && cargo build --release
# Binary at target/release/focalProgressive disclosure — The first time Claude requests a symbol, it gets the full body. Subsequent requests return a compact skeleton with an "already sent" marker. This eliminates the re-reading problem at the protocol level.
Dependency and impact analysis — Focal knows which symbols call which. Claude can check blast radius before making changes instead of grepping through imports.
Persistent memory — Architectural decisions, conventions, and context survive across sessions. Memories link to specific symbols; when those symbols change, linked memories are flagged as potentially stale.
19 MCP tools for every coding workflow:
| Category | Tools |
|---|---|
| Context and retrieval | get_context, query_symbol, search_code, get_skeleton, batch_query |
| Graph analysis | get_dependencies, get_dependents, get_impact_graph, search_logic_flow, get_file_symbols |
| Memory | save_memory, list_memories, search_memory, update_memory, delete_memory |
| Session and diagnostics | recover_session, get_repo_overview, get_health, get_symbol_history |
Go, Rust, TypeScript/JavaScript, Python — all via tree-sitter.
Run focal --init in your project root — it writes .mcp.json automatically. Or add it manually:
{
"mcpServers": {
"focal": {
"command": "/path/to/focal",
"args": ["/path/to/workspace"]
}
}
}Claude Code picks up the MCP server on its next session.
Add to your VS Code settings.json:
{
"mcp": {
"servers": {
"focal": {
"type": "stdio",
"command": "/path/to/focal",
"args": ["/path/to/workspace"]
}
}
}
}For persistent daemon use or multi-client access:
focal /path/to/workspace --http --port 3100| Setting | Default | Description |
|---|---|---|
focal.excludePatterns |
["node_modules", ".git", "vendor", "target", "dist"] |
Glob patterns to exclude from indexing |
focal.maxFileSize |
500000 |
Skip files larger than N bytes |
focal.coreBinaryPath |
"" |
Path to focal binary (auto-detected if empty) |
- Focal: Reindex Workspace — full re-index
- Focal: Clear Index — drop and rebuild the database
- Focal: Show Memories — list memories with staleness status
- Focal: Configure MCP — write/update
.mcp.jsonin the workspace root
Drop a .claude/CLAUDE.md in your repo to teach Claude how to use Focal's tools effectively. See this project's own CLAUDE.md for an example.
PRs welcome. Open an issue first for non-trivial changes.
cargo build --release
cargo test
cargo clippy -- -D warnings
# VS Code extension
cd extension && npm run compileAdding a language means implementing the Grammar trait in core/src/grammar/ and registering the tree-sitter grammar crate.