Comprehensive tools for analyzing, tracking, and visualizing Claude Code agent workflows.
This project provides a complete suite of tools to:
- Extract entities from Claude Code request logs (API requests, messages, tools, agents)
- Track agent instances across multiple requests and conversation turns
- Build workflow DAGs showing agent relationships and tool dependencies
- Visualize workflows with interactive HTML viewer
- Deduplicate entities to reduce redundancy and improve analysis
- Parse JSONL request logs from Claude Code proxy
- Extract all entities: requests, responses, messages, content blocks, tools, tasks, agents
- Deduplicate entities while preserving references
- Export to structured JSON format
- Identify unique agent instances across requests
- Track conversation continuations
- Link spawned subagents to parent agents
- Compute conversation fingerprints
- Track tool usage per agent
- Build directed acyclic graph of agent interactions
- Track spawn edges (parent → child agents)
- Track tool result edges (tool use → result)
- Compute workflow metrics (depth, branching, etc.)
- Identify root and leaf agents
- React-based viewer: Real-time log browsing with multiple panels
- Timeline panel: Chronological request visualization
- Statistics panel: Overview of workflow metrics
- Workflow graph: D3.js force-directed graph with zoom/pan
- Agent Gantt chart: Timeline view with spawn arrows showing parent-child relationships
- Request-level nodes: Each node = one API request, click to inspect
python3 -m analysis.extract_all_entities \
proxy/logs/requests_20260110.jsonl \
-o proxy/logs/requests_20260110.json# Start the log API server
cd proxy
uv run python log_api.py
# In another terminal, start the React viewer
cd proxy/viewer
pnpm devOpen http://localhost:58735 in a browser.
.
├── analysis/ # Entity extraction and tracking
│ ├── agent_tracker.py # Agent instance tracking
│ ├── entity_deduplicator.py # Entity deduplication
│ └── extract_all_entities.py # Main extraction script
│
├── proxy/ # Claude Code proxy server
│ ├── proxy_server.py # HTTP proxy for logging
│ ├── log_api.py # Log file API server
│ ├── log_classifier.py # Log entry enrichment
│ ├── workflow_graph.py # Workflow DAG construction
│ └── viewer/ # React-based visualization
│ ├── src/App.jsx # Main viewer application
│ ├── src/WorkflowPanel.jsx # D3.js workflow graph
│ ├── src/AgentGanttPanel.jsx # Agent Gantt chart
│ └── workflow_tree_viz.html # Standalone HTML viewer
│
├── scripts/ # Utility scripts
│ ├── analyze_system_prompts.py # System prompt analysis
│ └── extract_all_tools.py # Tool definition extraction
│
├── docs/ # Documentation
│ ├── AGENT_WORKFLOW_TRACKING.md # Technical documentation
│ └── LOG_ANALYSIS.md # Log structure analysis
│
└── DevLog/ # Development logs
- Agent Workflow Tracking: Complete technical documentation
- Log Analysis: Log structure and entity extraction details
# Extract entities from logs
python3 -m analysis.extract_all_entities \
proxy/logs/requests.jsonl \
-o proxy/logs/entities.json
# Start API server and viewer
cd proxy && uv run python log_api.py &
cd proxy/viewer && pnpm devpython3 scripts/analyze_system_prompts.py proxy/logs/requests.jsonlcd proxy
source .venv/bin/activate
python proxy_server.pyThen configure Claude Code to use the proxy:
export ANTHROPIC_API_URL=http://127.0.0.1:58734or create a settings file for Claude Code (see .claude/settings.json.example for an example):
{
"env": {
"ANTHROPIC_BASE_URL": "http://127.0.0.1:58734"
}
}A unique conversation with Claude, identified by:
- Conversation fingerprint (hash of message sequence)
- System prompt hash (agent type)
- Message count and timestamps
A directed acyclic graph showing:
- Nodes: Agent instances with metadata
- Edges: Spawn relationships and tool dependencies
- Metrics: Depth, branching factor, tool usage
Each node represents a single API request:
- Label:
agent_4 [2/3] - 7:45:06 PM - Click to view full conversation
- Sequential edges (blue) and spawn edges (grey)
- merge back edges (purple)
ENTITY EXTRACTION SUMMARY
Entity Counts:
api_requests : 263
messages : 1686
tool_uses : 2350
tool_results : 2074
AGENT TRACKING
Total Agent Instances: 129
Root Agents: 82
Child Agents (spawned): 47
Avg Requests/Agent: 2.04
DEDUPLICATION
Total Unique Entities: 193
Total Occurrences: 2412
Duplication Ratio: 12.5x
Duplicates Removed: 2219
- Python 3.10+
- Flask, requests, python-dotenv (for proxy server)
- Node.js and pnpm (for React viewer)
- Modern web browser for visualization
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests and documentation
- Submit a pull request
MIT
Built for analyzing Claude Code workflows and understanding agentic AI behavior.
This is for educational purpose.

