Skip to content
codebase-explorer logo

Codebase Explorer

codebase-explorer

Deep codebase exploration using semantic search and relationship mapping. Use when you need to understand the current codebase.

SKILL.md

Full skill instructions

Search Query Analysis

Query Optimization Skill

Codanna's semantic search works best with technical terms and specific concepts. Analyze the situation and optimize your codebase explore queries for code search:

Examples:

  1. If vague (e.g., "that parsing thing") → Make it specific (e.g., "language parser implementation")
  2. If a question (e.g., "how does parsing work?") → Extract keywords (e.g., "parsing implementation process")
  3. If conversational (e.g., "the stuff that handles languages") → Use technical terms (e.g., "language handler processor")
  4. If too broad (e.g., "errors") → Add context (e.g., "error handling exception management")

OptimizedQuery: {Claude: I will write my optimized query here, then use it below}

Execute this command with your optimized query:

Your Workflow <Workflow>

Gather Context <Step_1 GatherContext>

Use the Bash tool to perform semantic code search:

Execute: codanna mcp semantic_search_with_context query:"$OptimizedQuery" limit:5

What Codanna returns:

  • Relevance scores (how well each result matches)
  • Symbol signatures and documentation
  • Relationships (calls, called_by, implements, defines)
  • File locations with line ranges

Your Workflow <Step_2 YourWorkflow>

  1. Analyze the results with their relevance scores (focus on results with score > 0.6 (if possible))

  2. To see actual implementation of interesting results:

    • Use the line range from the Location field to read just the relevant code
    • Example: If you see "at src/​io/​exit_code.rs:108-120"
    • Use the Read tool with:
      • file_path: src/​io/​exit_code.rs (use the working directory from your environment context <env> to construct the absolute path)
      • offset: 108 (start line)
      • limit: 13 (calculated as: 120 - 108 + 1)
    • Formula: limit = end_line - start_line + 1
    • Example: Read(file_path="/​full/​path/​to/​src/​io/​exit_code.rs", offset=108, limit=13)
  3. When relationships are shown (called_by, calls, defines, implements):

    • If a relationship looks relevant to answering the query, investigate it
    • Execute: codanna retrieve describe <relationship_symbol_name|symbol_id:ID>
    • Example: If you see "Called by: initialize_registry [symbol_id:123]", run: codanna retrieve describe initialize_registry or describe symbol_id:123
    • Note: Following 1-2 key relationships per result is typically sufficient
  4. Build a complete picture by following key relationships and reading relevant code sections

  5. If needed, repeat <Step_1: GatherContext> with a refined query based on what you learned.


Tips for Efficient Exploration

The results include:

  • Relevance scores (how well each result matches the query)
  • Symbol documentation and signatures
  • Relationships (who calls this, what it calls, what it defines)
  • System guidance for follow-up investigation

sed (native on unix only):

  • You can also see actual implementation with sed: (works native on Unix based environments):

    • Use the line range from the Location field to read just the relevant code
    • Example: If you see "Location: src/​io/​exit_code.rs:108-120"
    • Execute: sed -n '108,120p' src/​io/​exit_code.rs to read lines 108-120
    • This shows the actual code implementation, not just the signature. It works like the Read tool.
  • Add lang:rust (or python, typescript, etc.) to narrow results by language if you work on multi-language projects

  • Follow relationships that appear in multiple results (they're likely important)

  • Use the describe command to get full details about interesting relationships

Token awareness:

  • Each search uses ~500 tokens
  • Each relationship follow uses ~300 tokens
  • Each file read uses ~100-500 tokens (depends on size)
  • Staying efficient keeps your context window clean for deeper analysis

This command is for exploration:

  • Build understanding of the codebase
  • Identify patterns and integration points
  • Present findings and await user direction
  • Don't start implementing or making changes yet

Based on the gathered context, engage with the user to narrow focus and help the user with further request.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View