retro
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseax:retro - guided experiment-loop session
ax:retro - 引导式实验循环会话
Closes the self-improvement loop. Claude orchestrates
commands; the user decides each row.
ax improve …Assumes (axctl) is on PATH. If fails, tell the user
to check (DuckDB dylib setup - no daemon
required) and stop.
axax improve listdocs/development.md#setup闭合自我改进循环。由Claude编排命令;用户逐行做出决策。
ax improve …假设(axctl)已在PATH中。如果执行失败,请告知用户查看(DuckDB动态库设置 - 无需守护进程)并终止操作。
axax improve listdocs/development.md#setupWhen to fire
触发时机
ONLY fire on explicit triggers:
- "let's do an ax retro" / "ax retrospective" / "retro time"
- "review my ax proposals" / "triage proposals"
- "what's my experiment loop status" / "lock pending verdicts"
- "hook effectiveness review" / "intervention review"
- "self-improvement session"
- slash command (if the plugin marketplace publishes one)
/ax:retro
Do NOT fire on a generic "look at my recent work" - that risks dragging
unrelated context into the loop.
仅在明确触发时执行:
- "let's do an ax retro" / "ax retrospective" / "retro time"
- "review my ax proposals" / "triage proposals"
- "what's my experiment loop status" / "lock pending verdicts"
- "hook effectiveness review" / "intervention review"
- "self-improvement session"
- 斜杠命令(若插件市场已发布)
/ax:retro
请勿在用户仅说“查看我最近的工作”这类通用请求时触发——这可能会将无关上下文引入循环。
Defaults
默认规则
- Window for hook signals: last 7 days. Widen to 30 if evidence is sparse.
- Don't apply changes silently. Every accept/reject/verdict gets the user's explicit yes per row.
- The retro is read-mostly. Skill scaffolds + verdict locks are the only side-effects.
- 钩子信号的时间窗口:最近7天。若证据不足,可扩大至30天。
- 请勿静默应用更改。每一项接受/拒绝/裁决都需用户逐行明确确认。
- 回顾以只读操作为主。仅有的副作用是生成Skill框架和锁定裁决。
Workflow
工作流程
Step 0 - Drain pending session retros
步骤0 - 清理待处理会话回顾
Before the proposal queue, check whether prior sessions still owe a
retro. This is the "quota arbitrage" path - idle Opus budget chews
through the backlog so the experiment loop has signal next time.
-
Run:bash
ax retro pending --since=7 --idle-min=30 --jsonReturns sessions in the last 7 days that have nograph edge yet AND look finished (explicitreviewed, or last turn isended_at30min idle). If the list is empty, skip to Step 1. -
Show the list to the user as 1 line per session (project · turns · model · reason). Ask:N session(s) pending retro. Want me to dispatch the retro-reviewer subagent for all of them in parallel, or pick a subset?
-
Onor
all: for each chosen session, write a brief:<subset>bashax retro brief --session=<session_id>This writeswith frontmatter (transcript path, suggested model, turn count, etc.) and a body that tells the reviewer what to do..ax/tasks/retro/<key>.md -
Dispatch onesubagent per brief, in parallel. Pass each brief path in the prompt; let the subagent's frontmatter pin
retro-reviewer(override per session ifmodel: opusdiffers and the user asked you to economize).suggested_modelIf thesubagent type doesn't resolve (not installed, or the active harness is not Claude Code), read and review the brief INLINE using its required-output instructions instead of abandoning the backlog.retro-reviewer -
Wait for all subagents. Aggregate results: counts of retros emitted, proposals recommended, model-fit suggestions. Render as a short summary. The user does not approve retro emissions per row - the subagent already wrote them. The user DOES decide on resulting proposals in Step 2.
-
Theedge now exists for each drained session, so a re-run of
reviewedshould show fewer rows.ax retro pending
If the user declines Step 0, move on. The backlog stays - next retro
picks it up.
在处理提案队列前,检查是否有之前的会话仍未完成回顾。这是“配额套利”路径——闲置的Opus预算会处理积压任务,以便实验循环下次运行时有可用信号。
-
执行:bash
ax retro pending --since=7 --idle-min=30 --json返回最近7天内尚未添加图边且已完成的会话(有明确的reviewed,或最后一次交互已闲置超过30分钟)。若列表为空,跳至步骤1。ended_at -
将列表以每行一个会话的形式展示给用户(项目·交互次数·模型·原因)。询问:有N个会话待回顾。是否要并行为所有会话调度retro-reviewer子代理,还是选择部分会话?
-
若用户选择或
all:对每个选中的会话,执行简短命令:<subset>bashax retro brief --session=<session_id>此命令会在中写入包含前置信息(转录路径、建议模型、交互次数等)的文档,正文部分会告知审核者需执行的操作。.ax/tasks/retro/<key>.md -
为每个文档并行调度一个子代理。在提示中传入每个文档的路径;让子代理的前置信息固定
retro-reviewer(若model: opus不同且用户要求节省成本,可按会话覆盖)。suggested_model若子代理类型无法解析(未安装,或当前使用的不是Claude Code),则直接读取并按照文档中的输出要求进行内审核,而非放弃积压任务。retro-reviewer -
等待所有子代理完成。汇总结果:已完成的回顾数量、推荐的提案数量、模型适配建议。以简短摘要形式呈现。用户无需逐行批准回顾输出——子代理已完成撰写。用户需在步骤2中对生成的提案做出决策。
-
每个已清理的会话现在都有了边,因此重新运行
reviewed应显示更少的行。ax retro pending
若用户拒绝步骤0,则继续后续流程。积压任务将保留至下次回顾处理。
Step 1 - Snapshot
步骤1 - 快照
Run silently (parallel where possible):
bash
ax improve list --status=open --json
ax improve list --status=accepted --json
ax improve verdict --json
ax retro list --since=7 --json # cluster-derived friction summary
ax hooks summary --since=7 --tail=20 # optional; tolerate failureax retro list- tool failures (skill form) -> proposals
Pre-<Tool> guard - correction pressure (guidance form) -> "Reduce recurring user
corrections" proposals targeting
CLAUDE.md - friction kinds (skill form, one per kind) -> proposals
Address recurring <kind> friction
If any of those surfaced, mention them so the user knows to triage in
Step 2.
Compute counts: open proposals (by form), accepted experiments with
, checkpoints due since last lock. Then render
to the user as 2-4 lines, e.g.:
locked_verdict IS NONE7 open proposals (3 skill, 4 guidance). 2 accepted experiments are waiting on a verdict. Hook activity last 7d: 142 invocations, 3 blocking errors. Want to triage proposals first, lock the pending verdicts, or skim hook signals?
If both proposal/verdict queues are empty: tell the user nothing's due
and offer to refresh evidence.
ax ingest --derive-only静默执行(尽可能并行):
bash
ax improve list --status=open --json
ax improve list --status=accepted --json
ax improve verdict --json
ax retro list --since=7 --json # 集群生成的摩擦摘要
ax hooks summary --since=7 --tail=20 # 可选;允许执行失败ax retro list- 工具失败(技能形式)→ 提案
Pre-<Tool> guard - 修正压力(指导形式)→ 针对的“减少重复用户修正”提案
CLAUDE.md - 摩擦类型(技能形式,每种类型一个)→ 提案
Address recurring <kind> friction
若出现上述任何一种情况,需告知用户以便在步骤2中进行分类处理。
计算统计数据:开放提案数量(按形式分类)、已接受且的实验数量、自上次锁定以来到期的检查点数量。然后以2-4行的形式呈现给用户,例如:
locked_verdict IS NONE7个开放提案(3个技能类,4个指导类)。2个已接受实验等待裁决。过去7天钩子活动:142次调用,3次阻塞错误。是否要先分类处理提案、锁定待处理裁决,还是浏览钩子信号?
若提案/裁决队列均为空:告知用户无待处理任务,并提供命令以刷新证据。
ax ingest --derive-onlyStep 2 - Triage open proposals
步骤2 - 分类处理开放提案
Order open proposals by desc. For each, in turn:
frequency-
Run(or reuse the row from step 1).
ax improve show <dedupe_sig> --json -
Render as 3-5 lines. Example for a skill proposal:Schema change guardrail (skill · freq=9 · confidence=high) Hypothesis: schema edits often surface in fix-chains within ~14d. Trigger: fix commits overlap schema files. Behavior: run schema lint + one read/write smoke before edit.
-
Ask the user: accept, reject, or skip.
-
Branch:
- accept → run . Tell the user where the SKILL.md was scaffolded. Offer: "Want to refine the scaffolded SKILL.md right now?" If yes: read the file, propose edits, write them back.
ax improve accept <dedupe_sig> - reject → ask for a short reason (≤80 chars).
Run .
ax improve reject <dedupe_sig> --reason "<reason>" - skip → no command. Move on; the proposal stays open for the next retro.
- accept → run
After the loop, summarize: "Accepted 3, rejected 1, skipped 2."
按降序排列开放提案。逐个处理:
frequency-
执行(或重用步骤1中的行数据)。
ax improve show <dedupe_sig> --json -
以3-5行的形式呈现。技能类提案示例:Schema变更防护(技能类 · 频率=9 · 置信度=高) 假设:Schema编辑通常会在约14天内出现在修复链中。 触发条件:修复提交涉及Schema文件。 行为:编辑前运行Schema校验+一次读写冒烟测试。
-
询问用户:接受、拒绝或跳过。
-
分支处理:
- 接受 → 执行。告知用户SKILL.md框架的生成位置。提供选项:“是否要立即优化生成的SKILL.md?” 若用户同意:读取文件,提出编辑建议并写入。
ax improve accept <dedupe_sig> - 拒绝 → 请求简短理由(≤80字符)。执行。
ax improve reject <dedupe_sig> --reason "<reason>" - 跳过 → 不执行命令。继续处理下一个提案;当前提案保持开放状态,留待下次回顾处理。
- 接受 → 执行
循环结束后,总结:“已接受3个,已拒绝1个,已跳过2个。”
Step 3 - Verdict review
步骤3 - 裁决审核
For each experiment whose latest checkpoint is unlocked
(), in age order:
locked_verdict IS NONE-
Runto fetch the experiment + checkpoint history.
ax improve verdict <dedupe_sig> -
Render the most recent checkpoint as 2-3 lines:Schema change guardrail - t+30 checkpoint 12 opportunities in window, 8 addressed (66%). Suggested: adopted.
-
Ask the user to confirm the suggested verdict OR override:
- (artifact is doing real work)
adopted - (user wrote it but never invoked it)
ignored - (it made things worse)
regressed - (mixed signal)
partial - (pattern self-resolved; trigger stopped firing)
no_longer_needed
-
Runto lock it.
ax improve verdict <dedupe_sig> --set <verdict>
按时间顺序处理每个最新检查点未锁定()的实验:
locked_verdict IS NONE-
执行以获取实验+检查点历史记录。
ax improve verdict <dedupe_sig> -
以2-3行的形式呈现最近的检查点:Schema变更防护 - t+30检查点 时间窗口内有12次机会,已处理8次(66%)。建议:已采用。
-
询问用户确认建议裁决或手动覆盖:
- (制品已实际投入使用)
adopted - (用户已编写但从未调用)
ignored - (导致情况恶化)
regressed - (信号混合)
partial - (模式自行解决;触发条件不再触发)
no_longer_needed
-
执行以锁定裁决。
ax improve verdict <dedupe_sig> --set <verdict>
Step 4 - Hook effectiveness pass (optional)
步骤4 - 钩子有效性检查(可选)
Only run if the user asked for hook review OR if step-1 found ≥3
blocking errors. Light touch - this section is read-only.
-
Show top hooks fromif not already shown.
ax hooks summary --since=7 --tail=20 -
If a hook keeps blocking, ask: "Want to inspect a recent invocation?" Then runand render.
ax hooks invocations --command="<hook>" --tail=5 -
Backtest known feedback cases:bash
ax hooks cases enforce-worktree --tail=50 --window=3Treat each backtest result as one case type. Report pass/fail/ inconclusive counts. -
Interpretation:
- A blocking hook error is not automatically bad. If the next few agent actions show corrected behavior, it's a useful corrective signal.
- A successful hook is not automatically useful. Look for downstream behavior change.
- without a terminal success/blocking event is a telemetry gap unless correlated with visible behavior.
hook_progress - Prefer deterministic backtests over model judgment.
- To author a NEW guard from a recurring failure: , write a
ax hooks inithook indefineHook,~/.ax/hooks/it against history, thenax hooks backtest.ax hooks install --providers=claude,codex
仅在用户要求钩子审核或步骤1中发现≥3次阻塞错误时执行。轻量级检查——此部分为只读操作。
-
若尚未展示,显示返回的顶级钩子。
ax hooks summary --since=7 --tail=20 -
若某个钩子持续阻塞,询问:“是否要查看最近一次调用记录?” 然后执行并呈现结果。
ax hooks invocations --command="<hook>" --tail=5 -
回测已知反馈案例:bash
ax hooks cases enforce-worktree --tail=50 --window=3将每个回测结果视为一种案例类型。报告通过/失败/不确定的数量。 -
解读规则:
- 钩子阻塞错误并非一定是坏事。若后续代理操作显示已纠正行为,则这是有用的纠正信号。
- 成功的钩子并非一定有用。需查看下游行为是否发生变化。
- 若无终端成功/阻塞事件的,除非与可见行为相关,否则视为遥测缺口。
hook_progress - 优先选择确定性回测而非模型判断。
- 要从重复失败中创建新防护:执行,在
ax hooks init中编写~/.ax/hooks/钩子,执行defineHook针对历史数据回测,然后执行ax hooks backtest。ax hooks install --providers=claude,codex
Step 5 - Close out
步骤5 - 收尾
Output a one-paragraph summary:
- Counts: accepted / rejected / skipped / verdicts locked.
- Any scaffolded SKILL.md files that still need refinement.
- When the next retro is recommended. Compute: earliest
among accepted-but-unlocked experiments, formatted as "next retro suggested around YYYY-MM-DD".
experiment.created_at + 7d
Then ask whether the user wants to commit the scaffolded skill files +
proposal-status changes (DB is local, but SKILL.md files are on disk
and may belong in version control).
输出一段总结:
- 统计数据:已接受/已拒绝/已跳过的提案数量、已锁定的裁决数量。
- 任何仍需优化的已生成SKILL.md文件。
- 建议的下次回顾时间。计算:已接受但未锁定的实验中最早的,格式为“建议下次回顾时间:YYYY-MM-DD左右”。
experiment.created_at + 7d
然后询问用户是否要提交已生成的skill文件+提案状态变更(数据库为本地存储,但SKILL.md文件在磁盘上,可能属于版本控制范畴)。
How to track feedback
反馈跟踪方式
The retro itself produces durable signal that the experiment loop
already captures:
-
Acceptance rate by form - after the session, derive from. If skill-form gets accepted 80% but guidance gets rejected 80%, the derive-proposals stage is over-eager on the wrong form. Surface as an observation.
proposal.status -
Reject reasons -is a free-text corpus. After the session run:
proposal.reject_reasonbashax improve list --status=rejected --json | jq '.[].reject_reason'Look for repeated phrases ("duplicate of existing hook"). When a pattern emerges, the derive-proposals stage should dedupe against it- tell the user.
-
Verdict surprises - when the user overrides a suggested verdict, note it. Repeated overrides mean the verdict math is biased.
These are observations, not actions. Report in the close-out; don't
write to insight tables.
回顾本身会产生持久信号,实验循环已对此进行捕获:
-
按形式分类的接受率 - 会话结束后,从推导。若技能类提案接受率为80%但指导类提案拒绝率为80%,则提案生成阶段在错误的形式上过于激进。需作为观察结果呈现。
proposal.status -
拒绝理由 -为自由文本语料库。会话结束后执行:
proposal.reject_reasonbashax improve list --status=rejected --json | jq '.[].reject_reason'查找重复短语(如“与现有钩子重复”)。当出现模式时,提案生成阶段应针对该模式进行去重——告知用户。 -
裁决意外 - 当用户覆盖建议裁决时,记录该情况。重复覆盖意味着裁决算法存在偏差。
这些均为观察结果,而非操作。在收尾阶段报告;无需写入洞察表。
CLI reference Claude calls
Claude调用的CLI参考
bash
ax improve list [--form=skill|subagent|hook|guidance|automation] \
[--status=open|accepted|rejected|superseded|all] [--json]
ax improve show <dedupe_sig> [--json]
ax improve accept <dedupe_sig> [--force]
ax improve reject <dedupe_sig> --reason "<text>"
ax improve verdict [<dedupe_sig>] [--set <verdict>] [--json]
ax improve checkpoint [--force]
ax improve reset --yes # destructive; only when user requests
ax retro pending [--since=N] [--idle-min=N] [--json] # Step 0 backlog
ax retro brief --session=<id> [--out-dir=<path>] [--json]
ax retro emit --session=<id> [--source=<src>] [--from-file=<json>]
ax retro list [--since=N] [--limit=N] [--json]
ax hooks summary [--since=N] [--tail=N]
ax hooks invocations [--command="<name>"] [--tail=N]
ax hooks cases <case-name> [--tail=N] [--window=N]--forceacceptreset --yesbash
ax improve list [--form=skill|subagent|hook|guidance|automation] \
[--status=open|accepted|rejected|superseded|all] [--json]
ax improve show <dedupe_sig> [--json]
ax improve accept <dedupe_sig> [--force]
ax improve reject <dedupe_sig> --reason "<text>"
ax improve verdict [<dedupe_sig>] [--set <verdict>] [--json]
ax improve checkpoint [--force]
ax improve reset --yes # 破坏性操作;仅在用户明确请求时执行
ax retro pending [--since=N] [--idle-min=N] [--json] # 步骤0积压任务
ax retro brief --session=<id> [--out-dir=<path>] [--json]
ax retro emit --session=<id> [--source=<src>] [--from-file=<json>]
ax retro list [--since=N] [--limit=N] [--json]
ax hooks summary [--since=N] [--tail=N]
ax hooks invocations [--command="<name>"] [--tail=N]
ax hooks cases <case-name> [--tail=N] [--window=N]accept--forcereset --yesFailure modes
故障模式
- returns empty → run
ax improve listonce, retry. If still empty, evidence is genuinely thin; tell the user.ax ingest --derive-only - reports
ax improve accept→ ask the user if they wantscaffold_existsor to abandon.--force - reports
ax improve verdict --set→ that experiment is already finalized; show the locked value and move on.verdict_locked - returns nothing → retry with
ax hooks summary; if still empty, the hook telemetry pipeline is idle, surface as a TODO.--since=30 - Read/query error → tell the user to check (
docs/development.md#setup).AX_DUCKDB_DYLIB
- 返回空结果 → 执行一次
ax improve list,重试。若仍为空,则证据确实不足;告知用户。ax ingest --derive-only - 报告
ax improve accept→ 询问用户是否要使用scaffold_exists或放弃操作。--force - 报告
ax improve verdict --set→ 该实验已最终确定;显示锁定的值并继续处理下一个。verdict_locked - 无返回结果 → 使用
ax hooks summary重试;若仍为空,则钩子遥测管道处于闲置状态,需作为待办事项告知用户。--since=30 - 读取/查询错误 → 告知用户查看(
docs/development.md#setup)。AX_DUCKDB_DYLIB
Anti-patterns
反模式
- Don't dump raw JSON. Render summaries.
- Don't run for every open proposal in a batch; the user must say yes per row.
ax improve accept - Don't write to directly. The CLI handles that.
~/.claude/skills/ - Don't propose deleting a scaffolded SKILL.md mid-retro; that's a separate cleanup task.
- Don't auto-implement experiments from the hook pass. Recommendations only; the user decides + commits.
- 请勿输出原始JSON。应呈现摘要。
- 请勿批量为所有开放提案执行;用户必须逐行确认同意。
ax improve accept - 请勿直接写入。由CLI处理该操作。
~/.claude/skills/ - 请勿在回顾过程中提议删除已生成的SKILL.md;这是单独的清理任务。
- 请勿从钩子检查阶段自动实现实验。仅提供建议;由用户决定并提交。