门道

所有人都在追下一个模型

入选理由用会话日志搭建可观测看板定位问题

CyrilXBT@cyrilXBT原帖卡片由 X 提供,X 可能收集你的浏览数据,用于广告和个性化,所以你同意后才加载。不同意也能看下面的文字。详情和退出方式

所有人都在追下一个模型。 真正的优势,却很朴素。 围绕你自己的实际工作方式,构建一套运行框架。 Agent 已经在记录每一次会话。 每条提示词。 每次工具调用。 每个错误。 每个 Token。 几乎没人去读。 这一条提示词,就能把日志变成仪表盘,准确告诉你该修什么。 把它粘贴进 Claude Code 或 Codex 👇 START OF PROMPT Build me an observability dashboard (like Langfuse) from my own AI coding sessions over the last 7 days. SOURCES (read only, never modify): Claude Code: ~/.claude/projects//*.jsonl Codex: ~/.codex/sessions//*.jsonl and ~/.codex/history.jsonl PRIVACY: Never print secrets, API keys or full prompts. Any snippet stays under 10 words with keys, paths, URLs and long IDs removed. STEP 1: THE NUMBERS Write a Python script using only the standard library. For each tool, calculate: • Sessions per day, prompts, and tool calls by tool name • Failed tool calls, grouped by tool and error type • Models used and tokens per model per day (input, output, cache read, cache write) • Tool call latency and session length at p50 and p95 • Biggest sessions by tokens, longest sessions, and retries (same call repeated after an error) • Prompts sorted into task types: build, debug, deploy, research, writing, UI, review, other • Sessions grouped by project folder, with subagent runs flagged If something isn't in the logs, write "not logged". Never make up a number. Save everything to harness-summary.json. STEP 2: THE DASHBOARD Build one self contained dashboard.html with a dark theme and animated charts: • Top strip: tool calls, prompts, error rate, tokens, p95 latency • Sessions table: tool, project, start time, duration, prompts, tool calls, errors, tokens, model. Searchable, sortable, filterable, with a toggle to hide subagent runs • Click any session to see a timeline of every turn and tool call, marked ok or error, with duration • Charts for sessions by project, tokens over time by model, and a model table with error rates • Latency by tool and an error explorer grouped by tool and error type • Health scores per session, clearly labeled "heuristic" If the file gets too big, include only the top 200 sessions by tokens. STEP 3: THE FIXES Using only this data, write HARNESS.md with suggested changes to my CLAUDE.md or AGENTS.md: • Model routing: which model should handle which task type, based on what worked and what failed • Tools: keep (used a lot, rarely fails), fix (fails often), cut (barely used) • Skills: one skill for every task I repeated 3+ times, with a trigger line and steps • Guardrails: my 3 most common failure patterns and a check that prevents each one • Budget: my 5 biggest token drains and one change that cuts each Back every suggestion with the sessions it came from. STEP 4: REVIEW FIRST Show me my 5 headline numbers and the proposed config changes as a diff. Change NOTHING until I approve. END OF PROMPT 每周运行一次。 只改有数据证明需要改的地方。 这样,当其他人还在等下一个模型时,你的 AI 每周都在变好。

AI 翻译,以原帖为准

提示词工具推荐进阶长文有代码个人Claude CodeCodex#会话日志#可观测看板#日志分析
新4 天前 · X 上 27 收藏 · 79 赞看原帖