/supergrep:code-contextfrom supergrep
Uses SuperGrep MCP tools (find, sql, search) to answer codebase questions via exact-text lookup, SQL aggregation, and hybrid keyword+semantic search. Replaces grep for identifiers and spans many files.
Ships in supergrep. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
code-context maintains a local index of the repository (in .infino/ at the
repo root) and always exposes find, sql and read over it; search
registers too when the server has an account, running over the same index's
platform copy where the embeddings are computed. Every lookup an agent
would otherwise do with grep or by crawling files runs against the index
instead: find for the exact-text case, search for one ranked pass over
everything that spans the repo, sql to count and rank.
When the tool names appear in a deferred-tools listing but their schemas are
not loaded, load them in ONE ToolSearch call before the first use, e.g. query
+code-context find search sql read (or select: with the exact
listed names, comma-separated) - name only the tools that actually appear in
the deferred listing, since search is registered only when the server has
an account. Never load them one call at a time.
| Situation | Use |
|---|---|
| Every occurrence of an exact identifier, string, or key (where you would grep) | find |
| A file you already know the path of | read |
| "How does X work", "where is Y handled", concept without exact name | search |
| Counts, rankings, GROUP BY across the repo ("which files have the most code about X") | sql |
| Several independent questions at once | one call with queries, or several calls in the same turn |
| Working tree changed a lot mid-session | nothing - the next query re-syncs (see lifecycle) |
ignoreCase.path, line,
and the line's text (plus the enclosing definition's symbol when
known), in path order, up to limit (default and cap 500, so it only
bites on a flood; pass a smaller limit when you want fewer). total is
the repo-wide count either way, byFile lists matching lines per file
over every match (the grep -c answer, never cut), and truncated says
when the line list was cut - narrow the text.find locates
occurrences across the repo; pulling a few lines out of one known file
is a Read.parse_config is
parse and config), but that only widens the candidates: find returns
only lines containing the exact text you gave.path:line (a few lines around it) when you need the surrounding
code; most grep-shaped questions are answered by the list itself.Registered only when the server has an account; it runs over the platform copy of the index, where the embeddings are computed.
cite (its place written path:start-end - keep it
exactly as given), path, startLine-endLine, and the chunk content
with a relevance score. Answer from the chunk content when it suffices,
citing the hit's own cite; open a file only for what the chunks don't
show.truncated, Read exactly its start-end range
(offset/limit), not the whole file.k (default 10, max 50) bounds hits; raise it for survey-style questions.lines: true returns each hit as only the lines of its chunk that carry
one of your query's words, with two lines of context, each numbered with
its line in the file - in place of the whole chunk. Use it over logs, test
output and other long records, where the matching lines are the answer
and the rest of the chunk is padding; put the words you expect on those
lines into the query. A hit with matchedLines: 0 ranked on meaning
alone and comes back whole.One read-only SELECT/WITH statement over the table
chunks(path, start_line, end_line, lang, symbol, content[, embedding]).
Search functions are callable as table-valued relations, so one query can
rank AND aggregate:
hybrid_search('chunks','content','<terms>','embedding', {{q}}, k) -
keyword fused with meaning. Rank with this unless you have a reason
not to: the words in a question are rarely the words in the code. It
takes a {{name}} placeholder filled via the embed argument, e.g.
{"q": "query text"}.bm25_search('chunks','content','<terms>', k) - keyword only. Use it
when the topic is a literal string you know appears in the source and
you want counts a reader can check as occurrences. No embedding needed.vector_search('chunks','embedding', {{q}}, k) - meaning alone.token_match('chunks','content','<term>','and') - unranked and
complete: every chunk holding the token, with no top-k at all. This is
the one to count with.regexp_like(content, 'pattern') works in WHERE.The canonical move - "which files have the most code about X". Fill in your
own words in both places; <terms> is never the literal string to send:
SELECT path, SUM(end_line - start_line + 1) AS ranked_lines, COUNT(*) AS chunks
FROM hybrid_search('chunks','content','merge small superfiles','embedding', {{q}}, 300)
GROUP BY path ORDER BY ranked_lines DESC LIMIT 15
with embed {"q": "how small superfiles are merged into larger ones"}.
The alias says ranked_lines and not matched_lines on purpose: fusion
unions the keyword and meaning arms, so a row can rank in the top 300
without containing your terms. Report such a total as "lines ranked in the
top 300 for X", never as occurrences.
Two relations compose in one statement, which is what makes this worth learning. A ranked search says which files matter; an unranked match counts them exactly. One query, no round trips, and a count a reader can verify by opening the line:
WITH about AS (
SELECT DISTINCT path
FROM hybrid_search('chunks','content','merge small superfiles','embedding', {{q}}, 300)
)
SELECT t.path, COUNT(*) AS chunks_with_term
FROM token_match('chunks','content','merge','and') t
JOIN about USING (path)
GROUP BY t.path ORDER BY chunks_with_term DESC LIMIT 15
cx index --full from a
shell rebuilds it.--db, the same index is also kept on an
Infino platform database; the build and every sync write both, so nothing
about the lifecycle changes for you.partial marker means the repo exceeded the index's
file cap and some files were left out: treat a missing match as
possibly-unindexed, not as proof the code doesn't exist.usage receipt - find, plain
sql and read's computed locally (tokens returned, matches or chunks /
files, session running total); search's names what the platform
metered for the call. It is there for the user who asks what a
lookup cost; cx usage keeps the local ledger.find, search and sql take an optional path (an absolute repo
root) to target a different repository than the one the server started in,
each with its own local index.
find and a plain sql statement are cheap: milliseconds against the
local index, no account needed. search, and a sql statement with a
ranked search in it, are platform round trips, metered there.cx index --full rebuilds unless the index
is actually wrong, and avoid triggering first-time indexing of large repos
that the task does not need.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub infino-ai/supergrep --plugin supergrepOther plugins' skills for the same job