feat(dx): [POC] add ChunkHound for AI-powered code search (CLI-first)#425
Draft
guicheffer wants to merge 2 commits intomainfrom
Draft
feat(dx): [POC] add ChunkHound for AI-powered code search (CLI-first)#425guicheffer wants to merge 2 commits intomainfrom
guicheffer wants to merge 2 commits intomainfrom
Conversation
- Adds ChunkHound indexing to make install with auto-detection of Ollama - Starts/stops Ollama automatically during indexing on macOS - Falls back to regex-only on non-macOS or when Ollama is unavailable - Exposes search_regex and search_semantic as MCP tools for Claude Code - Installs git hooks (post-checkout, post-merge) to keep index fresh - Adds .mcp.json for automatic MCP server configuration - Adds .chunkhound.json with Ollama embedding config (nomic-embed-text)
Contributor
CI Summary
|
Contributor
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|
| ✅ JSON | jsonlint | 1 | 0 | 0 | 0.13s | |
| ✅ JSON | npm-package-json-lint | yes | no | no | 3.12s | |
| ✅ JSON | prettier | 1 | 0 | 0 | 2.33s | |
| ✅ JSON | v8r | 1 | 0 | 0 | 2.7s | |
| markdownlint | 2 | 26 | 0 | 0.95s | ||
| markdown-table-formatter | 2 | 1 | 0 | 0.36s | ||
| ✅ REPOSITORY | checkov | yes | no | no | 27.97s | |
| ✅ REPOSITORY | devskim | yes | no | no | 2.7s | |
| ✅ REPOSITORY | dustilock | yes | no | no | 1.45s | |
| ✅ REPOSITORY | gitleaks | yes | no | no | 1.66s | |
| ✅ REPOSITORY | git_diff | yes | no | no | 0.26s | |
| ✅ REPOSITORY | grype | yes | no | no | 47.45s | |
| ✅ REPOSITORY | kics | yes | no | no | 2.6s | |
| ✅ REPOSITORY | kingfisher | yes | no | no | 5.47s | |
| ✅ REPOSITORY | secretlint | yes | no | no | 5.04s | |
| ✅ REPOSITORY | syft | yes | no | no | 2.41s | |
| ✅ REPOSITORY | trivy | yes | no | no | 20.1s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 3.14s | |
| ✅ REPOSITORY | trufflehog | yes | no | no | 4.92s |
Detailed Issues
⚠️ MARKDOWN / markdown-table-formatter - 1 error
2 files contain markdown tables to format:
- AGENTS.md
- README.md
⚠️ MARKDOWN / markdownlint - 26 errors
AGENTS.md:9 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
AGENTS.md:171:401 error MD013/line-length Line length [Expected: 400; Actual: 552]
AGENTS.md:179:27 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:180:23 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:181:33 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:182:59 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:183:42 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:184:33 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:185:31 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:186:31 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:187:25 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:188:28 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
AGENTS.md:193:17 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:193:25 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
AGENTS.md:193:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
AGENTS.md:193:17 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
README.md:109:11 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
README.md:109:17 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
README.md:109:44 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
README.md:109:62 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
README.md:109:84 error MD060/table-column-style Table column style [Table pipe is missing space to the left for style "compact"]
README.md:109:1 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
README.md:109:11 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
README.md:109:17 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
README.md:109:44 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
README.md:109:62 error MD060/table-column-style Table column style [Table pipe is missing space to the right for style "compact"]
See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

Show us your support by starring ⭐ the repository
Changes ChunkHound integration from MCP server to CLI-first workflow for better transparency and flexibility. **What changed:** - ChunkHound now uses CLI (`chunkhound search`) instead of MCP tools by default - AGENTS.md updated with clear decision tree and examples - Makefile: `make dev-start`/`dev-stop` for Ollama, `make start`/`stop` for app - MCP mode still available via `.mcp.json.example` (optional, for deep research) - Simplified config: only embeddings in `.chunkhound.json` (no LLM needed for CLI) **Why CLI over MCP:** - Faster: no MCP server overhead - Transparent: commands visible in conversation - Flexible: easy to adjust flags/filters - No lock conflicts: no competing processes **MCP alternative:** For deep research with `chunkhound research`, copy `.mcp.json.example` to `.mcp.json` and restart Claude Code. MCP mode gives ChunkHound access to Claude Code's LLM for complex synthesis. **Developer workflow:** ```bash make install # setup once (installs deps + indexes) make dev-start # start Ollama (optional, for semantic search) make start # start app (alias: make dev) make stop # stop app processes ``` Co-Authored-By: Claude (global.anthropic.claude-sonnet-4-6[1m]) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[POC] Introduces ChunkHound as a local RAG (Retrieval-Augmented Generation) layer for AI-assisted development. Instead of Claude reading files one by one to understand the codebase, it can now query a local semantic index via CLI — getting precise, chunked, line-referenced results in milliseconds.
CLI-first approach:
chunkhound search "query"- semantic search via Bash (transparent, fast)chunkhound search --regex "pattern"- regex pattern matching.mcp.json.example) for deep research withchunkhound researchWhat's included:
make install→ installs ChunkHound, configures git hooks, indexes codebasemake dev-start/dev-stop→ manages Ollama (for semantic search, macOS only)make start/stop→ manages app dev processespost-checkout,post-merge) keep index fresh automaticallyHow it works
Developer workflow
flowchart TD A[make install] -->|installs| B[chunkhound via uv] A -->|runs| C[npm install] A -->|configures| D[git hooks] A -->|runs| E[make index] E --> F{macOS + Ollama\nnomic-embed-text?} F -->|yes| G[indexes with embeddings\nsemantic + regex] F -->|no| H[indexes without embeddings\nregex only] I[make dev-start] -->|optional| J[starts Ollama\nfor semantic search] K[claude .] -->|reads| L[AGENTS.md] L --> M[Claude uses chunkhound CLI\nvia Bash tool] M --> N[chunkhound search\nreturns ranked chunks] N --> O[Claude reads only\nrelevant files]Behind the scenes
flowchart LR subgraph idx["Indexing — make index"] A[256 source files] --> B[ChunkHound\nAST chunker] B --> C[2850 chunks\nfile · line · type] C --> D[DuckDB\n.chunkhound/db] C --> E[Ollama\nnomic-embed-text] E -->|2765 vectors\ncosine-comparable| D end subgraph query["Query — during Claude session via CLI"] F[you ask Claude\nsomething] --> G[Claude runs\nchunkhound search] G -->|semantic| H[Ollama embeds query\ncosine similarity] G -->|regex| I[pattern match\nagainst chunk text] H --> J[top-N chunks\nwith score + file:line] I --> J J --> K[Claude reads only\nrelevant files] end D --> H D --> IWhy CLI over MCP?
researchtool (uses Claude as LLM)MCP mode available: Copy
.mcp.json.exampleto.mcp.jsonand restart Claude Code for deep research capability.What's included
Makefilemake install+make indexwith Ollama lifecycle,make dev-start/dev-stop.chunkhound.jsonnomic-embed-text, local endpoint).chunkhound.json.example.mcp.json.example.githooks/post-checkout.githooks/post-mergeAGENTS.mdREADME.md.gitignore.chunkhound/(generated) and.mcp.json(optional)Setup (macOS only for semantic search)
Semantic search requires Ollama. Regex search works everywhere with no extra setup.
Developer workflow
Test plan
make installcompletes without errors on a clean checkoutmake indexruns standalone and produces.chunkhound/directorychunkhound searchreturns correct chunks via CLIchunkhound search --regexworks for pattern matchingmake dev-start/dev-stopmake install(git config core.hooksPathset)make startandmake stopmanage app processes correctlyCode standards