retro

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ax:retro - guided experiment-loop session

ax:retro - 引导式实验循环会话

Closes the self-improvement loop. Claude orchestrates
ax improve …
commands; the user decides each row.
Assumes
ax
(axctl) is on PATH. If
ax improve list
fails, tell the user to check
docs/development.md#setup
(DuckDB dylib setup - no daemon required) and stop.
闭合自我改进循环。由Claude编排
ax improve …
命令;用户逐行做出决策。
假设
ax
(axctl)已在PATH中。如果
ax improve list
执行失败,请告知用户查看
docs/development.md#setup
(DuckDB动态库设置 - 无需守护进程)并终止操作。

When 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"
  • /ax:retro
    slash command (if the plugin marketplace publishes one)
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.
  1. Run:
    bash
    ax retro pending --since=7 --idle-min=30 --json
    Returns sessions in the last 7 days that have no
    reviewed
    graph edge yet AND look finished (explicit
    ended_at
    , or last turn is
    30min idle). If the list is empty, skip to Step 1.
  2. 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?
  3. On
    all
    or
    <subset>
    : for each chosen session, write a brief:
    bash
    ax retro brief --session=<session_id>
    This writes
    .ax/tasks/retro/<key>.md
    with frontmatter (transcript path, suggested model, turn count, etc.) and a body that tells the reviewer what to do.
  4. Dispatch one
    retro-reviewer
    subagent per brief, in parallel. Pass each brief path in the prompt; let the subagent's frontmatter pin
    model: opus
    (override per session if
    suggested_model
    differs and the user asked you to economize).
    If the
    retro-reviewer
    subagent 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.
  5. 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.
  6. The
    reviewed
    edge now exists for each drained session, so a re-run of
    ax retro pending
    should show fewer rows.
If the user declines Step 0, move on. The backlog stays - next retro picks it up.
在处理提案队列前,检查是否有之前的会话仍未完成回顾。这是“配额套利”路径——闲置的Opus预算会处理积压任务,以便实验循环下次运行时有可用信号。
  1. 执行:
    bash
    ax retro pending --since=7 --idle-min=30 --json
    返回最近7天内尚未添加
    reviewed
    图边且已完成的会话(有明确的
    ended_at
    ,或最后一次交互已闲置超过30分钟)。若列表为空,跳至步骤1。
  2. 将列表以每行一个会话的形式展示给用户(项目·交互次数·模型·原因)。询问:
    有N个会话待回顾。是否要并行为所有会话调度retro-reviewer子代理,还是选择部分会话?
  3. 若用户选择
    all
    <subset>
    :对每个选中的会话,执行简短命令:
    bash
    ax retro brief --session=<session_id>
    此命令会在
    .ax/tasks/retro/<key>.md
    中写入包含前置信息(转录路径、建议模型、交互次数等)的文档,正文部分会告知审核者需执行的操作。
  4. 为每个文档并行调度一个
    retro-reviewer
    子代理。在提示中传入每个文档的路径;让子代理的前置信息固定
    model: opus
    (若
    suggested_model
    不同且用户要求节省成本,可按会话覆盖)。
    retro-reviewer
    子代理类型无法解析(未安装,或当前使用的不是Claude Code),则直接读取并按照文档中的输出要求进行内审核,而非放弃积压任务。
  5. 等待所有子代理完成。汇总结果:已完成的回顾数量、推荐的提案数量、模型适配建议。以简短摘要形式呈现。用户无需逐行批准回顾输出——子代理已完成撰写。用户需在步骤2中对生成的提案做出决策。
  6. 每个已清理的会话现在都有了
    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 failure
ax retro list
reflects three pattern types now:
  • tool failures (skill form) ->
    Pre-<Tool> guard
    proposals
  • correction pressure (guidance form) -> "Reduce recurring user corrections" proposals targeting
    CLAUDE.md
  • friction kinds (skill form, one per kind) ->
    Address recurring <kind> friction
    proposals
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
locked_verdict IS NONE
, checkpoints due since last lock. Then render to the user as 2-4 lines, e.g.:
7 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
ax ingest --derive-only
to refresh evidence.
静默执行(尽可能并行):
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中进行分类处理。
计算统计数据:开放提案数量(按形式分类)、已接受且
locked_verdict IS NONE
的实验数量、自上次锁定以来到期的检查点数量。然后以2-4行的形式呈现给用户,例如:
7个开放提案(3个技能类,4个指导类)。2个已接受实验等待裁决。过去7天钩子活动:142次调用,3次阻塞错误。是否要先分类处理提案、锁定待处理裁决,还是浏览钩子信号?
若提案/裁决队列均为空:告知用户无待处理任务,并提供
ax ingest --derive-only
命令以刷新证据。

Step 2 - Triage open proposals

步骤2 - 分类处理开放提案

Order open proposals by
frequency
desc. For each, in turn:
  1. Run
    ax improve show <dedupe_sig> --json
    (or reuse the row from step 1).
  2. 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.
  3. Ask the user: accept, reject, or skip.
  4. Branch:
    • accept → run
      ax improve accept <dedupe_sig>
      . 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.
    • 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.
After the loop, summarize: "Accepted 3, rejected 1, skipped 2."
frequency
降序排列开放提案。逐个处理:
  1. 执行
    ax improve show <dedupe_sig> --json
    (或重用步骤1中的行数据)。
  2. 以3-5行的形式呈现。技能类提案示例:
    Schema变更防护(技能类 · 频率=9 · 置信度=高) 假设:Schema编辑通常会在约14天内出现在修复链中。 触发条件:修复提交涉及Schema文件。 行为:编辑前运行Schema校验+一次读写冒烟测试。
  3. 询问用户:接受拒绝跳过
  4. 分支处理:
    • 接受 → 执行
      ax improve accept <dedupe_sig>
      。告知用户SKILL.md框架的生成位置。提供选项:“是否要立即优化生成的SKILL.md?” 若用户同意:读取文件,提出编辑建议并写入。
    • 拒绝 → 请求简短理由(≤80字符)。执行
      ax improve reject <dedupe_sig> --reason "<reason>"
    • 跳过 → 不执行命令。继续处理下一个提案;当前提案保持开放状态,留待下次回顾处理。
循环结束后,总结:“已接受3个,已拒绝1个,已跳过2个。”

Step 3 - Verdict review

步骤3 - 裁决审核

For each experiment whose latest checkpoint is unlocked (
locked_verdict IS NONE
), in age order:
  1. Run
    ax improve verdict <dedupe_sig>
    to fetch the experiment + checkpoint history.
  2. Render the most recent checkpoint as 2-3 lines:
    Schema change guardrail - t+30 checkpoint 12 opportunities in window, 8 addressed (66%). Suggested: adopted.
  3. Ask the user to confirm the suggested verdict OR override:
    • adopted
      (artifact is doing real work)
    • ignored
      (user wrote it but never invoked it)
    • regressed
      (it made things worse)
    • partial
      (mixed signal)
    • no_longer_needed
      (pattern self-resolved; trigger stopped firing)
  4. Run
    ax improve verdict <dedupe_sig> --set <verdict>
    to lock it.
按时间顺序处理每个最新检查点未锁定(
locked_verdict IS NONE
)的实验:
  1. 执行
    ax improve verdict <dedupe_sig>
    以获取实验+检查点历史记录。
  2. 以2-3行的形式呈现最近的检查点:
    Schema变更防护 - t+30检查点 时间窗口内有12次机会,已处理8次(66%)。建议:已采用
  3. 询问用户确认建议裁决或手动覆盖:
    • adopted
      (制品已实际投入使用)
    • ignored
      (用户已编写但从未调用)
    • regressed
      (导致情况恶化)
    • partial
      (信号混合)
    • no_longer_needed
      (模式自行解决;触发条件不再触发)
  4. 执行
    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.
  1. Show top hooks from
    ax hooks summary --since=7 --tail=20
    if not already shown.
  2. If a hook keeps blocking, ask: "Want to inspect a recent invocation?" Then run
    ax hooks invocations --command="<hook>" --tail=5
    and render.
  3. Backtest known feedback cases:
    bash
    ax hooks cases enforce-worktree --tail=50 --window=3
    Treat each backtest result as one case type. Report pass/fail/ inconclusive counts.
  4. 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.
    • hook_progress
      without a terminal success/blocking event is a telemetry gap unless correlated with visible behavior.
    • Prefer deterministic backtests over model judgment.
    • To author a NEW guard from a recurring failure:
      ax hooks init
      , write a
      defineHook
      hook in
      ~/.ax/hooks/
      ,
      ax hooks backtest
      it against history, then
      ax hooks install --providers=claude,codex
      .
仅在用户要求钩子审核或步骤1中发现≥3次阻塞错误时执行。轻量级检查——此部分为只读操作。
  1. 若尚未展示,显示
    ax hooks summary --since=7 --tail=20
    返回的顶级钩子。
  2. 若某个钩子持续阻塞,询问:“是否要查看最近一次调用记录?” 然后执行
    ax hooks invocations --command="<hook>" --tail=5
    并呈现结果。
  3. 回测已知反馈案例:
    bash
    ax hooks cases enforce-worktree --tail=50 --window=3
    将每个回测结果视为一种案例类型。报告通过/失败/不确定的数量。
  4. 解读规则:
    • 钩子阻塞错误并非一定是坏事。若后续代理操作显示已纠正行为,则这是有用的纠正信号。
    • 成功的钩子并非一定有用。需查看下游行为是否发生变化。
    • 若无终端成功/阻塞事件的
      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
    experiment.created_at + 7d
    among accepted-but-unlocked experiments, formatted as "next retro suggested around YYYY-MM-DD".
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文件。
  • 建议的下次回顾时间。计算:已接受但未锁定的实验中最早的
    experiment.created_at + 7d
    ,格式为“建议下次回顾时间:YYYY-MM-DD左右”。
然后询问用户是否要提交已生成的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
    proposal.status
    . 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.
  • Reject reasons -
    proposal.reject_reason
    is a free-text corpus. After the session run:
    bash
    ax 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.
回顾本身会产生持久信号,实验循环已对此进行捕获:
  • 按形式分类的接受率 - 会话结束后,从
    proposal.status
    推导。若技能类提案接受率为80%但指导类提案拒绝率为80%,则提案生成阶段在错误的形式上过于激进。需作为观察结果呈现。
  • 拒绝理由 -
    proposal.reject_reason
    为自由文本语料库。会话结束后执行:
    bash
    ax 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]
--force
on
accept
overwrites an existing SKILL.md scaffold. Only use when the user explicitly says so.
reset --yes
wipes ALL proposal/experiment/checkpoint state. NEVER run without explicit user confirmation in this session.
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                     # 破坏性操作;仅在用户明确请求时执行

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
命令的
--force
参数会覆盖现有的SKILL.md框架。仅在用户明确要求时使用。
reset --yes
会清除所有提案/实验/检查点状态。在本次会话中,必须获得用户明确确认后方可执行。

Failure modes

故障模式

  • ax improve list
    returns empty → run
    ax ingest --derive-only
    once, retry. If still empty, evidence is genuinely thin; tell the user.
  • ax improve accept
    reports
    scaffold_exists
    → ask the user if they want
    --force
    or to abandon.
  • ax improve verdict --set
    reports
    verdict_locked
    → that experiment is already finalized; show the locked value and move on.
  • ax hooks summary
    returns nothing → retry with
    --since=30
    ; if still empty, the hook telemetry pipeline is idle, surface as a TODO.
  • 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
    ax improve accept
    for every open proposal in a batch; the user must say yes per row.
  • Don't write to
    ~/.claude/skills/
    directly. The CLI handles that.
  • 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
    ;用户必须逐行确认同意。
  • 请勿直接写入
    ~/.claude/skills/
    。由CLI处理该操作。
  • 请勿在回顾过程中提议删除已生成的SKILL.md;这是单独的清理任务。
  • 请勿从钩子检查阶段自动实现实验。仅提供建议;由用户决定并提交。