duckgrep

ccfbyccf
•

Provide coding agents with a queryable relational model of codebases using Tree-sitter and DuckDB to answer complex structural questions in a single step.

duckgrep replaces tedious, token-heavy search loops by turning codebases into queryable DuckDB databases powered by Tree-sitter. Instead of forcing coding assistants to repeatedly run grep, inspect surrounding files, and deduce execution flow, duckgrep exposes definitions, caller hierarchies, resolved imports, and Git history through a single read-only SQL MCP tool. It automatically freshens its index mid-edit and tags call-graph edges with clear confidence levels, allowing AI agents to evaluate code risk, explore multi-hop call graphs, and navigate large codebases with substantially fewer tool calls and lower token costs.

Key Features

01AST-based parsing with Tree-sitter supporting Python, TypeScript, JavaScript, Go, and Rust
02Precomputed relational call graphs with explicit confidence tiers ranging from typed analysis to candidate matching
03Integrated Git metadata joining call graphs directly with file churn, change counts, and authorship history
040 GitHub stars
05Single SQL query MCP tool carrying the entire database schema to eliminate iterative grep-and-read loops
06Incremental mid-edit freshening that updates changed files in milliseconds before executing queries

Use Cases

01Assessing refactoring blast radius and risk by joining structural call paths with Git churn metrics
02Finding dead code or public functions within a specific directory that lack external callers
03Answering multi-hop call graph and reference questions for coding agents like Claude Code in one shot