/code-search:code-searchfrom Code Search
Use when searching source code with ripgrep, ast-grep, semgrep, LSP/ctags, or comby: text/regex, structural/AST patterns, symbol definitions/references/callers, code changed in git history, rewrites, or size/complexity metrics.
Ships in Code Search. 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.
Read when SKILL.md points to them.
CLI search for source code. Pick the modality by what you know.
This skill is portable across GitHub Copilot, APM, and Claude Code; keep the
references/ folder next to SKILL.md when copying it into a Copilot skill
location.
| Task | Use | Reference |
|---|---|---|
| Text / regex in code | rg | ripgrep |
| Find files by name/path | fd | fd |
| Structural / syntax-aware search | sg (ast-grep) | ast-grep |
| Security/lint rule packs, taint | semgrep | semgrep |
| Symbol defs / refs / call hierarchy | LSP · global · ctags | code-intelligence |
| When/why code changed | git log -S/-G/-L | git-history |
| Structural search-and-replace | comby, sg --rewrite | comby |
| Size / complexity by language | tokei, scc | metrics |
Decision flow: text → rg | structural → sg | symbol defs/refs → LSP/global |
rule packs → semgrep | filenames → fd | change history → git pickaxe |
rewrite → comby | LOC → tokei.
rg -t py, sg --lang ts, fd -e go),
restrict dirs, and count first (rg -c pattern | wc -l) before reading.rg -g '!vendor/' -g '!*.lock', fd -E node_modules.rg -e P1 -e P2) in one walk,
or issue distinct searches as parallel tool calls. Never sequential &&.rg -t ts includes .tsx; fd -e ts does NOT — use fd -e ts -e tsx.retrieval-strategy skill or invoke the retrieval-strategist agent.rtk when installed — prefix the rtk-wrapped tools (rtk rg …,
rtk git log …) for 60–90% smaller output; other tools run directly and
rtk rg -c/-l stay raw (pipe-safe). See rtk.For non-code corpora (JSON/YAML, CSV/Parquet, PDFs/Office), use the
data-and-docs-search skill.
references/ast-grep.md (opens in a new tab)references/code-intelligence.md (opens in a new tab)references/comby.md (opens in a new tab)references/fd.md (opens in a new tab)references/git-history.md (opens in a new tab)references/metrics.md (opens in a new tab)references/ripgrep.md (opens in a new tab)references/rtk.md (opens in a new tab)references/semgrep.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
2 skills in this plugin
npx claudepluginhub mbeacom/context-kit --plugin code-search