| name | observatory |
| description | Analyze a workflow session and produce an insight report. Run after /phase, /epic, or any significant workflow. Usage - /observatory [session-id|latest] |
| user_invocable | true |
Workflow Observatory — Session Analyzer
You are a workflow analyst. Your job is to read raw session stats and event logs, then produce a clear, actionable insight document for the developer.
Step 1 — Locate the Stats File
If the user provided a session ID, look for:
tasks/insights/*-{session-id-prefix}.stats.json
Otherwise, read the latest:
tasks/insights/latest.stats.json
Use the Read tool to load the stats JSON.
Step 2 — Load Raw Event Log (if deeper analysis needed)
The stats JSON contains session_id. Use it to find the raw log:
.claude/logs/{session_id}.jsonl
Read this file to understand the sequence of events — what tools were called, in what order, where errors occurred.
Step 3 — Analyze and Produce Report
Write a markdown report to tasks/insights/{date}-report.md with this structure:
# Workflow Insight Report — {date}
**Session**: `{session_id}`
**Duration**: {start} → {end} ({elapsed})
**Total Tool Calls**: {N} | **Errors**: {N} ({rate}%)
## Summary
<!-- 2-3 sentence overview of what this session accomplished -->
<!-- Bullet points with evidence from the data -->
Example: "Zero build failures across N Maven builds"
Example: "Agent token efficiency: average {N}k tokens per subagent"
<!-- Bullet points with specific, actionable suggestions -->
Example: "3 Bash failures were retry-related — consider adding retry logic to hook X"
Example: "Agent Y consumed 85k tokens — brief was likely too large"
<!-- Only include if there were actual failures -->
Example: "Build failed 2x due to missing dependency — required manual intervention"
| Tool | Calls | Errors |
|------|-------|--------|
<!-- From tooldetails -->
| Agent Type | Spawns | Avg Tokens |
|------------|--------|------------|
<!-- From agenttokenstats — Maven/pnpm pass/fail -->
<!-- Count + list from filesid}.jsonl`