codebase-search

A local code-search workflow for understanding an existing repository. It helps locate definitions, related code, similar implementations, and paths through the codebase before making changes.

In plain words
What is it for?
Use it to find symbols, inspect relevant code, trace execution paths, compare duplicate patterns, and check whether the code index is ready or needs rebuilding.
Why use it?
It reduces the need to search files blindly and makes it easier to understand how parts of a project depend on one another.

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

Made for: Claude Code, Codex.

Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 464 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00037 $0.00464
Opus 5 $0.00018 $0.00232
Sonnet 5 $0.00007 $0.00093
Haiku 4.5 $0.00004 $0.00046

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

Security

Grade A, and why

codebase-search 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 2d 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.

skills/codebase-search/SKILL.md · 44 lines

What it actually says

Codebase Search Skill

Use this skill when you need local repository knowledge before web lookup.

Core workflow

  1. Run index_status when index readiness or freshness is unknown.
  2. Use codebase_context(query, ...) before shell search, grep, or broad file reads. Pass symbol for an authoritative definition or from + to for a dependency path.
  3. Use codebase_peek(query, ...) for specialized metadata-only conceptual lookup.
  4. Use codebase_search(query, ...) when you need full code context.
  5. Use implementation_lookup(query) for known-symbol definitions and call_graph / call_graph_path for execution flow.
  6. Use find_similar(code) for duplicate patterns and refactor planning.

If results are weak, run index_status (check readiness) and index_codebase.

Tool Priority

  • codebase_context as the preferred first repository tool and unified router.
  • codebase_peek for specialized discovery (fastest, cheap tokens).
  • codebase_search for exact implementation review.
  • find_similar for pattern matching and duplication.
  • call_graph and call_graph_path for execution flow.
  • index_codebase (force/estimate/verbose) for first-time or stale indexes.
  • index_status, index_health_check, index_metrics, index_logs for operational checks.

Suggested Commands

  1. codebase_peek("payment processing flow")
  2. codebase_search("payment processing flow")
  3. call_graph("chargeCard", "callees")
  4. find_similar("function validate(data)")
  5. implementation_lookup("validate")

Additional Notes

  • Use grep for exact identifiers and tiny, deterministic lookups.
  • Use websearch only when local tools return no results and docs are likely missing.
  • Prefer codebase_peek before codebase_search to avoid high token usage.
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. 2d ago First seen · 44 lines · 37 tokens per session scan A 01b7766bf38e

Subscribe to this mod's changes

codebase-search is a skill published in the GitHub repository Helweg/open-codebase-index (183 stars, last pushed 3d ago), licensed MIT. It adds 37 tokens to every session and 464 once invoked, about $0.0002 per session on Opus 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

gno

Search local documents, files, notes, and knowledge bases. Index directories, search with BM25/vector/hybrid, get AI answers with citations. Use when user wants to search files, find documents, query notes, look up information in local folders, index a directory, set up document search, build a knowledge base, needs…

gmickel/gno · 86 tokens

cocosearch-review-pr

Use when reviewing a GitHub PR or GitLab MR by URL. Fetches diff and metadata via API, then uses CocoSearch for blast radius analysis, dependency impact, pattern consistency, and test coverage assessment. Read-only by default; optionally pushes findings back as inline PR/MR comments after your confirmation.

VioletCranberry/coco-search · 68 tokens

cocosearch-add-language

Use when adding support for a new programming language or config format to CocoSearch. Guides through all paths (handler, symbol extraction, context expansion) with registration checklists. For grammar handlers, use cocosearch-add-grammar.

VioletCranberry/coco-search · 53 tokens

cocosearch-add-extractor

Use when adding a dependency extractor for a language or grammar. Guides through pre-checks, extractor implementation, optional module resolver, tests, and registration. Enables deps tree, deps impact, and dependency-enriched search for the target language.

VioletCranberry/coco-search · 57 tokens

cocosearch-add-grammar

Use when adding a grammar handler for domain-specific file formats that share a base language extension (e.g., GitHub Actions within YAML). Guides through YamlGrammarBase inheritance, content validation, separator spec, metadata extraction, tests, and registration.

VioletCranberry/coco-search · 57 tokens

cocosearch-commit

Use when committing changes — analyzes staged (or unstaged) diffs with CocoSearch semantic search and dependency impact to generate comprehensive Conventional Commit messages. Reviews changes thoroughly, then asks user to approve, edit, or abort the commit.

VioletCranberry/coco-search · 53 tokens