Skip to content
Development
Command

/deep-dive

Systematic multi-perspective investigation with extended thinking and state management

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/deep-dive

Context preview

What this command does when you run it.

Systematic multi-perspective investigation with extended thinking and state management

Command definition

deep-dive.md
allowed-tools: Read, Task, Bash(fd:*), Bash(rg:*), Bash(git:*), Bash(wc:*), Bash(sort:*), Bash(head:*), Bash(jq:*), Bash(gdate:*), Bash(npm:*), Bash(cargo:*), Bash(go:*), Bash(strace:*), Bash(perf:*), Bash(time:*)
name: "Deep Dive"
description: "Systematic multi-perspective investigation with extended thinking and state management"
author: "wcygan"
tags: ["analyze","research"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

/deep-dive

Context

  • Session ID: !`gdate +%s%N`
  • Current directory: !`pwd`
  • Investigation target: $ARGUMENTS
  • Project structure: !`fd . -t d -d 3 | head -15 || echo "No directories found"`
  • File overview: !`fd . -t f | wc -l | tr -d ' '` files total
  • Technology indicators: !`fd -e json -e toml -e xml -e txt . | rg "(package\.json|Cargo\.toml|go\.mod|requirements\.txt|pom\.xml)" | head -5 || echo "No technology files detected"`
  • Git repository: !`git status --porcelain | wc -l | tr -d ' '` changes, branch: !`git branch --show-current 2>/dev/null || echo "No git repository"`
  • Recent activity: !`git log --oneline -5 2>/dev/null || echo "No git history"`
  • Code patterns: !`rg "func|function|def|class|interface|struct" . | wc -l | tr -d ' '` definitions found

Your Task

Execute systematic multi-perspective exploration of $ARGUMENTS to build comprehensive understanding through structured investigation using extended thinking and state management.

STEP 1: Initialize Investigation Session

  • Create session state file: /tmp/deep-dive-$SESSION_ID.json
  • Initialize investigation scope and boundaries
  • Set exploration objectives based on $ARGUMENTS
  • Create checkpoint: investigation_initialized
// /tmp/deep-dive-$SESSION_ID.json
{
  "sessionId": "$SESSION_ID",
  "target": "$ARGUMENTS",
  "phase": "initialization",
  "scope": "defined_from_arguments",
  "objectives": [],
  "findings": {
    "technical": {},
    "business": {},
    "operational": {}
  },
  "checkpoints": {
    "last_checkpoint": "investigation_initialized",
    "next_milestone": "contextual_foundation",
    "rollback_point": "session_start"
  }
}

STEP 2: Contextual Foundation Analysis

Think deeply about the investigation scope and establish baseline understanding.

TRY:

  • Analyze project structure and identify key stakeholders
  • Map existing knowledge and document assumptions
  • Perform initial reconnaissance of codebase/system
  • Execute discovery commands:
  • Structure analysis: `fd . --type f | head -20`
  • Issue identification: `rg "TODO|FIXME|HACK|BUG" -n | head -10`
  • Dependency overview: `rg "import|require|use|from" -n | head -15`
  • Update state with baseline findings
  • Save checkpoint: contextual_foundation_complete

CATCH (insufficient_context):

  • Expand search scope and parameters
  • Look for additional documentation or configuration files
  • Use extended thinking to analyze partial information
  • Document context gaps for focused investigation

STEP 3: Multi-Dimensional Analysis Execution

FOR EACH dimension IN [technical, business, operational]:

Think harder about the specific dimension and launch focused analysis:

**Technical Dimension Investigation:**

  • Architecture patterns: `rg "pattern|strategy|factory|observer|singleton" -i -A 2`
  • Performance analysis: `rg "performance|optimization|bottleneck|slow" -i -A 1`
  • Security review: `rg "security|auth|token|password|encrypt" -i -A 1`
  • Testing coverage: `rg "test|spec|mock|stub" --files | head -10`

**Business Dimension Investigation:**

  • User needs analysis: `rg "user|customer|client|requirement" -i -A 1`
  • Business rules: `rg "rule|policy|constraint|validation" -i -A 1`
  • Value propositions: `rg "value|benefit|feature|capability" -i -A 1`

**Operational Dimension Investigation:**

  • Deployment patterns: `rg "deploy|docker|kubernetes|config" -i --files`
  • Monitoring setup: `rg "monitor|metric|alert|log" -i -A 1`
  • Scalability indicators: `rg "scale|performance|load|concurrent" -i -A 1`

Update state with dimension-specific findings after each analysis.

STEP 4: Deep Investigation Techniques

Think deeply about investigation approaches and execute systematic code archaeology:

**Code Evolution Analysis:**

# Understand historical context
git log --oneline --graph -20
git blame [key-files] | head -10  
git show --stat HEAD~5..HEAD

**Pattern Recognition:**

# Find architectural patterns
rg "func|function|def|class" -A 1 | head -20
rg "config|setting|option|parameter" -i -A 2

**Dependency Mapping:**

# External dependencies
fd "package.json|Cargo.toml|go.mod|requirements.txt" --type f
rg "import.*from|require\(|use " -n | head -15

# Internal coupling analysis
rg "\.\/|\.\.\/|@\/" -n | head -10
fd "index|mod|lib" --type f

**Data Flow Tracing:**

# Follow data transformations
rg "map|transform|convert|parse|serialize" -A 2 -B 1
rg "input|output|request|response|data" -A 1 -B 1
rg "store|save|persist|cache|fetch|load" -A 1

Update investigation state with technical findings.

STEP 5: Knowledge Synthesis and Pattern Recognition

Use extended thinking to synthesize findings and identify patterns:

Think harder about:

  • Common design patterns and anti-patterns observed
  • Recurring implementation strategies across the codebase
  • Hidden dependencies and implicit constraints
  • Non-obvious connections and system behaviors

Execute gap analysis:

  • Missing functionality or incomplete features
  • Technical debt and refactoring opportunities
  • Documentation gaps and knowledge silos
  • Testing blind spots and quality issues

Generate insights on:

  • Optimization opportunities and quick wins
  • Emergent properties and system behaviors
  • Risk factors and mitigation strategies

Update state with synthesized knowledge and insights.

STEP 6: Structured Documentation Generation

Create comprehensive investigation report:

**Executive Summary Generation:**

# Deep Dive Investigation: $ARGUMENTS

## Key Findings

- [3-5 critical d
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin