Skip to main content
All templates

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.

Made for GPT ImageVideo templateRevision 2

Demo video

View case

Start from an example

Pick an example to load its exact settings, then make it yours.

  • View case

Make it yours

Only the parts worth changing are shown. The prompt updates as you go.

How far back to analyse sessions.

Your prompt

Build me a Langfuse-style observability dashboard from my own AI coding sessions for the . 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.

Source and attribution

Example cases by
Avid

Browse more