Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add Borda/AI-Rig/plugin install codemap-pyWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/borda/ai-rig/query-code)<a href="https://agentmods.dev/skills/borda/ai-rig/query-code"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/query-code/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/borda/ai-rig/query-code"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/query-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00087 | $0.03729 |
| Opus 5.5 | $0.00035 | $0.01492 |
| Sonnet 5.5 | $0.00017 | $0.00746 |
| Haiku 4.5 | $0.00009 | $0.00373 |
Grade A, and why
query-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.
NOT for: rebuilding the index (use /codemap-py:scan-codebase), renaming symbols (use /codemap-py:rename-refs), or which tests cover or are affected by a change (use /codemap-py:test-impact). Out-of-scope request (non-Python target, rename, text search) → say skill does not apply, name route (/codemap-py:rename-refs for Python rename; plain text search otherwise), stop; never answer structural question or list references from manual source reads.
Test-impact split: a one-off structural fact ("which tests would this touch?") uses table subcommand test-impact <target>; full affected-test workflow (index ensure, JSON parse, pytest command, not_covered caveat) uses /codemap-py:test-impact. NOT-for defers workflow, not subcommand.
Skip Codemap when exact file + symbol localize edit and no caller, dependency, blast-radius, test-impact, import, or source-slice fact remains open. Lifecycle boundary—callback/hook, cancellation/exception, scheduling/cleanup, state transfer—keeps scope open: inspect source + named test/oracle, then query fn-rdeps for caller or fn-deps for callee responsibility. Explicit structural query/tool requirement overrides skip. Otherwise use smallest complete query.
Choose the smallest complete query set
"Affected if X changes" = reverse dependencies. Run every query from the caller's current repository; working directory selects project index. Do not cd into $CLAUDE_PLUGIN_ROOT or plugin directory.
codemap-py query --compact <subcommand> [arguments]
For another project root, pass --root <root> to select that root's canonical index. Use --index <emitted-index-path> --root <same-root> when querying a specific index file; --index selects the file, while --root sets query path resolution and establishes the root boundary. An --index path outside the current directory and git root is accepted only when it is exactly the index that the scan's CODEMAP_INDEX_DIR, still set to the same value, or the default layout resolves for that --root; otherwise the CLI exits with index path outside project root.
Enabled plugin adds version-matched bin/ to Bash PATH. If unavailable interactively, invoke installed plugin's absolute bin/codemap-py launcher as one standalone command and accept normal host permission prompt. Prepend no cd, export, or other shell command.
| Goal | Query subcommand |
|---|---|
| production module importers / blast radius | rdeps <module> --exclude-tests |
| direct test-module importers | rdeps <module> then filter/report test modules |
| module imports | deps <module> |
| shortest import chain | path <from> <to> |
| production centrality / highest in-degree | central --top N --exclude-tests |
| rank / threshold a known candidate set | central --among <a,b,c> --exclude-tests |
| production vs test importer counts | rdeps <module> --exclude-tests (importer_count, excluded_test_importer_count) |
| internal-import coupling (not centrality) | coupled --top N |
| symbol source including module imports or module symbols | symbol <name> --with-imports · symbols <module> |
| regex symbol search | find-symbol <pattern> |
| direct production callers | fn-rdeps <module::symbol> --exclude-tests |
| callers plus test-module importers | fn-rdeps <module::symbol> --exclude-tests, then rdeps <module> |
| direct imports / callees | fn-deps <module::symbol> |
| transitive callers / function blast | fn-blast <module::symbol> |
| broken Sphinx cross-references | xrefs --broken <module> |
| changed-code blast radius | diff-impact [--base REF] |
| transitive affected tests / mocks | test-impact <target> · mock-rdeps <target> |
| pytest fixtures | fixture-rdeps <name> · fixture-graph <test-file> |
| subprocess relationships | subprocess-deps <module> · subprocess-rdeps <module> |
| coverage / documentation gaps | coverage <target> · coverage-gap [module] · undocumented [module] |
| repository shape / package inventory | packages (per-package module/test/docs counts) · list --limit 0 |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 13d ago Changed · +1 lines 9cfcf9039fd1
- 17d ago Changed · +2 lines 0a195c149c39
- 1mo ago Changed · -2 lines 507b6c085b51
- 1mo ago Changed · +1 lines · +9 tokens per session e0619fac85c0
- 1mo ago Changed · +2 lines 084d1f53d2e3
- 2mo ago Changed · +16 lines 28c67219cbc0
- 2mo ago Changed · +3 lines 3bf70ec4ad41
- 2mo ago Changed · +4 lines 970bf09d6079
- 2mo ago Changed 57a6bfdf1e98
- 2mo ago First seen · 98 lines · 78 tokens per session scan A 7e69e1665371
query-code is a skill published in the GitHub repository Borda/AI-Rig (31 stars, last pushed yesterday), licensed Apache-2.0. It adds 87 tokens to every session and 3,729 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
query-code compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| query-codeBorda/AI-Rig | Skill | 31 | yesterday | Apache-2.0 | A | 87 | Claude Code |
| python-lspoaustegard/claude-skills | Skill | 421 | today | MIT | A | 155 | Claude Code |
| searching-codebasesoaustegard/claude-skills | Skill | 421 | today | MIT | A | 133 | Claude Code |
| shiny-py-optimizeposit-dev/skills | Skill | 576 | 18d ago | MIT | A | 105 | Claude Code |
| php-quality-toolingfusengine/agents | Skill | 34 | 1mo ago | MIT | A | 51 | Claude Code |
| python-performance-optimizationJartan-LLC/grimoire | Skill | 4 | 7d ago | MIT | A | 23 | Claude Code |
| tools-pythonalexei-led/architect | Skill | 2 | 9d ago | MIT | A | 118 | Claude Code, Codex |