跳过主要内容
全部模板

提示词模板

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.

专为 GPT Image 设计视频模板第 2 版

演示视频

查看案例

从示例开始

点一张示例图,整套设置立即套用,再改成你自己的。

  • 查看案例

改成你的

只展示值得改的部分,提示词会实时更新。

How far back to analyse sessions.

你的提示词

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.

点击高亮部分即可直接修改。

适用场景

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.

怎样效果最好

  • 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.

避坑提醒

  • 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.

来源与归属

示例案例作者
Avid

继续浏览