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.4.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:
agent.py "question".History-aware —
git_log,git_blame,git_diff, andrepo_mapanswer the "why did this change?" questions that plain search can't.MCP server — all seven tools are exposed as a Model Context Protocol server (
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 server.pyRegister it with Claude Code:
claude mcp add wendy -- .venv/bin/python server.pyOr inspect it in a browser with the MCP Inspector:
.venv/bin/mcp dev server.py
Tech stack
Python 3
anthropic — Claude API client (tool use)
python-dotenv — loads the API key from
.envmcp — Model Context Protocol (the
server.pyinterface)
Project structure
.
├── 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
├── test_agent.py # unit tests (run: python -m unittest test_agent)
├── requirements.txt # Python dependencies
├── .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 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)
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.2,693,148 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 gradedqualityCmaintenanceA 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.23Apache 2.0