Code Search
Search for "$ARGUMENTS" using ChunkHound semantic search.
Configuration
- •Read
~/.claude/skills/chunkhound-config.json— containsembedding_args(CLI flags for chunkhound) anddb_dir. - •Read
~/.claude/skills/projects.json— maps project names to paths.
Steps
- •
Read the config and registry files listed above.
- •
Resolve the current project from your working directory by matching against the project paths in the registry. If the cwd is inside a project path, that's the project.
- •
Check if the DB exists. If
{db_dir}/{name}.duckdbdoes not exist, index it first:bashchunkhound index {project_path} --db {db_dir}/{name}.duckdb {embedding_args} - •
Run semantic search:
bashchunkhound search "$ARGUMENTS" --db {db_dir}/{name}.duckdb --semantic {embedding_args} - •
If results were found, read the relevant files to answer the user's question. Do NOT run additional grep/glob searches. Stop here.
- •
If no results were found, use AskUserQuestion to ask:
- •Question: "No results found in {current_project}. Search across all projects?"
- •Options: The first option should be "No", followed by "All projects", then one option per OTHER registered project (only those whose DB files exist), plus the implicit "Other" option.
- •
If the user approves, run semantic search against the selected project(s).
- •
Read the relevant files from the results to answer the user's question.