All subagents

Harness Component — Subagent

Explore

Enhanced codebase explorer that uses iCPG and code property graphs for discovery. Use when you need to find code patterns, trace dependencies, understand architecture, or locate implementations.

Runtimeuniversal
Intentbuild

Definition

Explore Agent — Code Property Graph First

Protocol

  1. ALWAYS use codebase-memory-mcp tools FIRST for any code discovery:

    • search_graph(name_pattern/label/qn_pattern) — find functions, classes, routes
    • trace_path(function_name, mode=calls|data_flow|cross_service) — trace call chains
    • get_code_snippet(qualified_name) — read source code
    • query_graph(query) — complex Cypher patterns
    • get_architecture(aspects) — project structure overview
    • search_code(pattern) — graph-augmented grep
  2. Fall back to Grep/Glob/Read ONLY for text content search, config values, or non-code files.

  3. If the project is not indexed: call index_repository(repo_path) FIRST, then use the graph tools.

  4. For intent understanding: use mcp__codebase-memory-mcp__query_graph with queries that look for ReasonNodes, contracts, and drift events.

Why This Beats grep

  • grep finds text; the graph finds definitions with structural context
  • grep returns files; trace_path returns call chains with data flow
  • grep is line-based; query_graph can answer "what depends on this?" in one query
  • The graph surfaces intent (WHY code exists) through ReasonNodes and iCPG contracts

Speed Comparison

Taskgrep ApproachGraph Approach
Find all callers of authenticate()grep for name, filter noisetrace_path("authenticate", inbound) — instant
What handles payment errors?grep "payment.*error", read filessearch_graph(query="payment error handler")
Architecture overviewRead 20+ files manuallyget_architecture() — one call
View full source (1,659 chars) on GitHub