explore
Understand how unfamiliar code works before planning or changing it — its structure, behavior, data flow, and the blast radius of a change. Use when the user says "explore", "investigate", "how does X work", "why does X happen", "where is X handled", "what calls X", "what would it take to change X", or whenever you need to understand code before acting on it. Drives exploration with the code_context MCP tool — symbol search, callgraph traversal, and blast-radius analysis — instead of reading files top to bottom.
What this skill does
{% include "_partials/architecture-awareness" %}
# Explore
Understand code well enough to explain how it works and what a change would touch.
$ARGUMENTS
{% include "_partials/delegate-to-subagent" %}
## Done Means
Exploration is complete when you can explain:
```
1. HOW IT WORKS — what calls what, what data flows where
2. WHERE IT LIVES — specific files and symbols
3. WHAT IT TOUCHES — blast radius: what a change would affect
```
Can't state all three? Not done. Guessing at any? Back to the tool — don't fill the gap with assumptions.
## Process
### 1. Orient — check layers
```json
{"op": "get status"}
```
Note which layers are active. Live LSP ops (`get definition`, `get hover`, `search workspace_symbol`) work immediately — don't wait for indexing. If LSP unavailable, results come from tree-sitter. Check `lsp status` to see per-language coverage.
If `ARCHITECTURE.md` exists at the project root, read it now (per the Architecture Awareness guidance) — it gives the system map before tracing individual symbols.
### 2. Survey — find the territory
Broad first. Use domain keywords:
```json
{"op": "search symbol", "query": "<domain keyword>", "max_results": 15}
```
If the index is building and `search symbol` is sparse, use the live alternative:
```json
{"op": "search workspace_symbol", "query": "<domain keyword>"}
{"op": "list symbols", "file_path": "<key file>"}
```
**Looking for**: the nouns and verbs of the problem — structs, traits, functions that participate.
### 3. Trace — follow execution
```json
{"op": "get symbol", "query": "<specific symbol>"}
```
Jump to definitions and types without reading whole files:
```json
{"op": "get definition", "file_path": "<file>", "line": <line>, "character": <col>}
{"op": "get hover", "file_path": "<file>", "line": <line>, "character": <col>}
```
Call relationships both directions:
```json
{"op": "get callgraph", "symbol": "<symbol>", "direction": "both", "max_depth": 2}
{"op": "get inbound_calls", "file_path": "<file>", "line": <line>, "character": <col>}
```
All usages:
```json
{"op": "get references", "file_path": "<file>", "line": <line>, "character": <col>}
```
**Looking for**: the path data takes through the system. `get inbound_calls` is live LSP precision for "who calls this"; `get callgraph` uses indexed edges for broader traversal.
### 4. Scope — measure the blast radius
```json
{"op": "get blastradius", "file_path": "<target>", "max_hops": 3}
```
Supplement with `get references` — blast radius follows call edges, but references also catch type usage, field access, and trait impls.
**Looking for**: how far a change propagates. If the radius surprises you, you don't understand the code yet — back to step 3.
### 5. Check tests
Tests are the clearest executable spec — they confirm understanding and show project patterns.
```json
{"op": "grep code", "pattern": "<symbol or behavior>", "file_pattern": "test"}
```
Also use Glob/Grep for test files near the code:
- Same dir with `_test` suffix
- `tests/` at project/crate root
- Inline test modules (`#[cfg(test)]`, `describe(`, `#[test]`)
**Looking for**: intended behavior, the project's test patterns, behavior with no coverage.
### 6. Conclude — explain
Exit gate. State concretely:
```
HOW IT WORKS: <mechanism in plain terms — what calls what, what flows where>
KEY CODE: <files and symbols — paths>
BLAST RADIUS: <what a change touches, or "n/a — investigation only">
```
Then point at the next step — but don't take it. Exploration produces understanding; acting is separate:
- **Make a change** → `/tdd` (failing test first) or `/implement`
- **Too large for one step** → `/plan`
- **Found a bug** → describe it + expected behavior, suggest `/task`
- **Architectural question** → present findings, ask the user — don't guess
## Layered Resolution
`code-context` is primary. Indexed ops (tree-sitter symbols, callgraphs, blast radius) plus **live LSP ops** (definitions, hover, references, inbound calls, workspace symbol search). Live ops work before the index is fully built.
Results include `source_layer`:
- **lsp** — full language-server precision (types, generics, trait impls)
- **treesitter** — structural parsing from the index (fast, always available after indexing)
- **treesitter+lsp** — combined
Tree-sitter-only for a language that should have LSP? Suggest `/lsp`.
Use raw Read/Grep/Glob only for:
- String literals, config, error messages not in the symbol index
- Non-code files (TOML, YAML, JSON, Markdown)
- Confirming exact syntax after code-context gave you the location
**Don't** start by reading files top to bottom. Start with `search symbol` (or `search workspace_symbol` while indexing) and `get callgraph`; use `get definition`/`get hover` to inspect specifics.
## When to Recurse
If blast radius reveals surprises or the callgraph leads to new territory, loop back to step 2 with new keywords. Each loop should *narrow* focus, not widen it.
## Examples
**Understanding a feature:** User says "explore how the kanban watcher decides which files to re-index".
1. Orient with `get status` — note active layers.
2. Survey: `search symbol "watcher"`, `search symbol "invalidate"` → `KanbanWatcher::on_event`, `invalidate_file`.
3. Trace: `get symbol "KanbanWatcher::on_event"`, then `get callgraph "invalidate_file"` inbound, depth 2.
4. Scope: `get blastradius "src/watcher.rs" max_hops 3` → indexer + MCP layer only.
5. Tests: `grep code "on_event"` in `test` → smoke test covers creation; nothing covers deletion.
6. Conclude:
```
HOW IT WORKS: on_event receives a FileEvent, matches the EventKind, and calls
invalidate_file for created/modified files; the indexer picks up
invalidated paths on its next pass.
KEY CODE: src/watcher.rs (KanbanWatcher::on_event, invalidate_file)
BLAST RADIUS: indexer + MCP layer only. Deletion (EventKind::Remove) is not
handled — invalidate_file is never called for deleted files.
```
Exploration complete. Deletion gap → `/tdd` or `/task`.
**Exploration reveals work too large:** `/explore what it would take to add SSO`. Orient, survey auth symbols, trace login flow. Blast radius on `src/auth/login.rs` shows 40+ call sites. Stop — escalate to `/plan` rather than force a conclusion.
## Constraints
- **Don't write code during exploration.** Hand off.
- **Don't skip blast radius.** It's where surprises surface.
- **Don't read files top to bottom.** Use `code_context` to find the right code, inspect what matters.
- **Don't explore forever.** 3 loops without convergence → stop, say what's unclear, ask the user.
- **Don't use exploration to avoid acting.** Once you can explain how/where/what-it-touches, move to planning or implementation.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.