Skip to content

Commit 79f2e2d

Browse files
Spike Testclaude
andcommitted
fo-contract-token-cleanup: record #464/#465/#466 measured deltas (v0.23.0 / v0.24.0-pre1 / HEAD)
Boot-resident core -22.0% v0.23.0→HEAD; terminal/merge load -56.7% (#465); trimmed content relocates to failure-triggered deferred skills rather than deleting, so the full-surface byte sum is flat (+0.4%). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 1bd90de commit 79f2e2d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

docs/dev/_proposals/fo-contract-token-cleanup.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
22
title: FO contract token-cleanup
33
date: "2026-06-15"
4-
revised: "2026-06-19"
5-
status: proposal
4+
revised: "2026-07-02"
5+
status: applied
66
---
77

88
# FO contract token-cleanup
99

10+
> **Applied 2026-07-02.** Every cut in this proposal's default-path list (SC-2/3/4/5/6/7/8/12 + RT-3, plus the six `present-gate` PG cuts) was applied and independently validated PASSED by the `fo-contract-token-cut` task (archived 2026-06-21, merged via `pr-merge:426`; see `docs/dev/.spacedock-state/_archive/fo-contract-token-cut.md`), which also converted the surviving prose into compact `«fn»` pseudo-code bodies and collapsed re-explaining call sites — a further trim this proposal predates. The remaining `UCT-*`/legacy-team items stayed legacy-only or were re-derived at that time. Since then, the specific fix SHAPE this proposal recommended for SC-5/SC-7 (compressing a full section into a `## X (deferred module)` pointer carrying an arrow/done-when/guard triplet) has itself been identified as self-referential ceremony and is being replaced by a flat `## Deferred load points` list plus `Skill(skill="spacedock:...")` invocations — see the in-flight `deferred-modules-to-skills-and-rhetoric-trim` task (PR #457, `status: validation`). All token/size figures below predate several rounds of subsequent restructuring (#418, the state.commit follow-up, #453, #454, #457, #464, #465, #466) and no longer reflect the shipped files; they are preserved as a historical record of the original analysis, not a current measurement. This proposal is retained for provenance; no further cuts should be proposed against it without first rebasing against `docs/runtime-support.md`'s current discriminator.
11+
12+
> **Measured 2026-07-02 — PR #464/#465/#466 against `v0.23.0` / `v0.24.0-pre1` / `HEAD` (`8e66eadb`).** Per-ref `git ls-tree`/`git show` byte counts across the FO contract surface (boot-resident core = `first-officer-shared-core.md` + `claude-first-officer-runtime.md` + `skills/first-officer/SKILL.md`; first-dispatch load = `claude-fo-dispatch.md` + `fo-dispatch-core.md`; terminal/merge load = `fo-merge-core.md`; first-gate load = `present-gate/SKILL.md`; failure-triggered/deferred skills = `feedback-rejection-flow`, `fo-status-viewer`, `fo-write-core`, `fo-dispatch-recovery`; legacy-only = `using-legacy-claude-team/SKILL.md`) put the default-path total at 105,570 B (`v0.23.0`) → 109,045 B (`v0.24.0-pre1`) → 105,971 B (`HEAD`) — a net +401 B (+0.4%) `v0.23.0`→`HEAD`, essentially flat, because trimmed content relocated to the deferred bucket more than it shrank outright. The class that compounds every session, boot-resident, fell 35,531 B → 30,525 B → 27,723 B (-7,808 B / -22.0% `v0.23.0`→`HEAD`; ~1,952 fewer estimated tokens at bytes/4) — the only reduction with session-compounding payback. PR #464 (`8be4cc44`, `dispatch build --advance`) is a first-dispatch-load *increase* in the resident files — `claude-fo-dispatch.md` +1,302 B, `fo-dispatch-core.md` +183 B, plus `ensign-shared-core.md` +543 B and `codex-first-officer-runtime.md` +110 B — in exchange for collapsing the per-advance dispatched-message payload (a hand-embedded stage section) to a ≤300 B pointer at send time; that per-event saving does not show up in this file-level measurement. PR #465 (`7cb55555`) cut terminal/merge load 7,299 B → 3,226 B (-4,073 B / -55.8%, the single largest commit-level cut measured) by moving state/merge error-path remediation prose out of `fo-merge-core.md` into the binary's own failure stderr, with a companion -2,001 B cut to boot-resident `first-officer-shared-core.md`. PR #466 (`8e66eadb`) cut first-dispatch-load `claude-fo-dispatch.md` by -5,205 B — Degraded Mode, break-glass, and dead-ensign exception-path prose split into the new failure-triggered `skills/fo-dispatch-recovery/SKILL.md` (+7,685 B, loaded only when a dispatch exception fires) — at a cost of +265 B to boot-resident `first-officer-shared-core.md`, +163 B to `claude-first-officer-runtime.md`, and +140 B to the legacy-only `using-legacy-claude-team/SKILL.md` (repointed Degraded-Mode cross-refs). Net across all measured commits `v0.23.0`→`HEAD`: first-dispatch load -3,210 B (-7.9%, smaller than #466 alone because #464's +1,302 B and #454's fn-promotion +429 B on `fo-dispatch-core.md` partly offset it); terminal/merge load -4,228 B (-56.7%, attributable to #465 plus the earlier #457's -155 B); first-gate load unchanged (0 B across all three refs and every measured commit); the failure-triggered/deferred-skills bucket grew 2,711 B → 10,768 B → 18,218 B (+15,507 B / +572%, via #452/#453 standing up `fo-status-viewer`/`fo-write-core` and #457/#466 relocating trimmed prose there) — irrelevant to per-session cost on the default path since these skills load only on their trigger, and the reason the surface-wide byte sum does not fall even as boot-resident does.
13+
1014
> **Revised 2026-06-19 — reconciled with the #396 claude-team reframe.** PR #396 removed `TeamCreate`/`TeamDelete` on Claude Code ≥2.1.178: a worker is now a named background `Agent` with no team-creation step; the `using-claude-team` skill was renamed to `using-legacy-claude-team` (loaded only on legacy-`TeamCreate` runtimes); the runtime adapter's `## Team-mode ensign-chat hint` section was deleted outright; and `claude-fo-merge.md` was folded into `claude-fo-dispatch.md`. Consequences threaded through this pass: **RT-4 and RT-2 are retired** (their targets no longer exist), the `using-claude-team` cuts (UCT-*) **demote to legacy-only** (lowest payback tier), and the corrected default-path total is **~420 tokens**, not 638. The 2026-06-15 analysis is preserved below with these corrections marked inline.
1115
1216
This is an evidence-based, adversarially-verified token-cleanup pass over the first-officer contract files. Each candidate below was proposed by an analyst and then independently verified against the live files and cross-referenced load points; only the candidates that survived verification as `safe-cut` or `cut-with-care` are listed here. The verdicts that came back `keep` are recorded at the bottom with the concrete first-officer misbehavior each removal would cause, so they are on the record and not re-proposed. Cuts are weighted by load frequency: a cut in `first-officer-shared-core.md` or `claude-first-officer-runtime.md` is boot-resident and **compounds across the whole session** (the boot read is re-cached on every turn). The lazily-loaded files — `fo-dispatch-core.md`/`claude-fo-dispatch.md` (first dispatch), `present-gate/SKILL.md` (first gate), `fo-merge-core.md` (first terminal) — load **once, when first needed, and stay resident**, so a cut there is paid once per session that reaches that point, not per event. (A skill is not re-read on later gates or dispatches; the harness reminds the model not to re-invoke an already-loaded skill.) `using-legacy-claude-team/SKILL.md` is the lowest tier: post-#396 it loads only on legacy-`TeamCreate` runtimes (the pinned-2.1.177 CI lane), never on the merged default path. Corrected total on the default path: **~420 tokens** (~327 boot-resident: 282 shared-core + ~45 runtime adapter; ~93 at first gate), plus ~84 that applies only on legacy-`TeamCreate` runtimes. (The original pass reported 638, before #396 deleted RT-4's ~120-token target and renamed the team skill.) These are proposals for the captain, not applied edits.

0 commit comments

Comments
 (0)