By btucker
Claude Code plugin for tracegrep-aware search with call-graph context. Includes a skill for tg-based search, plus hooks for search guidance (PreToolUse), call-graph annotations (PostToolUse), and session context injection (SessionStart).
tracegrep layers backtrace context on top of rg (ripgrep) results.
It exists to give coding agents instant context for how a line of code is used in the codebase. This allows the agent to gain a more complete understanding prior to making changes.
Rust, Python, TypeScript, and JavaScript are currently supported via treesitter.
This repo includes a Claude Code plugin with a search skill and hooks (PreToolUse search guidance, PostToolUse call-graph annotations, SessionStart context injection), plus a standalone SKILL.md for Codex and Cursor.
tracegrep maintains a mostly compatible CLI to ripgrep.
$ rg tool_block
212: let blocks = extract_tool_blocks(session_events);
279:fn extract_tool_blocks(events: &[StreamEvent]) -> Vec<ToolBlock> {
$ tg tool_block
src/daemon/stream.rs:append_tool_data_effects
212: let blocks = extract_tool_blocks(session_events);
Called by:
src/daemon/stream.rs:process_lead_output:110 (when events.get(main_lead_session_name) is Some(lead_events) && ...)
src/daemon/stream.rs:extract_tool_blocks
279:fn extract_tool_blocks(events: &[StreamEvent]) -> Vec<ToolBlock> {
Called by:
src/daemon/stream.rs:append_tool_data_effects:206
src/daemon/stream.rs:process_agent_output:552 (when events.get(name.as_str()) is Some(coworker_events))
Note: installation differs by environment. The CLI installs with Cargo. Claude Code can also load the plugin (skill + hooks) via the repo's plugin metadata.
curl -fsSL https://raw.githubusercontent.com/btucker/tracegrep/main/install.sh | sh
This downloads the latest release binary for your platform and installs it to ~/.local/bin. You can customize the install directory:
curl -fsSL https://raw.githubusercontent.com/btucker/tracegrep/main/install.sh | INSTALL_DIR=/usr/local/bin sh
Or install a specific version:
curl -fsSL https://raw.githubusercontent.com/btucker/tracegrep/main/install.sh | VERSION=v0.1.0 sh
Install rg first, then install tracegrep from this repo:
cargo install --path .
This installs both tracegrep and tg.
Then install shell completions:
tg --install-completions
tg auto-detects bash, zsh, or fish from $SHELL. For bash and zsh,
it also updates your shell rc file so completions load in new shells. Restart the
shell after installation, or source the updated rc file once.
In Claude Code, register the repository marketplace first:
/plugin marketplace add btucker/tracegrep
Then install the plugin from that marketplace:
/plugin install tracegrep@tracegrep-dev
Use the CLI directly and point the agent at the local skill file:
skills/tracegrep/SKILL.md
That keeps the setup explicit: the agent gets the search workflow from the skill, and tg provides the actual search behavior.
Verify the CLI:
tracegrep --version
tg --help
tg --generate complete-zsh | head
In Claude Code, start a fresh session and ask it to search the repo. It should prefer tg/tracegrep-aware search flow rather than raw rg.
When installed as a Claude Code plugin, tracegrep also ships a PreToolUse hook for the Grep and Search tools that blocks direct usage and tells Claude to run tg through the Bash tool instead. This does not block grep or tg commands that Claude runs inside Bash.
After cargo install --path ., both tracegrep and tg are installed.
# Install completions once for the current shell
tg --install-completions
# Search with caller/reference context
tg tool_data /path/to/repo
# Inline context onto the location line
tg --compact tool_data /path/to/repo
# Include test callers when they matter
tg --include-tests --include-test-callers tool_data /path/to/repo
# Search a subset of the repo with rg-style path arguments
tg tool_data src tests
# Emit a completion script without installing it
tg --generate complete-zsh
.git/tracegrep/ by default, then merged in memory at query time.TRACEGREP_CACHE_DIR to override the cache root directory.HEAD no longer matches the repo.rg flags can be passed through before <pattern>, but tools that
expect raw rg output should keep using rg.Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub btucker/tracegrep --plugin tracegrepFind your product's blind spots — dogfood against specs, run user trials, A/B experiment across variants, and interview synthetic personas
Semantic code search for Claude Code. Automatically indexes your project and provides intelligent search capabilities.
Smart semantic + hybrid code search for local repositories
Code graph navigation and semantic search for LLM coding agents
Tree-sitter backed code indexing and retrieval for Claude Code. Precise function extraction, cross-file callers, test discovery, and scope-aware grep.
Beacon — semantic code search for Claude Code
Semantic code search powered by ColBERT. Replaces grep/ripgrep with natural language understanding for smarter code navigation.