codebase-search

A search guide for finding code and documentation by meaning in the current project, with separate methods for exact names and broader questions.

In plain words
What is it for?
Use it to find where a feature is implemented, look up local library documentation, find similar code, trace callers and dependencies, or assess which code a change may affect.
Why use it?
It helps developers locate relevant files and understand code flow without already knowing the exact function, class, or variable name.

Skill for Claude CodeCodex

Part of the open-codebase-index plugin — 2 skills, 10 commands, 1 hook, 1 MCP server 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/helweg/open-codebase-index/skill
Any agent
npx skills add Helweg/open-codebase-index --skill skill
Clone the repo
git clone --depth 1 https://github.com/Helweg/open-codebase-index

Made for: Claude Code, Codex.

Or install open-codebase-index, the plugin that ships this one along with the rest of its 2 skills, 10 commands, 1 hook, 1 MCP server.

Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,231 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.00058 $0.01231
Opus 5 $0.00029 $0.00616
Sonnet 5 $0.00012 $0.00246
Haiku 4.5 $0.00006 $0.00123

Measured 3d ago against content hash f228e71218b0, 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 3d 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.

skill/SKILL.md · 136 lines

How it starts

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

Codebase Search Skill

Important: Indexed Content

The indexed codebase contains two types of content:

  1. Project Source Code — all code files in the current workspace
  2. Knowledge Base Documentation — external documentation, usage guides, API references, and example programs added via add_knowledge_base (MCP/OpenCode) or knowledge_base_add (Pi).

When to Use What

Scenario Tool Why
Code/library/API question codebase_search Search local knowledge first
Just need file locations codebase_peek Metadata only, saves ~90% tokens
Need to see actual code codebase_search Returns full code content
Find duplicates/patterns find_similar Given code snippet → similar code
Understand code flow call_graph Find callers/callees of any function
Trace dependency paths call_graph_path Find a shortest known path between two symbols
Analyze PR blast radius pr_impact Find affected symbols, communities, hub nodes, and risk
Don't know function/class names codebase_peek or codebase_search Natural language → code
Know exact identifier names grep Faster, more precise
Need ALL occurrences grep Semantic returns top N only
Access specific URL webfetch Direct URL access, no codebase search needed
Local search fails websearch Fallback when codebase has no results
Local and web search fails suggest adding knowledge base Notify user to add related folder

Search Rule

Search local codebase first, then web search if needed.

Question received
    ↓
Is this about code/library/API/framework?
    ↓ YES
codebase_search(query)
    ↓
Found relevant results? → YES → Return answer
    ↓ NO
websearch(query)
    ↓
Found relevant results? → YES → Return answer
    ↓ NO
Suggest: "知识库中未找到相关信息,是否添加相关文档文件夹?"
  1. Use codebase_search for code/library/API questions
  2. If no relevant results → use websearch
  3. If web search also fails → suggest adding a knowledge base folder

Read the full file on GitHub · 136 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. 3d ago First seen · 136 lines · 58 tokens per session scan A f228e71218b0

Subscribe to this mod's changes

codebase-search is a skill published in the GitHub repository Helweg/open-codebase-index (185 stars, last pushed 4d ago), licensed MIT. It adds 58 tokens to every session and 1,231 once invoked, about $0.0003 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