ChunkHound
ChunkHound is a codebase intelligence server that lets you search and understand code using pattern matching, semantic similarity, and git history analysis.
Regex Search: Find known symbols, identifiers, imports, or string literals using exact pattern matching (e.g.,
def authenticate,class.*Handler).Semantic Search: Find code by meaning using natural language queries and embedding similarity — useful when exact identifiers are unknown (e.g., "retry logic", "database connection pooling").
Scoped Search: Restrict searches to a specific subdirectory (e.g.,
src/auth) to narrow results.Git History Search: Search code changes using a specific commit hash, a revision range (e.g.,
v1.0..v2.0), or a shorthand for the last N commits.Vector Source Control: When using git inputs, control whether to search only changed code (
diff), merge diff and database results (both), or search the full index ignoring git input (db).Paginated Results: Browse large result sets with configurable page size and offset.
Daemon Status Monitoring: Check daemon health, initial indexing completion, query readiness, and scan progress to diagnose system behavior.
Search results return structurally-parsed code chunks (e.g., functions or classes) along with file paths and line ranges.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ChunkHoundExplain how the authentication flow interacts with the session management logic."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Requirements
Python 3.10+
uv — install via
curl -LsSf https://astral.sh/uv/install.sh | shAPI keys (optional — regex search works without any):
Related MCP server: OpenCodeHub MCP Server
AI writes code blind
Agents can generate code, but they still miss the context that makes software safe to change: how behavior flows across files, what changed across a branch or release, and which external constraints matter.
Reviewers, support, and product teams hit the same wall when large PRs, merge conflicts, bugs, and release notes need implementation-backed explanation instead of guesses.
ChunkHound turns current code, git history, and technical web research into cited context before anyone edits, reviews, debugs, or explains software.
Deep understanding for four context-heavy jobs
ChunkHound applies codebase understanding to the workflows where missing context hurts most.
Research before editing
Give coding agents grounded architecture context, relevant files, recent changes, and external constraints before they write code.
Understand large PRs and releases
Turn branch diffs, commit ranges, tags, and specific commits into cited engineering briefs for review, release notes, and changelog drafts.
Trace bugs and incidents
Turn symptoms, stack traces, and customer reports into likely code paths, recent changes, and external constraints.
Reconcile code with external docs
Pinpoint the technical docs, APIs, issues, and articles your implementation depends on, then connect that external evidence to local code research.
What you can ask
Ground an agent before edits
chunkhound research "How does authentication work?"
chunkhound search "JWT refresh token validation"
chunkhound research "What changed in auth recently?" --last-n 20Understand a large PR or release
chunkhound research "Summarize the behavior changes on this branch for reviewers" --commit-range main..HEAD
chunkhound research "Draft changelog bullets for billing since v2.4" --commit-range v2.4..HEAD
chunkhound search "database migration" --commit-hash abc1234Get context before resolving conflicts
chunkhound research "Why did auth session handling change on each side?" --commit-range main..feature/auth
chunkhound search "session refresh conflict" --last-n 50Trace a bug with external constraints
chunkhound research "why would webhook retries fail?"
chunkhound research "what changed in webhook handling this week?" --last-n 30
chunkhound websearch "Stripe webhook retry schedule"Explain product behavior
chunkhound research "What happens when a user cancels a subscription?"
chunkhound research "What changed in billing since v2.4?" --commit-range v2.4..HEADWhat powers deep understanding
Semantic code search — find relevant code by meaning, not only exact text
Cited code research — explain behavior across files with source citations
Git history research — ask by last N commits, commit hash, tag, branch, or range to understand large PRs and releases
Pinpoint web research — bring cited external docs, APIs, issues, and articles into the same workflow as local code research
Autodoc — generate shareable docs from code-backed research
Local-first indexing — keep code search and indexing under your control
Python, JavaScript, TypeScript, Java, Go, Rust, C/C++, and more via Tree-sitter
Install
uv tool install chunkhoundTry it
chunkhound index .
chunkhound research "How does authentication work?"Index once, ask a real architecture question, and get a grounded answer with citations. Regex search works without providers. Semantic search requires an embedding provider. Deep research requires an LLM provider and an embedding provider with reranking support; web research uses the same provider stack. Choose local providers for zero-code-egress setups.
For a full configurable setup, create .chunkhound.json in your project root:
{
"embedding": { "provider": "voyageai", "api_key": "your-key" },
"llm": { "provider": "claude-code-cli" }
}For editor integration, all provider options, and advanced configuration:
→ chunkhound.ai/docs/getting-started
Search git history
In addition to searching your indexed codebase, ChunkHound can search code changes across git history — useful for understanding what changed in a PR, a release, or since a specific commit.
# Last N commits
chunkhound search "authentication changes" --last-n 20
# Changes introduced by a specific commit
chunkhound search "database migration" --commit-hash abc1234
# Custom git range
chunkhound search "API changes" --commit-range v2.0..HEAD
# Deep research over recent changes
chunkhound research "what changed in the auth module?" --last-n 50
--vector-sourcecontrols scope:diff(default, changed code only),both(merges diff + DB),db(ignore diff).
Good fit
ChunkHound is especially useful for:
large repos and monorepos
multi-language codebases
legacy systems
local-only or security-sensitive environments
engineering teams that want agents, support, and product questions grounded in the same code index
Community
ChunkHound is MIT licensed, open source, and community built.
License
MIT
Available Tools
2 toolsdaemon_statusA
Report daemon startup, scan, and realtime indexing health.
USE FOR:
Checking whether initial indexing has completed
Inspecting backend-neutral realtime health and resync state
Debugging degraded daemon behavior without opening log files
OUTPUT: {status, query_ready, scan_progress}
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, but the description discloses the tool's behavior: it reports health status without side effects. It outlines the output fields, though it could explicitly state it is read-only.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and structured with clear sections (USE FOR, OUTPUT), no wasted words, and efficient communication of purpose and usage.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no parameters and no output schema, the description adequately covers what the tool does and its output structure. It could mention potential error conditions, but it is fairly complete for the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters and schema coverage is 100%, so the description does not need to add parameter information. The baseline for no parameters is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it reports daemon startup, scan, and realtime indexing health, with specific use cases and output fields. It distinguishes from sibling 'search' which is unrelated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The 'USE FOR' section explicitly lists three specific scenarios (checking indexing completion, inspecting realtime health, debugging without logs), providing clear guidance on when to use this tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchA
Pinpoint specific code locations — find exact symbols, patterns, or concepts in the indexed codebase. Returns structurally-parsed code chunks (functions, classes) — large definitions may span multiple results.
TYPE — choose one:
regex: Match exact patterns against code content. Use for known identifiers, imports, or string literals. Examples: "def authenticate", "class.*Handler", "import.*pandas", "TODO:.*refactor"
semantic: Find code by meaning via embedding similarity. Use for concepts or when exact identifiers are unknown. Examples: "authentication logic", "retry with exponential backoff", "database connection pooling"
DECISION GUIDE:
Known symbol or pattern → regex
Concept or behavior → semantic
OUTPUT: Markdown blocks — file path, line range, symbol name, code block, pagination footer.
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Optional relative subdirectory to restrict search scope, e.g. "src/auth" or "lib/payments" (no leading slash) | |
| type | Yes | Search mode — "regex" for exact pattern matching, "semantic" for meaning-based similarity | |
| query | Yes | For regex: a regex pattern like "def authenticate" or "class.*Handler". For semantic: a natural language concept like "retry logic" or "database connection pooling" | |
| offset | No | Starting offset for pagination | |
| page_size | No | Number of results per page (1-100) | |
| commit_hash | No | Single commit hash — searches only that commit's diff (equivalent to '<hash>^..<hash>'). | |
| commit_range | No | Optional git revision range (e.g. 'HEAD~10..HEAD', 'v1.0..v2.0'). When provided with type='semantic', searches changed code in that range. | |
| vector_source | No | Controls search scope when commit input given. 'diff' (default) searches only changed code. 'both' merges diff and DB results. 'db' ignores commit input and searches DB only. | diff |
| last_n_commits | No | Integer shorthand — searches last N commits (equivalent to 'HEAD~N..HEAD'). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It mentions output format and that large definitions may span multiple results. However, it does not explicitly state read-only nature, rate limits, or side effects. Adequate but not thorough.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Organized into clear sections (TYPE, DECISION GUIDE, OUTPUT) with efficient language. Given the tool's complexity (9 parameters, two modes), the length is justified. Minor opportunity to trim redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers search modes, parameter usage, pagination, commit ranges, and output format. With no output schema or annotations, the description provides sufficient context for effective use. Could add explicit mention of pagination handling.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and the description adds significant value beyond schema by explaining the difference between regex and semantic modes, providing examples, and clarifying commit-related parameters. This enriches understanding beyond the schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Pinpoint specific code locations — find exact symbols, patterns, or concepts in the indexed codebase.' It uses specific verbs and resources and is distinct from the only sibling tool 'daemon_status'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Includes a decision guide ('Known symbol or pattern → regex; Concept or behavior → semantic') with examples. Does not explicitly state when not to use, but the guidance is clear. Context is sufficient given no similar sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
daemon_status - First observed
search
TDQS
Scored across 2 tools
Each tool has a clearly distinct purpose: daemon_status for health monitoring and search for code retrieval. No overlap in functionality.
Both tool names use consistent snake_case format: daemon_status and search. Naming pattern is uniform.
With only 2 tools, the server feels minimal for a code indexing service. While functional, it lacks typical tools like index management or configuration, placing it below the ideal range.
The tool surface is severely incomplete for code indexing: missing index control, rescan triggers, configuration, or result filtering. Only basic search and status checks are covered.
Maintenance
Related MCP Connectors
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Codebase graphs, caller impact analysis, and recorded project context for AI coding agents.
Related MCP Servers
- AlicenseCqualityAmaintenanceLocal-first codebase intelligence engine providing AI coding agents with a typed MCP toolset for understanding and navigating code repositories.10051Apache 2.0
- AlicenseNot gradedqualityAmaintenanceProvides code intelligence for AI coding agents by indexing repositories into a hybrid knowledge graph, enabling agents to query dependencies, impact, and context through 28 MCP tools.3Apache 2.0
- AlicenseNot gradedqualityBmaintenanceProvides AI coding assistants with deep, semantic understanding of local codebases via AST-aware chunking, cross-repo symbol graphs, and architectural memory, enabling context-aware code search and dependency tracing.10MIT
- AlicenseNot gradedqualityBmaintenanceA local-first codebase intelligence layer for AI coding agents, providing a persistent, queryable model of a repository via an MCP server and CLI to enable structure queries instead of reading many files.Apache 2.0