---
name: code-explore
description: "Pure Claude code investigation. Use when: tracing execution paths, understanding architecture, diagnosing issues. Not for: dual-perspective review (use code-investigate), code review (use codex-code-review). Output: analysis report with findings."
allowed-tools: Read, Grep, Glob, Bash(ls:*), Bash(find:*)
context: fork
---

# Code Explore Skill

## Trigger

- Keywords: code explore, code investigation, research code, trace code, feature understanding, quick investigation, code exploration

## When to Use

- Quickly understand how a feature works
- Trace execution paths / data flow
- Diagnose problem root causes
- No dual confirmation needed (no Codex cross-validation)

## When NOT to Use

| Scenario                | Alternative                           |
| ----------------------- | ------------------------------------- |
| Need dual confirmation  | `/code-investigate` (Claude + Codex)  |
| Git history tracking    | `/git-investigate`                    |
| System verification     | `/feature-verify`                     |
| Code review             | `/codex-review-fast`                  |

## Workflow

```
┌──────────────────────────────────────────────────────────┐
│ Phase 1: Locate Entry Point                                │
├──────────────────────────────────────────────────────────┤
│ 1. Grep keywords -> find related files                     │
│ 2. Identify entry points (Controller / Service / Provider) │
│ 3. Build file list                                         │
└──────────────────────────────────────────────────────────┘
                          ↓
┌──────────────────────────────────────────────────────────┐
│ Phase 2: Trace Path                                        │
├──────────────────────────────────────────────────────────┤
│ 1. Start from entry point, Read                            │
│ 2. Identify dependencies -> continue tracing               │
│ 3. Map call chain (A -> B -> C)                            │
└──────────────────────────────────────────────────────────┘
                          ↓
┌──────────────────────────────────────────────────────────┐
│ Phase 3: Understand Logic                                  │
├──────────────────────────────────────────────────────────┤
│ 1. What is the core logic?                                 │
│ 2. How does data flow?                                     │
│ 3. Error handling mechanisms?                              │
│ 4. Key decision points?                                    │
└──────────────────────────────────────────────────────────┘
                          ↓
┌──────────────────────────────────────────────────────────┐
│ Phase 4: Output Report                                     │
├──────────────────────────────────────────────────────────┤
│ 1. Architecture overview (diagram / table)                 │
│ 2. Key files list                                          │
│ 3. Execution flow                                          │
│ 4. Findings / notes                                        │
└──────────────────────────────────────────────────────────┘
```

## Search Strategy

| Target          | Strategy                                                 |
| --------------- | -------------------------------------------------------- |
| Feature entry   | `Grep "export class.*Controller"` / `Grep "@Get\|@Post"` |
| Service layer   | `Grep "export class.*Service"`                           |
| Provider layer  | `Glob "src/provider/**/*.ts"`                            |
| Configuration   | `Read {CONFIG_FILE}`                                     |
| Data models     | `Glob "src/model/**/*.ts"`                               |

## Output Format

```markdown
## Investigation Report: {Topic}

### Architecture Overview

{ASCII or Mermaid diagram}

### Key Files

| File              | Responsibility |
| ----------------- | -------------- |
| `path/to/file.ts` | Description   |

### Execution Flow

1. {Step 1}
2. {Step 2}
3. ...

### Data Flow

{Describe how data flows}

### Findings

- {Important finding 1}
- {Important finding 2}

### Notes

- {Potential issue / edge case}
```

## Verification

- [ ] Entry points identified and listed
- [ ] Execution flow traced end-to-end
- [ ] Key files table includes all relevant files
- [ ] Findings section has actionable insights

## References

- `references/search-patterns.md` — Common search patterns for codebase exploration (read when building search strategy)

## Examples

### Feature Understanding

```
Input: Investigate how user data queries work
Phase 1: Grep "balance" -> find UserService, UserController
Phase 2: Controller -> Service -> Provider call chain
Phase 3: Understand query + cache mechanism
Phase 4: Output report + flow diagram
```

### Problem Diagnosis

```
Input: Why does this API sometimes return empty?
Phase 1: Grep "getData" + "cache" -> related files
Phase 2: Trace data retrieval path
Phase 3: Identify fallback logic + timeout handling
Phase 4: List possible causes + recommendations
```

### Architecture Understanding

```
Input: What is the overall architecture of the user module?
Phase 1: Glob "src/**/*user*" -> list all related files
Phase 2: Identify layer relationships (Controller -> Service -> Provider)
Phase 3: Understand each layer's responsibilities
Phase 4: Output architecture diagram + module description
```

## Difference from code-investigate

| Dimension    | code-explore           | code-investigate       |
| ------------ | ---------------------- | ---------------------- |
| Speed        | Fast (single view)     | Slow (dual view)       |
| Confirmation | Single perspective     | Cross-validation       |
| Tools        | Pure Claude            | Claude + Codex         |
| Use case     | Quick investigation    | Important decisions    |


---
Source attribution: sd0xdev
Original project: https://github.com/sd0xdev/sd0x-dev-flow/blob/a4d4bc1493a936a20721aeecf7391e347a4be88e/skills/code-explore/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2026 sd0xdev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: sd0xdev
Original project: https://github.com/sd0xdev/sd0x-dev-flow/blob/a4d4bc1493a936a20721aeecf7391e347a4be88e/skills/code-explore/SKILL.md
Attribution basis: Recovered original package and original project license at a pinned revision

Fields of work: Product Management, Sales, Customer Support
Roles: Customer Success Manager, Product Manager, Sales Engineer, Sales Development Rep (SDR), Technical Support
Specialties: API
Tools: Grep
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 609ec947ef29c9ec3b0a176a90d554d191d9d7784488c8a99fcc40a4b97ee1c1
Metadata reviewed: 2026-10-27
This metadata supersedes earlier Dave AI catalog attribution. Original instruction and supporting files are preserved.
