codebase-index

A local repository-analysis guide that searches an indexed codebase before inspecting source files.

In plain words
What is it for?
Use it to locate code, explain behavior, map references and data paths, review architecture, investigate bugs, and assess refactoring risks.
Why use it?
It makes repository questions more focused by tracing evidence about implementations, callers, dependencies, and change impact.

Skill for Claude CodeCodex

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/denfry/codebase-index/skill_template
Any agent
npx skills add denfry/codebase-index --skill skill_template
Clone the repo
git clone --depth 1 https://github.com/denfry/codebase-index

Made for: Claude Code, Codex.

Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 981 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00053 $0.00981
Opus 5 $0.00026 $0.00491
Sonnet 5 $0.00011 $0.00196
Haiku 4.5 $0.00005 $0.00098

Measured yesterday against content hash 1f55dbaa9733, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codebase-index 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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/cbx.ps1), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Origin

This is a copy

100% identical to codebase-index — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

src/codebase_index/skill_template/SKILL.md · 90 lines

How it starts

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

Codebase Index

Use the local index before reading repository files.

The operating principle is Find → Trace → Predict:

  • Find the implementation with ranked retrieval.
  • Trace behavior through definitions, callers, dependencies, and paths.
  • Predict change impact while preserving an explicit evidence trail.

Route the question

Intent Command
Where is X implemented? codebase-index search "X" --json
How does X work? codebase-index explain "X" --json
What is this codebase? codebase-index architecture --json
Find a named symbol codebase-index symbol "X" --json
Who calls or references X? codebase-index refs "X" --json
What changes if X changes? codebase-index impact "X" --json
What does my current diff affect? codebase-index diff-impact --json
How are X and Y connected? codebase-index path "X" "Y" --json
Describe X and its neighborhood codebase-index describe "X" --json
Produce a human graph codebase-index graph "X" --output <path>

Use search --mode symbol for exact symbol work, --mode fts for text and error messages, and the default hybrid mode for mixed questions. Use pure vector mode only when embeddings are enabled and exact vocabulary is unknown.

Read references/commands.md only when command options or routing remain unclear.

Evidence protocol

  1. Run the best-matching command with --json.
  2. Check index before trusting the payload:
    • missing → run codebase-index index, then repeat;
    • stale with fewer than 20 changed files → run codebase-index update;
    • stale with 20 or more changed files → run codebase-index index;
    • fresh → continue.
  3. Start with ranks 1–3. Read only recommended_reads line ranges.
  4. Trace one additional hop only when the question requires behavior, ownership, or impact.
  5. Answer with file:line evidence and state uncertainty explicitly.

Do not open whole files when a line range is available. A snippet may already be sufficient. skeletonized: true means the response intentionally folded unrelated body lines; read the supplied range when the missing body matters.

Read the full file on GitHub · 90 lines

Files

What ships with it

5 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. yesterday First seen · 90 lines · 53 tokens per session scan A 1f55dbaa9733

Subscribe to this mod's changes

codebase-index is a skill published in the GitHub repository denfry/codebase-index (7 stars, last pushed 1mo ago), licensed MIT. It adds 53 tokens to every session and 981 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to codebase-index, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

optimize-accuracy-first

Diagnose, design, implement, and validate system optimizations while treating correctness, retrieval quality, bounded behavior, and avoided downstream work as primary outcomes. Use for performance, latency, CPU, memory, storage, indexing, search, retrieval, caching, batching, concurrency, tokenizer, database, or…

morluto/leantoken · 90 tokens

codebase-search

Semantic code and documentation search by meaning. Use codebasepeek to find WHERE code is (saves tokens), codebasesearch to see actual code. For exact identifiers, use grep instead. Search local codebase before using websearch for code/library/API/example questions.

Helweg/open-codebase-index · 58 tokens

codebase-search

Preferred local codebase-understanding workflow for Pi and Codex. Start with codebasecontext before shell search or broad reads, then use specialized semantic and graph tools.

Helweg/open-codebase-index · 37 tokens

wiki

Rebuild a flow-first project wiki using the mimirs wiki MCP tool. Use when the user asks to generate, rebuild, refresh, or write the wiki for a codebase.

TheWinci/mimirs · 38 tokens

review-pr-comments

Fetch PR review comments via gh CLI, classify them (valid & fix / valid & skip / invalid), fix the valid ones, reply and resolve the threads, and fix any CI failures. Invoke only when the user types /review-pr-comments — never auto-trigger.

IBazylchuk/paparats-mcp · 57 tokens

extract-terminology

Walk a project's documentation and code, extract the domain terminology (abbreviations, service names, product names, domain concepts), and record each term into the paparats glossary via the termrecord MCP tool. Deduplicates against existing terms through the built-in similarity gate. Invoke only when the user types…

IBazylchuk/paparats-mcp · 75 tokens