Getting Started
This guide walks from zero to a working CodeRecon + AI tool setup in about 5 minutes.
Prerequisites¶
- Python 3.12+
- A Git repository
- One of: VS Code, Claude Code, Cursor, or OpenCode
Containerized environments
CodeRecon runs as a local Python process on the same machine as your source code. If your project's runtime, dependencies, or configuration live exclusively inside a Docker container or dev container, CodeRecon cannot inspect them. Dependency resolution, environment detection, and framework discovery may be degraded or unavailable when the host filesystem does not reflect the actual project environment.
Installation¶
Verify the install:
Step 1 — Start the Daemon¶
CodeRecon runs as a single global background daemon. Start it once; it manages all your registered repos.
You'll see the CodeRecon banner and the daemon URL. Leave this terminal open, or run it as a background process.
Keep it running
Run recon up once per session. The daemon persists across recon register / recon unregister calls — no restart needed.
Step 2 — Register Your Repo¶
From inside your repository:
This does three things:
- Creates
.recon/with config and index storage - Builds the initial index (tree-sitter parse + Tantivy full-text)
- Writes MCP config for your detected AI tool(s)
What gets written¶
recon register auto-detects installed tools and writes the right config file for each:
| Detected tool | File written |
|---|---|
| VS Code / Copilot | .vscode/mcp.json |
| Claude Code | .mcp.json |
| Cursor | .cursor/mcp.json |
| OpenCode | ~/.config/opencode/config.json |
It also injects a CodeRecon instruction snippet into the tool's agent instruction file (.github/copilot-instructions.md, CLAUDE.md, etc.) so your agent knows the MCP tool prefix and required workflow.
Targeting specific tools
Use --mcp-target to be explicit:
Step 3 — Verify the MCP Connection¶
VS Code / GitHub Copilot¶
- Open VS Code in the registered repo
- Open the Copilot Chat panel
- Switch to Agent mode (the
@dropdown) - Look for
codereconin the MCP servers list
Claude Code¶
Cursor¶
- Open Cursor settings → MCP
- Verify
codereconappears and is enabled
OpenCode¶
Step 4 — Run Your First Recon¶
Once connected, ask your agent to run a recon call:
The response contains:
- Ranked results — top half with full code snippets, bottom half with signature + docstring only
- Gate — quality signal (
OK,UNSAT,BROAD,AMBIG) - Metrics — retrieval diagnostics
- Hint — actionable follow-up guidance
Typical Agent Workflow¶
Read-only research¶
recon(task="how does caching work?", read_only=true)
→ [agent reads files based on results]
→ checkpoint(changed_files=[]) # no-op, reset session state
Edit a file¶
recon(task="add retry logic to fetch()", read_only=false)
→ [agent reads and edits files]
→ checkpoint(changed_files=["src/client.py"], commit_message="feat: add retry")
Rename a symbol¶
recon(task="rename UserProfile → Profile", read_only=false)
→ refactor_rename(symbol="UserProfile", new_name="Profile", justification="...")
→ refactor_commit(refactor_id="...", inspect_path="src/models.py") # review ambiguous
→ refactor_commit(refactor_id="...") # apply
→ checkpoint(changed_files=["src/models.py", ...], commit_message="refactor: rename")
Explore an unfamiliar repo¶
recon_scout() # repo-wide orientation
recon_scout(scope="src/auth") # zoom into auth module
recon(task="...", read_only=true) # targeted retrieval
Registering More Repos¶
Each repo gets its own daemon slot. Register as many as you like:
cd ~/projects/frontend && recon register
cd ~/projects/backend && recon register
cd ~/projects/infra && recon register
Check what's registered:
Updating the Index¶
The index stays current automatically as you edit files (via the file watcher). To force a full rebuild: