Skill

code-investigate

Install
1
Install the plugin
$
npx claudepluginhub sd0xdev/sd0x-dev-flow --plugin sd0x-dev-flow

Want just this skill?

Add to a custom plugin, then install with one command.

Description

Dual-perspective code investigation. Use when: deep code analysis needing both Claude and Codex perspectives. Not for: quick exploration (use code-explore), code review (use codex-code-review). Output: integrated findings from dual analysis.

Tool Access

This skill is limited to using the following tools:

ReadGrepGlobBash(git:*)mcp__codex__codexmcp__codex__codex-reply
Supporting Assets
View in Repository
references/output-template.md
references/prompts.md
Skill Content

Code Investigate Skill

Trigger

  • Keywords: investigate code, how feature works, trace implementation, dual confirmation, deep dive, how code works, what this code does, code research

When NOT to Use

  • Just need quick lookup (use Grep/Glob directly)
  • Code review (use codex-review)
  • System verification (use feature-verify)
  • Git history tracking (use git-investigate)

Core Principle

Codex must explore independently. Feeding Claude's conclusions to Codex is prohibited.
┌─────────────────┐     ┌─────────────────┐
│ Claude Explores  │     │ Codex Explores   │
│ Independently    │     │ Independently    │
│   (Phase 1-2)   │     │    (Phase 3)     │
└────────┬────────┘     └────────┬────────┘
         │                       │
         ▼                       ▼
   ┌───────────┐           ┌───────────┐
   │ Claude    │           │ Codex     │
   │ Conclusion│           │ Conclusion│
   └─────┬─────┘           └─────┬─────┘
         │                       │
         └───────────┬───────────┘
                     ▼
              ┌─────────────┐
              │ Consolidated│
              │   Report    │
              │  (Phase 4)  │
              └─────────────┘

Workflow

PhaseNameActionOutput
1Claude ExploreGrep/Glob/Read to search codeRelated files list
2Claude ConcludeAnalyze logic, form understandingInitial conclusion (internal)
3Codex ExploreInvoke Codex MCP to explore independentlyCodex analysis report
4IntegrateCompare both perspectives, mark differencesConsolidated report

Codex Invocation Rules

Required Parameters

ParameterValueDescription
sandboxread-onlyForce read-only
approval-policyneverAuto-execute
cwdProject rootExploration start point

Correct Approach

mcp__codex__codex({
  prompt: `# Code Investigation Task

## Question
${userQuestion}

## Project Info
- Path: ${cwd}
- Tech Stack: {FRAMEWORK} + TypeScript + {DATABASE}

Please **independently explore** the codebase and answer:
1. What files are related?
2. How does the core logic work?
3. What is the data flow?
4. What are the key dependencies?

Please grep/read and explore on your own, then provide your analysis.`,
  cwd: '/path/to/project',
  sandbox: 'read-only',
  'approval-policy': 'never',
});

Prohibited Approaches

PatternProblemExample
Feeding conclusionClaude's findings leak to CodexClaude found these files: ${findings}
Leading questionPresupposes answerI think the problem is in cache, verify
Scope restrictionPrevents independent explorationOnly look at src/service/

Output

## Investigation Report
- **Claude findings**: <independent analysis>
- **Codex findings**: <independent analysis>
- **Integrated conclusion**: <merged findings>
- **Confidence**: High / Medium / Low

Verification Checklist

CheckStandard
Claude independent conclusionPhase 2 forms conclusion, not output to user
Codex prompt is cleanContains only question + project path, no Claude findings
Report perspectives separatedClaude / Codex conclusions presented separately
Integration is completeMarks agreement, differences, possible gaps

References

FilePurposeWhen to Read
references/prompts.mdCodex prompt templatesBefore Phase 3
references/output-template.mdReport formatDuring Phase 4

Examples

Feature Investigation

Input: Investigate how order processing works
Phase 1: Grep "processOrder" -> Read src/service/order/*.ts
Phase 2: Form understanding: Controller -> Service -> Repository write
Phase 3: Codex explores independently (only given question + path)
Phase 4: Consolidated report -> mark both perspectives

Mechanism Understanding

Input: How does the API caching mechanism work?
Phase 1: Grep "cache" + "portfolio" -> Read related files
Phase 2: Understand Redis TTL + fallback mechanism
Phase 3: Codex investigates independently
Phase 4: Compare differences -> output consolidated report

Problem Diagnosis

Input: Why is token price sometimes null?
Phase 1: Search price-related logic + error handling
Phase 2: Identify possible fallback paths
Phase 3: Codex diagnoses independently
Phase 4: Synthesize both findings -> list possible causes
Stats
Stars90
Forks12
Last CommitMar 19, 2026
Actions

Similar Skills