4x: Skill for Claude Code

.claude/skills/run-history-analysis/SKILL.md

run-history-analysis is a skill for Claude Code from ggwhite/4x. It costs 176 tokens per session (1,982 once invoked), scanned A, original, MIT.

A read-only analyst for the historical runs of the 4x multi-role AI development pipeline. It reviews stored run data, lessons, costs, and feature gaps across projects.

In plain words
What is it for?
Use it to compare past runs, examine retry costs, find unresolved patterns, assess Opus versus Sonnet usage, and produce dated reports.
Why use it?
It turns accumulated execution records into findings about recurring problems, possible improvements, model choices, and cross-checking between Claude and Codex.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md; mentions Codex.

This is ggwhite/4x's own configuration. It tells Claude Code how to work on 4x itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything 4x configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/ggwhite/4x/main/.claude/skills/run-history-analysis/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ggwhite/4x

Made for: Claude Code.

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

agentmods badge for run-history-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/ggwhite/4x/run-history-analysis/github.svg)](https://agentmods.dev/skills/ggwhite/4x/run-history-analysis)
Your own site
<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.

agentmods 80×15 button for run-history-analysis

Your own site · 80×15
<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>
Per session 176 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,982 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 9d ago against content hash 45d64d549674, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

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.

.claude/skills/run-history-analysis/SKILL.md · 120 lines

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: researcherrun_in_background: false(需要等 全部回來才能彙整)。每個 agent prompt 需明確包含:

  • 目標 repo 絕對路徑
  • 唯讀分析任務(只讀取、比對、彙整,不修改任何檔案)
  • 先確認規模:ls .4x/run/ | wc -lls .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 用系統 4xmake build)量化 retry(round≥2)佔總成本比例
  • 找明顯偏貴/偏慢的 role/phase

維度 3:Opus vs Sonnet 效益

  • .4x/settings.jsonroles.*.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 工具)。

Read the full file on GitHub · 120 lines

Changes

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.

  1. 9d ago First seen · 120 lines · 176 tokens per session scan A 45d64d549674

Subscribe to this mod's changes

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.