codesage-retrieval

codesage-retrieval is a skill for Claude Code, Codex from iliaal/codesage. It costs 45 tokens per session (3,841 once invoked), scanned A, 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

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

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

Good fit 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.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iliaal/codesage/codesage-retrieval
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.

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/github.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/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 codesage-retrieval

Your own site · 80×15
<a href="https://agentmods.dev/skills/iliaal/codesage/codesage-retrieval"><img src="https://agentmods.dev/badge/skills/iliaal/codesage/codesage-retrieval.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,841 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.00045 $0.03841
Opus 5.5 $0.00018 $0.01536
Sonnet 5.5 $0.00009 $0.00768
Haiku 4.5 $0.00005 $0.00384

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

Security

Grade A, and why

codesage-retrieval 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 17d 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/codesage-tools/skills/codesage-retrieval/SKILL.md · 162 lines

How it starts

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

CodeSage retrieval

Establish the project boundary

Use indexed retrieval when .codesage/index.db exists and codesage status succeeds in the repository under work. Otherwise use rg; onboard only when authorized. help works in any existing absolute directory. edit_check works in a Git repository without an index.

Pass the absolute repository root as project on every project-scoped MCP call. Keep repositories separate. The operator tool daemon_stats has daemon scope and no project argument. Reuse the global MCP registration; do not create duplicate project registrations. After upgrading, refresh the plugin and start a new host session if newly advertised tools are unavailable.

Choose by intent and target

Use CodeSage for behavior discovery and code-graph questions. Use find_symbol for definitions and find_references for structural uses. Use rg for literal occurrences, including configuration keys, test names, error messages, documentation, and generated files. Identifier spelling does not choose the tool: every occurrence of TIMEOUT needs literal search; its definition needs a symbol query. Prefer the smallest query that answers the question.

Entity tools take target, or targets for file sets. trace_call_path takes from and to. Accepted forms depend on the tool: sym:, file:, dir:, chunk:, and feat_ handles, indexed paths, path:line, qualified or bare names, route:METHOD path, and cmd:name. Use help to check a tool's allowed forms. Prefer returned handles and candidate choices. A handle identifies the intended entity, but name-based union tools can still return uses or similarity seeds shared by several definitions. Do not supply disagreeing legacy and current argument spellings.

Read freshness by evidence type

Inspect index.structural, index.dirty_paths, and completeness before acting on structural facts. Structural MCP queries can overlay changes to already indexed files with limits of 50 files and 2 MiB of source, and a cooperative 500 ms preparation budget. A successful overlay reports index.structural: "overlay"; changed definitions and source are current within that measured scope. The overlay does not discover newly untracked files. A bound or failure falls back to indexed facts with index.structural: "dirty" and index.overlay.reason; index.overlay.checked_all: false means even the dirty-file scan is incomplete. Follow the recovery command codesage index when the overlay cannot cover the required scope.

Read the full file on GitHub · 162 lines

Files

What ships with it

2 files 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. 17d ago Changed · +78 lines · -28 tokens per session scan B → A d4874936de85
  2. 24d ago Changed · +1 lines a1d5a7f437d8
  3. 25d ago Changed · +1 lines 6f800a8f5369
  4. 1mo ago Changed · +4 lines ab1bd25dab0a
  5. 1mo ago Changed · +11 lines 81ed18ae5873
  6. 1mo 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 (21 stars, last pushed today), licensed MIT. It adds 45 tokens to every session and 3,841 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

rawq

Context retrieval engine. Semantic + lexical hybrid search over codebases. Returns ranked code chunks with file paths, line ranges, scope labels, and confidence scores.

auyelbekov/rawq · 0 tokens

codemeridian-context

Gather minimal, graph-grounded CodeMeridian context before code changes, debugging or test planning, resolving target-folder project contexts and relevant cross-repository dependencies.

Driftya/code-meridian · 36 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