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.
npx agentmods add skills/helweg/open-codebase-index/skillnpx skills add Helweg/open-codebase-index --skill skillgit clone --depth 1 https://github.com/Helweg/open-codebase-indexWhat 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.
| Model | Per session | Once 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 |
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.
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:
- Project Source Code — all code files in the current workspace
- Knowledge Base Documentation — external documentation, usage guides, API references, and example programs added via
add_knowledge_base(MCP/OpenCode) orknowledge_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: "知识库中未找到相关信息,是否添加相关文档文件夹?"
- Use
codebase_searchfor code/library/API questions - If no relevant results → use
websearch - If web search also fails → suggest adding a knowledge base folder
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.
- 3d ago First seen · 136 lines · 58 tokens per session scan A f228e71218b0
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.
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…
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.
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.
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.
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.
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.