Prompt template
AI Coding Session Observability Dashboard + Harness Tuning (Claude Code / Codex)
A one-shot agent prompt that reads your local Claude Code and Codex session logs (read-only), computes tool-call, token, latency and error stats with a stdlib-only Python script, renders a Langfuse-style single-file dashboard, and writes a HARNESS.md proposing CLAUDE.md / AGENTS.md changes backed by the data. Shared by @Av1dlive.
Demo video
View caseStart from an example
Pick an example to load its exact settings, then make it yours.
Make it yours
Only the parts worth changing are shown. The prompt updates as you go.
Your prompt
Build me a Langfuse-style observability dashboard from my own AI coding sessions for the last 7 days. SOURCES (read locally, read-only): - Claude Code: ~/.claude/projects/**/*.jsonl - Codex: ~/.codex/sessions/**/*.jsonl (and ~/.codex/history.jsonl) Never print secrets, keys or full prompt text. Snippets max 10 words, with keys, paths, URLs and long ids stripped. STEP 1. Write a stdlib-only Python script that computes, per tool: - sessions per day, user prompts, tool calls by tool name, failed tool calls by tool and error type - models used, tokens (input, output, cache read/write) per model per day - tool-call latency p50/p95, overall and per tool; session length p50/p95 - top sessions by tokens, longest sessions, retries (same tool call repeated after an error) - prompts clustered into task types (build, debug, deploy, research, writing, UI, review, other) - sessions grouped by project (working directory), with subagent runs flagged If a log doesn't record something, write "not logged". Never invent numbers. Save the result as harness-summary.json. STEP 2. Render a single-file dashboard.html (dark, animated numbers and charts): - Summary strip: total tool calls, prompts, error rate, tokens, p95 latency - Traces table: one row per session (tool, project, start, duration, prompts, tool calls, errors, tokens, model); search, filter by tool, sort, toggle to hide subagent runs - Trace detail: click a session to see a waterfall of its turns and tool calls with ok/error and duration - Sessions by project, tokens over time by model, a model table (tokens, error rate) - Latency view per tool, and an error explorer grouped by tool and error type - Heuristic scores (tool success rate, retries, per-session health), clearly labeled "heuristic" Cap embedded traces at the top 200 sessions by tokens if the file gets too big. STEP 3. From the data, write HARNESS.md proposing changes to CLAUDE.md / AGENTS.md: - Model routing: which model for which task type, based on what I used and what failed - Tools: keep (high use, low failure), fix (high failure), cut (rarely used) - Skills: one for every task type I repeated 3+ times, with a trigger line and steps - Guardrails: my top 3 failure patterns and a check that prevents each - Budget: my top 5 token sinks and one change that would cut each Cite the sessions behind each suggestion. STEP 4. Show me the 5 headline numbers and the proposed diff before changing any config. I'll review weekly and change only what the data shows.
Click a highlighted part to change it.
When to use it
Use when you run Claude Code or Codex daily and want to see where your tokens, failures and time actually go before tuning your agent setup.
How to get the best result
- Run it inside Claude Code or Codex on the machine that holds the logs; it only reads ~/.claude and ~/.codex.
- Change the time window as one value; a week is a good first pass.
- Review the 5 headline numbers and the proposed diff before letting the agent edit any config.
Watch-outs
- Log formats change between versions; the prompt says to write 'not logged' instead of inventing numbers — keep that rule.
- Check the dashboard for leaked secrets before sharing it; the prompt strips keys and paths, but verify.
Related templates
- MILO Penguin Apple Sled Comedy (Character Sheet → Seedance 2.5 Workflow)Use when you want a consistent original 3D animal character in a physics-driven slapstick short and need the reference-sheet step that locks identity.
- Manga-Panel Music Video Edit from Two Clips (Claude Opus 5.5)Use when you have two AI-generated (or your own) action clips and a music file and want an AMV / anime-opening style edit built by Claude with code, no editing software.
- Restaurant Kitchen Martial-Arts Fight Scene (Seedance 2.5, 10s Beat List)Use when you want a short, cinematic action beat with clear second-by-second choreography and a richly dressed real-world location.
- Character Goodnight Bedroom Visual (ChatGPT Image, Japanese Prompt)Use when you want a soft, personal bedtime illustration of your own original character that reflects their personality down to the pajamas and bedroom decor.
- Character Fashion Magazine Cover (ChatGPT Image, Japanese Prompt)Use when you have an original character and want a polished, magazine-style key visual that shows them in a fresh, modern outfit.
- Gunslinger vs Giant Slow-Mo Sandevistan Shot List (Seedance 2.5)Use when you want a stylised action beat with a slow-motion afterimage ('Sandevistan') effect, a rewind and a full-speed replay, all inside one Seedance generation.
Source and attribution
- Example cases by
- Avid