Agent skill

Codebase Search

by tmcfarlane in tmcfarlane/oh-my-cursor

Search and navigate large codebases efficiently. An agent skill from tmcfarlane/oh-my-cursor.

MITAuto-check: notes

Install Codebase Search

skills CLI
$ npx skills add tmcfarlane/oh-my-cursor --skill codebase-search -a claude-code

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

GitHub CLI
$ gh skill install tmcfarlane/oh-my-cursor 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/tmcfarlane/oh-my-cursor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/codebase-search .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
109
Used in
1 other repo
Token cost
~2.8k tokens
SKILL.md length
458 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

Search and navigate large codebases efficiently. An agent skill from tmcfarlane/oh-my-cursor.

  • Works in 6 steps: Understand what you're looking for → Choose search strategy → Search workflow → …
  • Finding specific code patterns
  • SKILL.md covers When to use this skill, Instructions, Best practices and Common search scenarios, plus 4 more sections
  • Calls git; needs API_KEY

What it does

Codebase Search is an agent skill from tmcfarlane/oh-my-cursor. Search and navigate large codebases efficiently. Use when finding specific code patterns, tracing function calls, understanding code structure, or locating bugs. Handles semantic search, grep patterns, AST analysis.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Like “oh-my-opencode”, but for Cursor IDE. Multi-agent orchestration, natively, using nothing but a few config files. The licence is MIT.

When your agent uses it

  • Finding specific code patterns
  • Tracing function calls
  • Understanding code structure

Example prompts

  • “/codebase-search”

Requirements

  • Python 3
  • A credential in API_KEY
  • Pre-approved tools (allowed-tools): Read, Grep, Glob, Bash

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Understand what you're looking for
  2. Choose search strategy
  3. Search workflow
  4. Common search patterns
  5. Advanced techniques
  6. Search optimization

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep
    • Glob
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

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

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • regexone.com
    • git-scm.com

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

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY

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

Context cost

Codebase Search loads about 2.8k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 458 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Grep, Glob, Bash

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 tmcfarlane/oh-my-cursor at commit 5bad458, republished under its MIT licence (© tmcfarlane). 458 words, ~2,773 tokens.

Download SKILL.mdSave it as .claude/skills/codebase-search/SKILL.md (or your agent's skills folder).
name
codebase-search
description
Search and navigate large codebases efficiently. Use when finding specific code patterns, tracing function calls, understanding code structure, or locating bugs. Handles semantic search, grep patterns, AST analysis.
allowed-tools
Read, Grep, Glob, Bash
tags
codebase-search, grep, code-navigation, pattern-matching
platforms
Claude, ChatGPT, Gemini

When to use this skill

  • Finding specific functions or classes
  • Tracing function calls and dependencies
  • Understanding code structure and architecture
  • Finding usage examples
  • Identifying code patterns
  • Locating bugs or issues
  • Code archaeology (understanding legacy code)
  • Impact analysis before changes

Instructions

Step 1: Understand what you're looking for

Feature implementation:

  • Where is feature X implemented?
  • How does feature Y work?
  • What files are involved in feature Z?

Bug location:

  • Where is this error coming from?
  • What code handles this case?
  • Where is this data being modified?

API usage:

  • How is this API used?
  • Where is this function called?
  • What are examples of using this?

Configuration:

  • Where are settings defined?
  • How is this configured?
  • What are the config options?
Step 2: Choose search strategy

Semantic search (for conceptual questions):

Use when: You understand what you're looking for conceptually
Examples:
- "How do we handle user authentication?"
- "Where is email validation implemented?"
- "How do we connect to the database?"

Benefits:
- Finds relevant code by meaning
- Works with unfamiliar codebases
- Good for exploratory searches

Grep (for exact text/patterns):

Use when: You know exact text or patterns
Examples:
- Function names: "def authenticate"
- Class names: "class UserManager"
- Error messages: "Invalid credentials"
- Specific strings: "API_KEY"

Benefits:
- Fast and precise
- Works with regex patterns
- Good for known terms

Glob (for file discovery):

Use when: You need to find files by pattern
Examples:
- "**/*.test.js" (all test files)
- "**/config*.yaml" (config files)
- "src/**/*Controller.py" (controllers)

Benefits:
- Quickly find files by type
- Discover file structure
- Locate related files
Step 3: Search workflow

1. Start broad, then narrow:

Step 1: Semantic search "How does authentication work?"
Result: Points to auth/ directory

Step 2: Grep in auth/ for specific function
Pattern: "def verify_token"
Result: Found in auth/jwt.py

Step 3: Read the file
File: auth/jwt.py
Result: Understand implementation

2. Use directory targeting:

# Start without target (search everywhere)
Query: "Where is user login implemented?"
Target: []

# Refine with specific directory
Query: "Where is login validated?"
Target: ["backend/auth/"]

3. Combine searches:

# Find where feature is implemented
Semantic: "user registration flow"

# Find all files involved
Grep: "def register_user"

# Find test files
Glob: "**/*register*test*.py"

# Understand the implementation
Read: registration.py, test_registration.py
Step 4: Common search patterns

Find function definition:

bash
# Python
grep -n "def function_name" --type py

# JavaScript
grep -n "function functionName" --type js
grep -n "const functionName = " --type js

# TypeScript
grep -n "function functionName" --type ts
grep -n "export const functionName" --type ts

# Go
grep -n "func functionName" --type go

# Java
grep -n "public.*functionName" --type java

Find class definition:

bash
# Python
grep -n "class ClassName" --type py

# JavaScript/TypeScript
grep -n "class ClassName" --type js,ts

# Java
grep -n "public class ClassName" --type java

# C++
grep -n "class ClassName" --type cpp

Find class/function usage:

bash
# Python
grep -n "ClassName(" --type py
grep -n "function_name(" --type py

# JavaScript
grep -n "new ClassName" --type js
grep -n "functionName(" --type js

Find imports/requires:

bash
# Python
grep -n "from.*import.*ModuleName" --type py
grep -n "import.*ModuleName" --type py

# JavaScript
grep -n "import.*from.*module-name" --type js
grep -n "require.*module-name" --type js

# Go
grep -n "import.*package-name" --type go

Find configuration:

bash
# Config files
glob "**/*config*.{json,yaml,yml,toml,ini}"

# Environment variables
grep -n "process\\.env\\." --type js
grep -n "os\\.environ" --type py

# Constants
grep -n "^[A-Z_]+\\s*=" --type py
grep -n "const [A-Z_]+" --type js

Find TODO/FIXME:

bash
grep -n "TODO|FIXME|HACK|XXX" -i

Find error handling:

bash
# Python
grep -n "try:|except|raise" --type py

# JavaScript
grep -n "try|catch|throw" --type js

# Go
grep -n "if err != nil" --type go
Step 5: Advanced techniques

Trace data flow:

1. Find where data is created
   Semantic: "Where is user object created?"

2. Search for variable usage
   Grep: "user\\." with context lines

3. Follow transformations
   Read: Files that modify user

4. Find where it's consumed
   Grep: "user\\." in relevant files

Find all callsites of a function:

1. Find function definition
   Grep: "def process_payment"
   Result: payments/processor.py:45

2. Find all imports of that module
   Grep: "from payments.processor import"
   Result: Multiple files

3. Find all calls to the function
   Grep: "process_payment\\("
   Result: All callsites

4. Read each callsite for context
   Read: Each file with context

Understand a feature end-to-end:

1. Find API endpoint
   Semantic: "Where is user registration endpoint?"
   Result: routes/auth.py

2. Trace to controller
   Read: routes/auth.py
   Find: Calls to AuthController.register

3. Trace to service
   Read: controllers/auth.py
   Find: Calls to UserService.create_user

4. Trace to database
   Read: services/user.py
   Find: Database operations

5. Find tests
   Glob: "**/*auth*test*.py"
   Read: Test files for examples

Find related files:

1. Start with known file
   Example: models/user.py

2. Find imports of this file
   Grep: "from models.user import"

3. Find files this imports
   Read: models/user.py
   Note: Import statements

4. Build dependency graph
   Map: All related files

Impact analysis:

Before changing function X:

1. Find all callsites
   Grep: "function_name\\("

2. Find all tests
   Grep: "test.*function_name" -i

3. Check related functionality
   Semantic: "What depends on X?"

4. Review each usage
   Read: Each file using function

5. Plan changes
   Document: Impact and required updates
Step 6: Search optimization

Use appropriate context:

bash
# See surrounding context
grep -n "pattern" -C 5  # 5 lines before and after
grep -n "pattern" -B 3  # 3 lines before
grep -n "pattern" -A 3  # 3 lines after

Case sensitivity:

bash
# Case insensitive
grep -n "pattern" -i

# Case sensitive (default)
grep -n "Pattern"

File type filtering:

bash
# Specific type
grep -n "pattern" --type py

# Multiple types
grep -n "pattern" --type py,js,ts

# Exclude types
grep -n "pattern" --glob "!*.test.js"

Regex patterns:

bash
# Any character: .
grep -n "function.*Name"

# Start of line: ^
grep -n "^class"

# End of line: $
grep -n "TODO$"

# Optional: ?
grep -n "function_name_?()"

# One or more: +
grep -n "[A-Z_]+"

# Zero or more: *
grep -n "import.*"

# Alternatives: |
grep -n "TODO|FIXME"

# Groups: ()
grep -n "(get|set)_user"

# Escape special chars: \
grep -n "function\(\)"

Best practices

  1. Start with semantic search: For unfamiliar code or conceptual questions
  2. Use grep for precision: When you know exact terms
  3. Combine multiple searches: Build understanding incrementally
  4. Read surrounding context: Don't just look at matching lines
  5. Check file history: Use git blame for context
  6. Document findings: Note important discoveries
  7. Verify assumptions: Read actual code, don't assume
  8. Use directory targeting: Narrow scope when possible
  9. Follow the data: Trace data flow through the system
  10. Check tests: Tests often show usage examples
Show full SKILL.md (166 more words)Show less

Common search scenarios

Scenario 1: Understanding a bug
1. Find error message
   Grep: "exact error message"

2. Find where it's thrown
   Read: File with error

3. Find what triggers it
   Semantic: "What causes X error?"

4. Find related code
   Grep: Related function names

5. Check tests
   Glob: "**/*test*.py"
   Look: For related test cases
Scenario 2: Learning a new codebase
1. Find entry point
   Semantic: "Where does the application start?"
   Common files: main.py, index.js, app.py

2. Find main routes/endpoints
   Grep: "route|endpoint|@app\\."

3. Find data models
   Semantic: "Where are data models defined?"
   Common: models/, entities/

4. Find configuration
   Glob: "**/*config*"

5. Read README and docs
   Read: README.md, docs/
Scenario 3: Refactoring preparation
1. Find all usages
   Grep: "function_to_change"

2. Find tests
   Grep: "test.*function_to_change"

3. Find dependencies
   Semantic: "What does X depend on?"

4. Check imports
   Grep: "from.*import.*X"

5. Document scope
   List: All affected files
Scenario 4: Adding a feature
1. Find similar features
   Semantic: "How is similar feature implemented?"

2. Find where to add code
   Semantic: "Where should new feature go?"

3. Check patterns
   Read: Similar implementations

4. Find tests to emulate
   Glob: Test files for similar features

5. Check documentation
   Grep: "TODO.*new feature" -i

Tools integration

Git integration:

bash
# Who changed this line?
git blame filename

# History of a file
git log -p filename

# Find when function was added
git log -S "function_name" --source --all

# Find commits mentioning X
git log --grep="feature name"

IDE integration:

  • Use "Go to Definition" for quick navigation
  • Use "Find References" for usage
  • Use "Find in Files" for broad search
  • Use symbol search for classes/functions

Documentation:

  • Check inline comments
  • Look for docstrings
  • Read README files
  • Check architecture docs

Troubleshooting

No results found:

  • Check spelling and case sensitivity
  • Try semantic search instead of grep
  • Broaden search scope (remove directory target)
  • Try different search terms
  • Check if files are in .gitignore

Too many results:

  • Add directory targeting
  • Use more specific patterns
  • Filter by file type
  • Use exact phrases (quotes)

Wrong results:

  • Be more specific in query
  • Use grep instead of semantic for exact terms
  • Add context to semantic queries
  • Check file types

References

Examples

Example 1: Basic usage
<!-- Add example content here -->
Example 2: Advanced usage
<!-- Add advanced example content here -->

© tmcfarlane, 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 skills/codebase-search of tmcfarlane/oh-my-cursor.

Open the folder on GitHubat commit 5bad458

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in tmcfarlane/oh-my-cursor, which our catalogue first saw on October 7, 2026.

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 skilltmcfarlane/oh-my-cursor1091 repos~2.8kAutomated safety check: NotesMIT
Langfuse Codebase Navigatorlangfuse/langfuse35k—~1.4kAutomated safety check: PassCustom licence
Recipe Find Large Filesgoogleworkspace/cli31k—~175Automated safety check: PassApache-2.0
Codebase Navigationaiming-lab/MetaClaw3.5k—~286Automated safety check: PassMIT
Codebase Onboardingaffaan-m/ECC274k3 repos~2kAutomated safety check: PassMIT
Codebase Onboardingaffaan-m/ECC274k1 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Navigate Langfuse repositories, code areas, and agent skills.

    35k GitHub stars~1.4k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Recipe Find Large Files

    googleworkspace/cli

    Identify large Google Drive files consuming storage quota. An agent skill from googleworkspace/cli.

    31k GitHub stars~175 tokensUpdated yesterday
    Auto-check passed
  • Codebase Navigation

    aiming-lab/MetaClaw

    A skill your agent uses when exploring an unfamiliar codebase, tracing code paths, or answering questions about how the system works.

    3.5k GitHub stars~286 tokensUpdated 4 mo ago
    AI & LLM EngineeringAuto-check passed
  • Analyze an unfamiliar codebase and generate a structured onboarding guide with architecture map, key entry points, conventions, and a starter CLAUDE.md.

    274k GitHub starsUsed in 3 repos~2k tokens
    DevelopmentAuto-check passed
  • 分析一个陌生的代码库,并生成一个结构化的入门指南,包括架构图、关键入口点、规范和一个起始的CLAUDE.md文件。适用于加入新项目或首次在代码仓库中设置Claude Code时。

    274k GitHub starsUsed in 1 repo~1.1k tokens
    DevelopmentAuto-check passed
  • 不慣れなコードベースを分析し、アーキテクチャマップ、主要なエントリポイント、規約、スターターCLAUDE.mdを含む構造化オンボーディングガイドを生成します。新しいプロジェクトに参加するか、リポでClaude Codeを初めてセットアップする場合に使用します。

    274k GitHub stars~270 tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from tmcfarlane/oh-my-cursor

All 14 skills in this repo
  • Docs Write

    tmcfarlane/oh-my-cursor

    Write documentation following Metabase's conversational, clear, and user-focused style.

    109 GitHub starsUsed in 3 repos~716 tokens
    Auto-check: notes
  • Debugging

    tmcfarlane/oh-my-cursor

    Systematic 4-phase debugging with root cause investigation. An agent skill from tmcfarlane/oh-my-cursor.

    109 GitHub stars~4.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Documentation Engineer

    tmcfarlane/oh-my-cursor

    Technical documentation expert for creating clear, comprehensive documentation.

    109 GitHub stars~881 tokensUpdated 3 mo ago
    Auto-check passed
  • Planning

    tmcfarlane/oh-my-cursor

    Technical implementation planning and architecture design. An agent skill from tmcfarlane/oh-my-cursor.

    109 GitHub stars~815 tokensUpdated 3 mo ago
    Auto-check passed
  • Cursor Image Generation

    tmcfarlane/oh-my-cursor

    Generate and iterate images in Cursor using the built-in image model and strong prompts.

    109 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • Design Patterns Implementation

    tmcfarlane/oh-my-cursor

    Apply appropriate design patterns (Singleton, Factory, Observer, Strategy, etc.) to solve architectural problems.

    109 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Codebase Search

What does Codebase Search do?

Search and navigate large codebases efficiently. An agent skill from tmcfarlane/oh-my-cursor. Codebase Search is an agent skill from tmcfarlane/oh-my-cursor. Search and navigate large codebases efficiently.

When should I use Codebase Search?

Codebase Search fits situations like: finding specific code patterns; tracing function calls; understanding code structure.

How do I install Codebase Search in Claude Code?

Run `npx skills add tmcfarlane/oh-my-cursor --skill codebase-search -a claude-code`. Or copy the skill folder (skills/codebase-search in tmcfarlane/oh-my-cursor) 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 tmcfarlane/oh-my-cursor --skill codebase-search -a codex`. Or copy the skill folder (skills/codebase-search in tmcfarlane/oh-my-cursor) 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 tmcfarlane/oh-my-cursor --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?

Going by SKILL.md and its folder, Codebase Search needs the command-line tools its instructions call (git) and credentials named API_KEY. Our summary lists: Python 3; A credential in API_KEY. Its frontmatter pre-approves these tools: Read, Grep, Glob, Bash.

Does Codebase Search access the network?

SKILL.md names 3 domains. As links in the text: github.com, regexone.com and git-scm.com. This is read from the text; nothing was executed.

Is Codebase Search safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. 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 2.8k tokens (SKILL.md is roughly 11k 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: Langfuse Codebase Navigator (langfuse/langfuse, 35k stars), Recipe Find Large Files (googleworkspace/cli, 31k stars), Codebase Navigation (aiming-lab/MetaClaw, 3.5k stars) and Codebase Onboarding (affaan-m/ECC, 274k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codebase Search?

tmcfarlane (a GitHub user) maintains it in tmcfarlane/oh-my-cursor, which has 109 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on July 2, 2026.

Source: tmcfarlane/oh-my-cursor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.