Agent skill

Codebase Search

by Helweg in Helweg/open-codebase-index

Chooses the right retrieval tool for code questions: compact context for unfamiliar repos, direct lookup for known symbols, call graphs for relationships and grep for exhaustive matches.

MITAuto-check passedAgent Workflows

Install Codebase Search

skills CLI
$ npx skills add Helweg/open-codebase-index --skill codebase-search -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Helweg/open-codebase-index codebase-search --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Helweg/open-codebase-index.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skill .claude/skills/codebase-search && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codebase-search
GitHub stars
216
Token cost
~1.3k tokens
SKILL.md length
503 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Chooses the right retrieval tool for code questions: compact context for unfamiliar repos, direct lookup for known symbols, call graphs for relationships and grep for exhaustive matches.

  • Works in 2 steps: Project Source Code — all code files in… → Knowledge Base Documentation — external…
  • Getting oriented in an unfamiliar repository before broad file reads
  • SKILL.md covers Important: Indexed Content, When to Use What, Task-specific Workflow and Tools, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

The skill assumes an index that holds both the project's source code and added knowledge base documentation such as usage guides, API references and example programs. A table maps each situation to a tool: codebase_context for orientation in an unfamiliar repository, codebase_search for questions about code, codebase_peek for file locations only, find_similar for duplicates, call_graph and call_graph_path for callers, callees and dependency paths, pr_impact for the reach of a pull request, implementation_lookup for a known symbol and grep when every occurrence is needed.

The workflow checks index_status first and indexes only when the index is missing, stale or incompatible. Unfamiliar repositories start with one compact codebase_context pass (tokenBudget 600, limit 5); known definitions go straight to implementation_lookup, and codebase_edit_context can supply bounded source plus graph evidence before an edit. When local search finds nothing it falls back to websearch or webfetch, and suggests adding a knowledge base folder if both fail.

When your agent uses it

  • Getting oriented in an unfamiliar repository before broad file reads
  • Finding who calls a function or tracing a dependency path between symbols
  • Estimating which symbols a pull request affects
  • Deciding between semantic search and grep for a lookup

Example prompts

  • “I'm new to this repo; give me a compact orientation of how authentication is wired up.”
  • “Show me every caller of parseConfig and the shortest path from main to it.”
  • “Which symbols and hub nodes does this PR affect?”
  • “Find the definition of RateLimiter without reading the whole directory.”

Requirements

  • The codebase index tools (codebase_search, call_graph and the others) exposed to the agent

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  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…

What it can do on your machine

Read from SKILL.md and the folder at commit ca805a8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codebase Search loads about 1.3k tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 503 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Helweg/open-codebase-index at commit ca805a8, republished under its MIT licence (© Helweg). 503 words, ~1,307 tokens.

Download SKILL.mdSave it as .claude/skills/codebase-search/SKILL.md (or your agent's skills folder).
name
codebase-search
description
Task-specific semantic code and documentation retrieval. Use compact context for unfamiliar repository orientation, direct lookup for known definitions, graph tools for relationships, and grep for exhaustive literal matches.

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

ScenarioToolWhy
Unfamiliar repository layout or subsystemcodebase_contextCompact orientation before broad reads
Code/library/API questioncodebase_searchSearch local knowledge first
Just need file locationscodebase_peekMetadata only, saves ~90% tokens
Need to see actual codecodebase_searchReturns full code content
Find duplicates/patternsfind_similarGiven code snippet → similar code
Understand code flowcall_graphFind callers/callees of any function
Trace dependency pathscall_graph_pathFind a shortest known path between two symbols
Analyze PR blast radiuspr_impactFind affected symbols, communities, hub nodes, and risk
Don't know function/class namescodebase_contextNatural-language orientation with bounded evidence
Know a symbol and need its definitionimplementation_lookupAuthoritative source without a context prerequisite
Need ALL occurrencesgrepSemantic returns top N only
Access specific URLwebfetchDirect URL access, no codebase search needed
Local search failswebsearchFallback when codebase has no results
Local and web search failssuggest adding knowledge baseNotify user to add related folder

Task-specific Workflow

  1. Check index_status when readiness or freshness is unknown. Index only when missing, stale, or incompatible.
  2. For unfamiliar repository orientation, use one compact codebase_context first pass (tokenBudget: 600, limit: 5) and inspect its evidence before broad reads or searches.
  3. For known definitions, use implementation_lookup directly. For callers/callees or dependency paths, use call_graph or call_graph_path directly once endpoints are identified.
  4. For known or suspected edit targets, optionally use codebase_edit_context for bounded source plus direct graph evidence.
  5. Use codebase_peek for semantic locations or codebase_search for matching content when needed. Neither requires another context call when scope is already known.
  6. Read known paths directly; use grep for exact identifiers and exhaustive literal matches. Apply directory/file filters when the scope is known, rather than guessing a narrower scope.

For repository implementation questions, use local source evidence before web search. External library/API documentation questions may need web sources when the local index lacks relevant documentation. Avoid repeating retrieval when existing evidence already answers the task.

Show full SKILL.md (135 more words)Show less

Tools

codebase_peek

Find WHERE code is. Returns metadata only (file, line, name, type).

codebase_peek(query="validation logic", chunkType="function", directory="src/utils")
codebase_peek(query="authentication flow", blameAuthor="jane@example.com")

Find code with full content. Use when you need to see implementation.

codebase_search(query="error handling middleware", fileType="ts", contextLines=2)
codebase_search(query="rate limiter", blameSince="2025-01-01", blameUntil="2025-01-31")
find_similar

Find code similar to a given snippet. Use for duplicate detection, pattern discovery, refactoring.

find_similar(code="function validate(input) { return input.length > 0; }", excludeFile="src/current.ts", blameSince="2025-01-01")
call_graph

Query callers or callees of a function/method.

call_graph(name="validateToken", direction="callers")
index_codebase

Manually trigger indexing. Required before first search.

index_status

Check if indexed and ready.

MCP/OpenCode knowledge-base tools
  • add_knowledge_base(path="/path/to/docs")
  • list_knowledge_bases
  • remove_knowledge_base(path="/path/to/docs")
Pi knowledge-base tools
  • knowledge_base_add(path="/path/to/docs")
  • knowledge_base_list
  • knowledge_base_remove(path="/path/to/docs")

Query Tips

Describe behavior, not syntax:

  • Good: "function that hashes passwords securely"
  • Bad: "hashPassword" (use grep for exact names)

Search across documentation:

  • Good: "how to configure WiFi in ESP-IDF"
  • Good: "GPIO initialization example"

Filters

FilterExample
chunkTypefunction, class, interface, type, method
directory"src/api", "tests"
fileType"ts", "py", "rs"
blameAuthor"jane@example.com" or "Jane Doe"
blameSha"abc1234"
blameSince"2025-01-01"
blameUntil"2025-01-31"

© Helweg, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skill of Helweg/open-codebase-index.

Open the folder on GitHubat commit ca805a8

Compare with similar skills

Codebase Search next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codebase Search compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codebase Search this skillHelweg/open-codebase-index216—~1.3kAutomated safety check: PassMIT
Basemind Index ScanGoldziher/basemind106—~997Automated safety check: WarnMIT
trace-mcp Code Navigationnikolai-vysotskyi/trace-mcp185—~1.6kAutomated safety check: NotesMIT
Basemind Code ContextGoldziher/basemind106—~2.6kAutomated safety check: PassMIT
MCP Code Search Tool SelectionContext-Engine-AI/Context-Engine402—~1.3kAutomated safety check: PassMIT
Context-Engine Code SearchContext-Engine-AI/Context-Engine402—~14kAutomated safety check: PassMIT

Similar skills

  • Basemind Index Scan

    Goldziher/basemind

    Builds or refreshes the basemind code index from the command line, for when basemind reports no index or its MCP server is not running.

    106 GitHub stars~997 tokensUpdated yesterday
    Agent WorkflowsAuto-check: warnings
  • trace-mcp Code Navigation

    nikolai-vysotskyi/trace-mcp

    Routes code exploration through trace-mcp's indexed dependency graph, using symbol search, outlines, call graphs and change-impact tools instead of Read, Grep and Glob.

    185 GitHub stars~1.6k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Basemind Code Context

    Goldziher/basemind

    Answers structural questions about a repository, such as where a symbol is defined, what calls it and what changed recently, through the basemind MCP server.

    106 GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • MCP Code Search Tool Selection

    Context-Engine-AI/Context-Engine

    Rules for choosing Qdrant-Indexer semantic search over grep or file reads when exploring code, debugging or asking where and why questions.

    402 GitHub stars~1.3k tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check passed
  • Context-Engine Code Search

    Context-Engine-AI/Context-Engine

    Searches a codebase with hybrid semantic and lexical retrieval plus neural reranking through MCP tools, for finding implementations and grounded answers.

    402 GitHub stars~14k tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check passed
  • 1c Code Search

    comol/ai_rules_1c

    Find BSL code in a 1C project — routines by name, code by behaviour or exact literal, module layout, members of a context — through the graph and code-metadata MCP servers before any Grep.

    480 GitHub stars~1k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from Helweg/open-codebase-index

  • Codebase Search Workflow

    Helweg/open-codebase-index

    Directs an agent to use a local codebase index for repository orientation, definition lookups, call graphs and semantic search before turning to web lookups.

    216 GitHub stars~822 tokensUpdated yesterday
    Auto-check passed

Questions about Codebase Search

What does Codebase Search do?

Chooses the right retrieval tool for code questions: compact context for unfamiliar repos, direct lookup for known symbols, call graphs for relationships and grep for exhaustive matches. The skill assumes an index that holds both the project's source code and added knowledge base documentation such as usage guides, API references and example programs. A table maps each situation to a tool: codebase_context for orientation in an unfamiliar repository, codebase_search for questions about code, codebase_peek for file locations only, find_similar for duplicates, call_graph and call_graph_path for callers, callees and dependency paths, pr_impact for the reach of a pull request, implementation_lookup for a known symbol and grep when every occurrence is needed.

When should I use Codebase Search?

Codebase Search fits situations like: getting oriented in an unfamiliar repository before broad file reads; finding who calls a function or tracing a dependency path between symbols; estimating which symbols a pull request affects; deciding between semantic search and grep for a lookup.

How do I install Codebase Search in Claude Code?

Run `npx skills add Helweg/open-codebase-index --skill codebase-search -a claude-code`. Or copy the skill folder (skill in Helweg/open-codebase-index) into .claude/skills/codebase-search in your project. Claude Code loads it when a task matches its description.

How do I install Codebase Search in Codex?

Run `npx skills add Helweg/open-codebase-index --skill codebase-search -a codex`. Or copy the skill folder (skill in Helweg/open-codebase-index) into .agents/skills/codebase-search in your project. Codex loads it when a task matches its description.

Can I use Codebase Search in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Helweg/open-codebase-index --skill codebase-search -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codebase-search, .gemini/skills/codebase-search, .github/skills/codebase-search and .opencode/skills/codebase-search in your project.

What does Codebase Search need to run?

SKILL.md names no scripts, command-line tools or credentials: Codebase Search is instructions for the agent only. Our summary lists: The codebase index tools (codebase_search, call_graph and the others) exposed to the agent.

Does Codebase Search access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Codebase Search safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codebase Search use?

Codebase Search is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codebase Search use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codebase Search?

Skills that share tags, products or a category with Codebase Search: Basemind Index Scan (Goldziher/basemind, 106 stars), trace-mcp Code Navigation (nikolai-vysotskyi/trace-mcp, 185 stars), Basemind Code Context (Goldziher/basemind, 106 stars) and MCP Code Search Tool Selection (Context-Engine-AI/Context-Engine, 402 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codebase Search?

Helweg (a GitHub user) maintains it in Helweg/open-codebase-index, which has 216 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 6, 2026.

Source: Helweg/open-codebase-index on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.