Borrowing it
Nothing to install: this file belongs to ggwhite/4x. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ggwhite/4x/main/.claude/skills/run-history-analysis/SKILL.mdgit clone --depth 1 https://github.com/ggwhite/4xWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ggwhite/4x/run-history-analysis)<a href="https://agentmods.dev/skills/ggwhite/4x/run-history-analysis"><img src="https://agentmods.dev/badge/skills/ggwhite/4x/run-history-analysis/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ggwhite/4x/run-history-analysis"><img src="https://agentmods.dev/badge/skills/ggwhite/4x/run-history-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00176 | $0.01982 |
| Opus 5 | $0.00088 | $0.00991 |
| Sonnet 5 | $0.00035 | $0.00396 |
| Haiku 4.5 | $0.00018 | $0.00198 |
Grade A, and why
run-history-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Run History Analysis
跨專案分析 4x pipeline 累積的執行歷史,找出問題模式、優化空間,並量化 Opus/Sonnet 與 Claude/Codex 交叉驗證的實際效益。全程唯讀分析,寫文件(Step 3) 與研究開票可行性(Step 4)都需使用者明確確認才動手,見「注意事項」。
目標專案
預設分析當前 .4x/ 所在專案;使用者若額外指名其他專案路徑(例如同時要看
Kairos),一併納入分析。每個專案獨立派一個 agent(見 Step 1),各自分析。
Step 1: 每個專案各派一個 researcher agent
用 Agent tool,subagent_type: researcher,run_in_background: false(需要等
全部回來才能彙整)。每個 agent prompt 需明確包含:
- 目標 repo 絕對路徑
- 唯讀分析任務(只讀取、比對、彙整,不修改任何檔案)
- 先確認規模:
ls .4x/run/ | wc -l、ls .4x/features/ | wc -l - 優先用聚合工具/既有彙整資料控制讀取成本(逐一讀所有 run 目錄原始 log 成 本過高)
- 以下 4 個維度逐一分析:
維度 1:過去遇到什麼問題、怎麼解決
- 讀
.4x/learnings-context.md(若無則讀.4x/learnings.json)全文 grep -c '"needs-attention"\|"blocked"' .4x/run/*/events.jsonl統計卡住比例- 讀
docs/reference/discovered-feature-gaps.md(若存在),算已開票率 - 挑 2-3 個具體案例(feature id + 具體卡點 + 怎麼解決),聚焦具體事實而非抽象 分類
- 若使用者提供已知案例作對照,要求 agent 找新的、還沒提過的案例
維度 2:有什麼可以優化的地方
- 從 learnings 的 process 類條目找「重複發生但架構性尚未解決」的模式
- 跑
4x cost --by-round --json(repo 根目錄;若無bin/4x用系統4x或make build)量化 retry(round≥2)佔總成本比例 - 找明顯偏貴/偏慢的 role/phase
維度 3:Opus vs Sonnet 效益
- 讀
.4x/settings.json的roles.*.model,確認哪些 role 用 opus/sonnet (fallback 邏輯見internal/protocol/model.go) - 跑
4x cost --json(by-role)拿 calls/totalUsd/avgUsd - 交叉比對:貴的 opus 角色是否真的换來更低的失敗/retry率,還是純燒錢
- 點出任何
--phase-override造成的臨時 model 覆蓋,避免歸因錯誤 - 若專案已有
docs/reference/model-routing-recommendations.md這類既有分析, agent 應先讀過,只補充新發現
維度 4:Claude/Codex 交叉驗證效益
- 搜尋是否有 run 曾用
--phase-override <phase>:codex:...或指定某 role 用 codex runner(grep events.jsonl/run.log 找codex,或看 state.json 的runner/runners欄位) - 找到的話,具體看那一輪 codex 當 reviewer 時抓出的問題,跟同 feature 若曾用 claude 審過的結果比較
- 樣本小要誠實說明,避免過度推論成通則
每個 agent 產出結構化報告(4 維度各一段,具體數字/feature id/檔案路徑佐證), 控制在 800 字內,多用條列。
Step 2: 彙整跨專案綜合報告
等所有 agent 回來後,在主線程彙整(這步不再派 agent):
- 逐維度比較各專案的數字(表格呈現),標出跨專案一致的模式(例如 retry 佔比、worktree 同步問題)——這類最有參考價值,代表是架構性而非單一專案偶發
- 標出專案特有的模式,分開陳述
- 給每個維度一個明確判讀/建議
直接以文字回覆使用者這份綜合報告(不要用 ReportFindings 工具)。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 120 lines · 176 tokens per session scan A 45d64d549674
run-history-analysis is a skill published in the GitHub repository ggwhite/4x (33 stars, last pushed 15d ago), licensed MIT. It adds 176 tokens to every session and 1,982 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
gws-modelarmor
Google Model Armor: Filter user-generated content for safety.
persona-event-coordinator
Plan and manage events — scheduling, invitations, and logistics.
persona-researcher
Organize research — manage references, notes, and collaboration.
persona-team-lead
Lead a team — run standups, coordinate tasks, and communicate.
recipe-save-email-attachments
Find Gmail messages with attachments and save them to a Google Drive folder.
recipe-create-meet-space
Create a Google Meet meeting space and share the join link.