deep-dive

deep-dive is a command for Claude Code from josix/agent-flow. It costs 13 tokens per session (3,243 once invoked), scanned B, original, MIT.

A command that gathers broad context about a codebase by coordinating several exploration agents. It can explore everything, focus on one path, or refresh previous findings.

In plain words
What is it for?
Use it before explaining or changing a feature, with full exploration, a focused directory scan, or a refresh of existing context.
Why use it?
It gives later planning and implementation work a shared picture of the relevant code and its structure.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the agent-flow plugin — 11 skills, 5 commands, 6 agents, 7 hooks shipped together

Good fit Use it before explaining or changing a feature, with full exploration, a focused directory scan, or a refresh of existing context.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add josix/agent-flow
Claude Code
/plugin install agent-flow

Made for: Claude Code.

Or install agent-flow, the plugin that ships this one along with the rest of its 11 skills, 5 commands, 6 agents, 7 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for deep-dive

README.md
[![agentmods](https://agentmods.dev/badge/commands/josix/agent-flow/deep-dive/github.svg)](https://agentmods.dev/commands/josix/agent-flow/deep-dive)
Your own site
<a href="https://agentmods.dev/commands/josix/agent-flow/deep-dive"><img src="https://agentmods.dev/badge/commands/josix/agent-flow/deep-dive/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for deep-dive

Your own site · 80×15
<a href="https://agentmods.dev/commands/josix/agent-flow/deep-dive"><img src="https://agentmods.dev/badge/commands/josix/agent-flow/deep-dive.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,243 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.03243
Opus 5.5 $0.00005 $0.01297
Sonnet 5.5 $0.00003 $0.00649
Haiku 4.5 $0.00001 $0.00324

Measured 1mo ago against content hash 19589a2231cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

deep-dive scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

head -30 .claude/deep-dive.local.md
commands/deep-dive.md · 354 lines

How it starts

The opening of the file, as written. The whole thing — 354 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Deep-Dive Command

Gather comprehensive codebase context for the current session using parallel exploration agents.

Arguments

  • --full (default): Full codebase exploration
  • --focus=<path>: Focus exploration on a specific path (e.g., --focus=src/auth)
  • --refresh: Refresh existing deep-dive context

State Initialization

FIRST: Initialize deep-dive state by running:

# Parse arguments
SCOPE="full"
FOCUS_PATH=""
REFRESH_FLAG=""

# Check for --focus=<path>
if [[ "$ARGUMENTS" == *"--focus="* ]]; then
  SCOPE="focused"
  FOCUS_PATH=$(echo "$ARGUMENTS" | sed -n 's/.*--focus=\([^ ]*\).*/\1/p')
fi

# Check for --refresh
if [[ "$ARGUMENTS" == *"--refresh"* ]]; then
  REFRESH_FLAG="--refresh"
fi

# Initialize deep-dive state
bash ${CLAUDE_PLUGIN_ROOT}/scripts/init-deep-dive.sh \
  --scope "$SCOPE" \
  ${FOCUS_PATH:+--focus-path "$FOCUS_PATH"} \
  --agent-count 8 \
  $REFRESH_FLAG

This creates .claude/deep-dive.local.md to track exploration progress.

Your Role

You are coordinating a parallel exploration workflow. Fire multiple Riko agents simultaneously to gather codebase context, then synthesize findings with Senku.

CRITICAL BEHAVIORAL CONSTRAINTS:

  • Fire ALL exploration agents at once (parallel, not sequential)
  • Do NOT wait for one agent before starting the next
  • Each agent explores a DIFFERENT aspect of the codebase
  • State is written twice: by the init script above, and by compile-deep-dive.sh at the end (which sets phase and every phase status). There is no per-phase update step in between

Workflow Phases

Phase 1: Parallel Exploration (Fire Immediately)

Fire ALL agents at once using the Agent tool. Do not wait between spawns.

Each Riko agent explores a different aspect:

// Fire all these agents SIMULTANEOUSLY (8 concurrent)

Agent(subagent_type="agent-flow:Riko", prompt="
PROJECT STRUCTURE: Explore directory layout and file organization.
- List top-level directories and their purposes
- Identify monorepo vs single package
- Find entry points (main files, index files)
- Report: directory structure overview
Graph hint: run mcp__plugin_agent-flow_graphify__graph_stats then god_nodes(top_n=10) first; fall back to Grep only for literal text.
")

Agent(subagent_type="agent-flow:Riko", prompt="
CONVENTIONS: Find coding standards and patterns.
- Check config files (.eslintrc, .prettierrc, tsconfig.json, pyproject.toml)
- Look for .editorconfig, style guides
- Find naming conventions from existing code
- Report: coding conventions list
Graph hint: grep is correct here — conventions are literal-text patterns.
")

Agent(subagent_type="agent-flow:Riko", prompt="
ANTI-PATTERNS: Find forbidden patterns and warnings.
- Search for 'DO NOT', 'NEVER', 'ALWAYS', 'DEPRECATED', 'TODO', 'FIXME'
- Check for documented anti-patterns in README, CONTRIBUTING
- Look for lint rule comments indicating forbidden patterns
- Report: anti-patterns list with sources
Graph hint: grep is correct here — anti-patterns are literal-text patterns.
")

Agent(subagent_type="agent-flow:Riko", prompt="
BUILD AND CI: Understand build system and automation.
- Find package.json scripts, Makefile, build configs
- Check .github/workflows, CI configurations
- Identify test framework and test locations
- Report: build commands and CI pipeline
Graph hint: grep/read is correct here — build config is literal-file inspection.
")

Agent(subagent_type="agent-flow:Riko", prompt="
ARCHITECTURE: Map key components and dependencies.
- Identify core modules and their relationships
- Find dependency injection, service patterns
- Map data flow between components
- Report: architecture overview with component map
Graph hint: prefer mcp__plugin_agent-flow_graphify__god_nodes and get_neighbors over Grep for cross-module relationships.
")

Agent(subagent_type="agent-flow:Riko", prompt="
TESTING: Understand test structure and patterns.
- Find test directories and naming conventions
- Identify test framework (jest, pytest, etc.)
- Look for test utilities, fixtures, mocks
- Report: testing patterns and locations
Graph hint: use mcp__plugin_agent-flow_graphify__get_community on a test-file node to surface sibling tests; Grep for specific assertions only.
")

Agent(subagent_type="agent-flow:Riko", prompt="
PURPOSE & USE CASES: What this project (or focus path) is and why it exists.
- State what it is in 1-2 plain sentences
- Which problems it solves and for whom
- Main use cases and adoption modes (library / CLI / service / plugin), and how a user invokes each
- Which design decisions address those problems, and why. Cite rationale from docs, comments, ADRs, or commit messages
- Mark any claim whose only source is the README or marketing copy as 'per README (unverified)'
- Sources: README, docs/, examples/, CLI --help/usage text, package metadata, design docs
Graph hint: grep/read is correct here, since this is prose, not structure.
")

Agent(subagent_type="agent-flow:Riko", prompt="
KEY FLOWS: Trace 2-3 representative end-to-end flows.
- Trace the primary user action, plus one error or edge path
- Write each flow as a numbered list of file:line — what happens hops (5-10 hops), from entry point to side effect or output
- Read every hop to confirm it before reporting it
- Note where errors are raised, retried, swallowed, or time out, and any fragile spots (global state, caches, ordering assumptions)
Graph hint: use shortest_path / get_neighbors to find hops, then Read to confirm each one.
")

Read the full file on GitHub · 354 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed 19589a2231cc
  2. 2mo ago Changed · +53 lines f207098d8678
  3. 3mo ago First seen · 301 lines · 13 tokens per session scan B 270122de643f

Subscribe to this mod's changes

deep-dive is a command published in the GitHub repository josix/agent-flow (8 stars, last pushed 12d ago), licensed MIT. It adds 13 tokens to every session and 3,243 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

deep-dive compared with commands from other repositories

deep-dive next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
deep-divejosix/agent-flowCommand812d agoMITB13Claude Code
security-scanaffaan-m/ECCCommand314kyesterdayMITA16Claude Code, OpenCode
helpSmart-AI-Memory/attune-aiCommand12todayApache-2.0A9Claude Code
t00-statusmaysunAI/T00-zhCommand24mo agoMITA28Claude Code
story-deslopXiaoyangy/novel-studioCommand1702mo agoApache-2.0A24Claude Code
checklistgithub/spec-kitCommand153ktodayMITA13Claude Code
clarifygithub/spec-kitCommand153ktodayMITA27Claude Code