codesage-retrieval

codesage-retrieval is a skill for Claude Code, Codex from iliaal/codesage. It costs 73 tokens per session (1,016 once invoked), scanned B, original, MIT.

A skill that routes codebase questions through CodeSage, a tool that searches code by meaning and follows symbols, references, dependencies, and change history in an indexed repository.

In plain words
What is it for?
Use it to trace definitions and references, discover feature slices, analyze dependencies and impact, export context, assess change risk, check edit-session regressions, and select focused tests.
Why use it?
It helps find how code behaves and what an edit may affect when exact text search would miss aliases, callers, or related files.

Skill for Claude CodeCodex

Part of the codesage-tools plugin — 1 skill, 10 commands, 2 agents, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/iliaal/codesage/codesage-retrieval
Any agent
npx skills add iliaal/codesage --skill codesage-retrieval
Clone the repo
git clone --depth 1 https://github.com/iliaal/codesage

Made for: Claude Code, Codex.

Or install codesage-tools, the plugin that ships this one along with the rest of its 1 skill, 10 commands, 2 agents, 1 hook.

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 codesage-retrieval

README.md
[![agentmods](https://agentmods.dev/badge/skills/iliaal/codesage/codesage-retrieval.svg)](https://agentmods.dev/skills/iliaal/codesage/codesage-retrieval)
Your own site
<a href="https://agentmods.dev/skills/iliaal/codesage/codesage-retrieval"><img src="https://agentmods.dev/badge/skills/iliaal/codesage/codesage-retrieval.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,016 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00073 $0.01016
Opus 5 $0.00036 $0.00508
Sonnet 5 $0.00015 $0.00203
Haiku 4.5 $0.00007 $0.00102

Measured 5d ago against content hash 86372e8051ec, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

codesage-retrieval scanned grade B with 1 finding 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 5d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

The CodeSage MCP is registered globally outside this plugin. Do not add per-project or per-tool entries to `~/.codex/config.toml`. After upgrading CodeSage, start a fresh Codex thread if the current session does not expo
plugins/codesage-tools/skills/codesage-retrieval/SKILL.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CodeSage Retrieval

Establish the project boundary

Run from the repository under work:

test -f .codesage/index.db && codesage status

Use CodeSage only when both checks succeed. Otherwise use rg, or ask whether to onboard the repository when indexing would materially improve the task.

Resolve the repository root to an absolute path and pass that path as project on every CodeSage MCP call. Do not pass a parent workspace. For work spanning multiple repositories, make separate calls per repository. If the scope is unclear, establish the target repository before searching; never fan out across all indexed projects.

The CodeSage MCP is registered globally outside this plugin. Do not add per-project or per-tool entries to ~/.codex/config.toml. After upgrading CodeSage, start a fresh Codex thread if the current session does not expose newly added tools.

Choose the retrieval path

Use CodeSage for semantic and code-graph questions: behavior discovery, definitions, callers, imports, dependencies, feature ownership, blast radius, history-derived coupling, risk, and test selection.

Use rg for exact literal strings, error messages, configuration keys, test names, documentation, and generated files. Prefer the smallest query that answers the question; do not export a broad context bundle when a symbol or dependency lookup is enough.

Route MCP calls

  • Start unfamiliar-project orientation with mcp__codesage__project_overview when its combined language, freshness, feature, risk, and convention summary replaces several narrower calls.
  • Use mcp__codesage__find_symbol for exact definitions and mcp__codesage__find_references for callers, imports, inheritance, and type uses.
  • Use mcp__codesage__search for intent, behavior, or symptoms when the symbol name is unknown.
  • Use mcp__codesage__list_features to discover mapped behavior slices and mcp__codesage__find_feature to identify the slice owning a file.
  • Use mcp__codesage__feature_bundle after feature discovery when the entrypoint, owned files, tests, and context for one slice are needed together.
  • Use mcp__codesage__export_context for a curated bundle around a free-form query or symbol when no mapped feature is the right anchor.
  • Use mcp__codesage__list_dependencies for immediate imports and importers. Use mcp__codesage__impact_analysis before renames, broad changes, or API-contract edits to inspect downstream blast radius.
  • Use mcp__codesage__find_coupling for historical co-change context. Read response.coupled; an empty list plus note can mean no history, no pair above the threshold, or a path mismatch.
  • Use mcp__codesage__assess_risk for one file, mcp__codesage__assess_risk_batch for an explicit file set, and mcp__codesage__assess_risk_diff for a patch. Inspect top_symbols when present. Treat clustered directories and cycles touching the patch as evidence to investigate, not proof the patch introduced them.
  • Use mcp__codesage__session_start before substantive edits when a structural baseline is useful, then mcp__codesage__session_end before completion to check for new cycles or top-risk-file drift.
  • Use mcp__codesage__recommend_tests after edits to select focused tests from changed files. Run the relevant tests; recommendations are not verification.

Read the full file on GitHub · 67 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 67 lines · 73 tokens per session scan B 86372e8051ec

Subscribe to this mod's changes

codesage-retrieval is a skill published in the GitHub repository iliaal/codesage (20 stars, last pushed 5d ago), licensed MIT. It adds 73 tokens to every session and 1,016 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

codemeridian-context

Gather minimal, graph-grounded CodeMeridian context before implementation, refactoring, deletion, debugging, or test planning.

Driftya/code-meridian · 29 tokens

human-cognitive-seed

Preserve and strengthen the user's independent reasoning during design, strategy, learning, interpretation, hypothesis work, and consequential decisions, and preserve justified durable context with explicit provenance when supported. Use when a task benefits from human-led judgment, model-building, productive…

Driftya/code-meridian · 99 tokens

memtrace-decision-memory

Use Cortex decision memory through the normal Memtrace MCP tools. Trigger for free-text questions about what was decided, chosen, rejected, banned, or established as a convention; for why a symbol exists or which contracts constrain it; for whether a known decision held, drifted, or was violated; and for the…

syncable-dev/memtrace-public · 137 tokens

memtrace-index

Index a source-code repo into the Memtrace knowledge graph and poll the job to completion. Use when the user asks to index, parse, ingest, reindex, watch, or prepare a source-code repo for Memtrace analysis, when code exploration needs an index, or when searches return 0/partial results for source paths under an…

syncable-dev/memtrace-public · 119 tokens

memtrace-session-continuity

Catch up on everything that changed in an indexed source-code repo since the last session, using stored session anchors and Memtrace change memory. Use when the user asks to continue, catch up, resume, see what changed while away, recover prior context, or orient at session start without guessing timestamps. Do not…

syncable-dev/memtrace-public · 92 tokens

memtrace-continuous-memory

Keep the Memtrace index fresh while editing by watching a repo for live, incremental re-indexing. Use when the user asks to keep Memtrace fresh while editing, watch a repo, enable live or incremental indexing, set up always-on memory (meaning Memtrace index watching, not generic agent memory), or make just-saved…

syncable-dev/memtrace-public · 96 tokens