deep-dive

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/josix/agent-flow/deep-dive
Clone the repo
git clone --depth 1 https://github.com/josix/agent-flow
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 2,282 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00013 $0.02282
Opus 5 $0.00006 $0.01141
Sonnet 5 $0.00003 $0.00456
Haiku 4.5 $0.00001 $0.00228

Measured 2d ago against content hash 270122de643f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 301 lines

How it starts

The opening of the file, as written. The whole thing — 301 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"} \
  $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
  • ALWAYS update state after each phase transition

Workflow Phases

Phase 1: Parallel Exploration (Fire Immediately)

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

Each Riko agent explores a different aspect:

// Fire all these agents SIMULTANEOUSLY (5+ concurrent)

Task(agent="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.
")

Task(agent="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.
")

Task(agent="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.
")

Task(agent="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.
")

Task(agent="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.
")

Task(agent="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.
")

Read the full file on GitHub · 301 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. 2d 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 (7 stars, last pushed 17d ago), licensed MIT. It adds 13 tokens to every session and 2,282 once invoked, about $0.0001 per session on Opus 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.