Wendy - Codebase Q&A Agent
Provides tools for exploring a codebase and its Git history, including listing files, reading files, searching, and inspecting git log, blame, diffs, and repository maps.
Wendy
A codebase Q&A agent built on Claude's tool-use API. Ask a question about a project and it explores the code itself, listing files, searching, and reading ,then answers grounded in what it actually found, not what it guessed.
Current version: 0.5.0 — see CHANGELOG.md.
What it does
Autonomous exploration — given a question, decides which tool it needs and runs it, chaining multiple tools until it has enough real information.
Three tools —
list_files(walk a directory),read_file(read a file), andsearch(find a string across the whole project with line numbers).Visible reasoning — prints every step of the loop, so you can watch it think instead of trusting a black box.
Bounded loop — after 10 tool-using turns, the agent pauses to ask you to continue and prompts Claude to justify itself before going on.
Robust — a crashing tool can't kill the run, results are truncated to a sane size, binary files and junk directories are filtered out, and API errors are retried with backoff and reported cleanly.
Command-line interface — ask questions directly:
src/agent.py "question".History-aware —
git_log,git_blame,git_diff, andrepo_mapanswer the "why did this change?" questions that plain search can't.Symbol-aware —
list_symbolsandfind_definitionuse tree-sitter to parse code into syntax trees, so "where is X defined?" returns the real definition, not a string match.Semantic search —
semantic_searchfinds code by meaning: ask "where's the auth logic?" and it returns the matching functions even when those words never appear in the code, via a cached embedding index.MCP server — all ten tools are exposed as a Model Context Protocol server (
src/server.py), so Claude Code and other MCP clients can use them.
Related MCP server: codebase-bridge-mcp
How it works
Wendy runs a tool-use loop, the same pattern behind coding agents like Claude Code:
Send your question to Claude, along with the list of available tools.
Claude either answers, or replies with a tool request (e.g. "run
searchfordef run").Wendy executes the tool and feeds the result back into the conversation.
Repeat until Claude answers in plain text with no further tool requests.
The conversation history (the messages list) grows each iteration, so Claude
remembers everything it has already found.
To avoid runaway loops, after STEP_LIMIT (10) tool-using turns the agent
pauses and asks you whether to continue, and asks Claude to justify itself.
MCP server
Wendy's tools are also available as a Model Context Protocol server:
.venv/bin/python src/server.pyRegister it with Claude Code:
claude mcp add wendy -- .venv/bin/python src/server.pyOr inspect it in a browser with the MCP Inspector:
.venv/bin/mcp dev src/server.py
Tech stack
Python 3
anthropic — Claude API client (tool use)
python-dotenv — loads the API key from
.envmcp — Model Context Protocol (the
src/server.pyinterface)
Project structure
.
├── src/
│ ├── agent.py # the agent: tool-use loop, CLI
│ ├── tools.py # the tools + helpers (shared by agent and server)
│ └── server.py # MCP server exposing the tools to MCP clients
├── tests/
│ └── test_agent.py # unit tests (run: python -m unittest discover -s tests)
├── docs/
│ ├── README.md # this file
│ └── CHANGELOG.md
├── requirements.txt # Python dependencies
├── Dockerfile # container build for the MCP server
├── LICENSE
├── demo.tape # VHS source for the CLI demo
├── wendy-claude.gif # demo: Claude Code invoking the MCP server
├── .env # Anthropic API key (gitignored)
└── .gitignoreSetup
Create a virtualenv and install dependencies:
python -m venv .venv .venv/bin/pip install -r requirements.txtCreate a
.envfile (never commit it):ANTHROPIC_API_KEY=sk-ant-api03-...Run:
.venv/bin/python src/agent.py "what does run_agent do?"
Status
Tool-use loop
Three tools (
list_files,read_file,search)CLI with step visibility
Step limit (nudge + human-in-the-loop gate)
Tool crash safety
Truncation
Noise filtering
API error handling (retry + clean messages)
MCP server (tools exposed to MCP clients)
Git history tools (
git_log,git_blame,git_diff,repo_map)Symbol search (
list_symbols,find_definitionvia tree-sitter)Semantic search (
semantic_searchvia embeddings + cached index)
This server cannot be deployed
Maintenance
Related MCP Connectors
Repository knowledge graph MCP server for codebase understanding and debugging.
An MCP server that gives your AI access to the source code and docs of all public github repos
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceAgent-safe code retrieval MCP server that indexes repositories and provides semantic search, file navigation, call graph analysis, and bounded file reading tools for coding agents.4,370,901 npm3AGPL 3.0
- AlicenseAqualityDmaintenanceA read-only MCP server that lets a Claude chat explore your local repository and answer questions about it, returning synthesized answers with file:line references.31MIT
- FlicenseNot gradedqualityDmaintenanceA local-only MCP server that exposes git repository history, diffs, and status as tools for LLM clients, working entirely against a local git repo on disk.-
- AlicenseNot gradedqualityAmaintenanceLocal-first code intelligence MCP server that enables coding agents to search code, inspect structure, read exact ranges, and explore Git history with explicit token budgets.24Apache 2.0