query-code

query-code is a skill for Claude Code from Borda/AI-Rig. It costs 87 tokens per session (3,729 once invoked), scanned A, original, Apache-2.0.

A query tool for a structural index of Python code. It answers questions about dependencies, callers, imports, paths, symbols, change impact, tests, mocks, fixtures, and subprocesses.

In plain words
What is it for?
Use it to find who calls a function, what depends on a symbol, which tests may be affected, or what the likely blast radius of a change is.
Why use it?
It helps developers understand how code is connected before changing it, especially when the affected files or callers are not obvious.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the codemap-py plugin — 6 skills shipped together

Good fit Use it to find who calls a function, what depends on a symbol, which tests may be affected, or what the likely blast radius of a change is.

Compare 6 skills from other repositories ↓
Install

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.

Claude Code
/plugin marketplace add Borda/AI-Rig
Claude Code
/plugin install codemap-py

Made for: Claude Code.

Or install codemap-py, the plugin that ships this one along with the rest of its 6 skills.

Wrote 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.

agentmods badge for query-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/borda/ai-rig/query-code/github.svg)](https://agentmods.dev/skills/borda/ai-rig/query-code)
Your own site
<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.

agentmods 80×15 button for query-code

Your own site · 80×15
<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>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,729 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 13d ago against content hash 9cfcf9039fd1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

plugins/codemap-py/claude-skills/query-code/SKILL.md · 125 lines

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

Read the full file on GitHub · 125 lines

Changes

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.

  1. 13d ago Changed · +1 lines 9cfcf9039fd1
  2. 17d ago Changed · +2 lines 0a195c149c39
  3. 1mo ago Changed · -2 lines 507b6c085b51
  4. 1mo ago Changed · +1 lines · +9 tokens per session e0619fac85c0
  5. 1mo ago Changed · +2 lines 084d1f53d2e3
  6. 2mo ago Changed · +16 lines 28c67219cbc0
  7. 2mo ago Changed · +3 lines 3bf70ec4ad41
  8. 2mo ago Changed · +4 lines 970bf09d6079
  9. 2mo ago Changed 57a6bfdf1e98
  10. 2mo ago First seen · 98 lines · 78 tokens per session scan A 7e69e1665371

Subscribe to this mod's changes

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.

Related

query-code compared with skills from other repositories

query-code next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
query-codeBorda/AI-RigSkill31yesterdayApache-2.0A87Claude Code
python-lspoaustegard/claude-skillsSkill421todayMITA155Claude Code
searching-codebasesoaustegard/claude-skillsSkill421todayMITA133Claude Code
shiny-py-optimizeposit-dev/skillsSkill57618d agoMITA105Claude Code
php-quality-toolingfusengine/agentsSkill341mo agoMITA51Claude Code
python-performance-optimizationJartan-LLC/grimoireSkill47d agoMITA23Claude Code
tools-pythonalexei-led/architectSkill29d agoMITA118Claude Code, Codex