Explore and analyze codebases with token-efficient search combining FTS5, ripgrep regex, sparse n-gram prefiltering, AST structural search, and code-graph navigation. Trace symbol usages, map dependencies, assess blast radius, extract architectural patterns, and compare files through a unified MCP server.
Build or refresh the grepika code search index for the current project. Supports full rebuild (default) or incremental updates.
Find all references to a symbol using grepika's word-boundary matching and automatic reference classification (definition, import, type_usage, usage).
Search the codebase using grepika's ranked, token-efficient search. Combines FTS5, ripgrep-backed regex search, and sparse n-gram prefiltering for relevance-ranked results.
Use this agent for complex, multi-step codebase explorations that require strong reasoning — call graph building, multi-file architectural analysis, and deep investigations across many files. This agent uses a more capable model than the standard explorer. Use the standard grepika:explorer agent for quick lookups, single searches, and file reads. Use grepika:explorer-deep when: - Building recursive call graphs (3+ levels of refs tracing) - Tracing data flow across multiple modules - Analyzing complex architectural patterns - Investigating subtle bugs that span many files <example> Context: User needs a full call graph for a complex function. user: "Build a complete call graph for the processPayment function, including all transitive callers" assistant: "I'll use grepika:explorer-deep for this multi-level call graph analysis." <commentary> Recursive refs tracing across many files requires strong reasoning to track state and compose results. </commentary> </example> <example> Context: User needs to understand data flow across the entire system. user: "Trace how a user request flows from the API handler through to the database and back" assistant: "Let me use grepika:explorer-deep to trace the full request lifecycle." <commentary> Multi-module data flow tracing requires reasoning about types, transformations, and module boundaries. </commentary> </example> <example> Context: User is investigating a complex cross-cutting concern. user: "How is authentication enforced across all API endpoints?" assistant: "I'll use grepika:explorer-deep to analyze the auth middleware and trace its application." <commentary> Cross-cutting concerns require checking many files and synthesizing a coherent picture. </commentary> </example>
Use this agent when you need to explore a codebase efficiently using the grepika MCP server. This agent specializes in token-efficient code search, file discovery, structural analysis, and code-graph navigation. It should be used instead of the generic Explore agent when grepika tools are available. <example> Context: User asks about how a feature works in the codebase. user: "How does authentication work in this project?" assistant: "I'll use the grepika explorer to trace through the authentication flow." <commentary> The user wants to understand a codebase area. Use grepika:explorer for efficient ranked search and file discovery. </commentary> </example> <example> Context: User wants to find where something is defined or used. user: "Where is the UserRepository class used?" assistant: "Let me use grepika:explorer to find all references and related files." <commentary> Finding symbol references and related code is a core strength of grepika's refs and related tools. </commentary> </example> <example> Context: User needs to understand codebase structure before making changes. user: "I need to add a new API endpoint. What's the pattern here?" assistant: "I'll explore the existing API structure using grepika to find relevant patterns." <commentary> Understanding existing patterns requires searching for similar code and extracting file outlines. </commentary> </example> <example> Context: Claude is about to explore code and grepika MCP tools are available. assistant: "Before implementing this feature, I'll use grepika:explorer to understand the existing code structure." <commentary> Proactively use this agent when exploring codebases where grepika is configured. </commentary> </example> <example> Context: User wants to compare two files to understand what changed. user: "Compare the old and new config files to see what changed" assistant: "I'll use grepika:explorer to diff the files and explain the differences." <commentary> The diff tool provides token-efficient file comparison with unified diff output. </commentary> </example> <example> Context: User wants to understand the complete call hierarchy for a function. user: "Build a call graph for the handleRequest function" assistant: "Let me use grepika:explorer to trace all callers and build the complete call hierarchy." <commentary> Using refs recursively to build call graphs is a key grepika workflow for understanding code flow. </commentary> </example>
This skill should be used when the user asks to "analyze impact of changes", "check blast radius", "what would break if I change this", "refactoring safety analysis", or mentions keywords related to change impact assessment and dependency tracing.
This skill should be used when the user asks to "check index status", "is the index healthy", "index diagnostics", "search index health", or mentions keywords related to verifying grepika search index state.
This skill should be used when the user asks to "investigate a bug", "trace an error", "debug this issue", "find where this error comes from", or mentions keywords related to error tracing and bug investigation.
This skill should be used when the user asks to "learn this codebase", "give me a codebase overview", "onboard me to this project", "explain the architecture", or mentions keywords related to understanding codebase structure and architecture.
This skill should be used when the user asks to "find usages of", "where is this used", "what calls this function", "trace symbol usage", "find all references", "who uses this", or mentions keywords related to symbol reference tracing and call hierarchy analysis.
No model invocation
Executes directly as bash, bypassing the AI model
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.
Token-efficient MCP server for code search.
LLMs burn context tokens on every search call. grepika indexes your codebase and returns ranked, compact results — so the model spends tokens reasoning instead of reading raw grep output. It combines FTS5, ripgrep-backed regex search, and a sparse n-gram prefilter for ranked lexical search, then adds MCP tools for AST structural search and code-graph navigation.
grep is a great tool, but it wasn't designed for LLM workflows. It returns unranked file lists, and the model has to make multiple calls to piece together context. grepika gives the model structured tools for the things it actually needs to do:
| Task | grep approach | grepika |
|---|---|---|
| Find a pattern | Unranked file list | Ranked results with relevance scores |
| Understand a symbol | Multiple grep calls, manual assembly | refs classifies definitions, imports, usages |
| Explore structure | Read entire files | outline extracts functions/classes/structs |
| Find related code | Guess-and-grep loop | refs finds files sharing symbols |
| Natural language query | Requires regex | search routes to BM25 full-text search |
| Find syntax patterns | Fragile regex | structural_search matches AST patterns and node kinds |
| Trace relationships | Manual file hopping | graph navigates indexed call/import edges |
Criterion benchmarks against ripgrep content output on the grepika codebase, 9 queries across all intent categories:
| Metric | grepika | ripgrep (content mode) |
|---|---|---|
| Response size | 2,352 B avg | 17,336 B avg |
| Mean per-query savings | 61.4% | N/A |
| Relevance ranking | BM25 + grep + sparse n-gram signals | None |
| Structural search | AST pattern/kind matching, no index required | Regex only |
Savings are largest on high-match queries (for example, fn saves 93.8%); low-match patterns can be larger with grepika because structured JSON has a fixed cost. See full analysis.
Compared to ripgrep content output (matching lines), indexed search returns fewer tokens per query. The bigger win is search quality — ranking, NLP queries, and reference classification reduce follow-up reads.
Criterion benchmarks on the grepika codebase, 9 queries across all intent categories:
Query │ grepika │ ripgrep (content) │ Savings
──────────────────┼──────────┼────────────────────┼────────
SearchService │ 3,227 B │ 10,053 B │ 67.9%
Score │ 2,433 B │ 6,497 B │ 62.6%
Database │ 2,680 B │ 12,379 B │ 78.4%
fn │ 2,880 B │ 46,125 B │ 93.8%
use │ 2,676 B │ 31,868 B │ 91.6%
search service │ 787 B │ 1,556 B │ 49.4%
error handling │ 782 B │ 985 B │ 20.6%
fn\s+\w+ │ 2,896 B │ 43,898 B │ 93.4%
impl.*for │ 2,806 B │ 2,664 B │ -5.3%
Savings are largest on high-match queries where ripgrep returns many unranked lines. Natural language queries route to FTS5 concept search in grepika and now stay close to ripgrep's output size while preserving ranking and snippets.
Claude Code lazy-loads MCP tools on demand, so grepika's 12 tool schemas are not loaded all at once. Loaded schemas are prompt-cached after the first call (~90% discount on subsequent turns). In the current benchmark, the full schema is 11,475 bytes (~2,869 tokens), and the one-time schema cost breaks even after one average search compared with ripgrep content output.
See docs/token-efficiency-analysis.md for the full comparison including Grep file-list mode and workflow analysis.
cargo clippy --all-targets, and Criterion benchmarks cover library, CLI, MCP, graph, and structural-search pathsBy default, grepika runs in global mode — the server starts without --root, and the LLM calls add_workspace with its working directory automatically.
The grepika plugin bundles the MCP server with an exploration agent, skills, and commands.
npx claudepluginhub agentika-labs/grepika --plugin grepikaSemantic code search for Claude Code. Automatically indexes your project and provides intelligent search capabilities.
Fast and token-friendly code reading for AI coding agents. Symbol-aware MCP tools that replace cat/grep with ~85% fewer tokens, sub-millisecond search, and a raw fallback that preserves cat/grep parity byte-for-byte.
Semantic code search powered by ColBERT. Replaces grep/ripgrep with natural language understanding for smarter code navigation.
Graph-first code intelligence for AI agents. SurrealDB knowledge graph + 52 MCP tools replace Read/Grep/Glob with deterministic graph traversal. 80–95% fewer tokens on code context. Rust-native, fully local.
Beacon — semantic code search for Claude Code
Codebase intelligence — semantic search workflows, dependency graph analysis, and context artifact exploration for SocratiCode