Repository navigation
SubagentStart token-lanes carrier for non-blind subagents (native probe, measured RTK rule) - #378
Merged
seathatflowsinourveins merged 4 commits intoSep 27, 2026
Conversation
seathatflowsinourveins
pushed a commit
that referenced
this pull request
Sep 27, 2026
The GPT-6 review of #378 at 85dd27c found that the text test checked len(block), a character count, although the decision record states a 3,500-byte budget: a 3,280-character, 3,520-byte block would pass. The test now measures the file's bytes through fits_budget() and adds that case as a regression test. Controls: a character-counting fits_budget fails the regression test, and a block padded to 3,560 bytes (3,360 characters) fails the byte check but passed the old character check. The committed block is ASCII, 3,159 bytes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seathatflowsinourveins
force-pushed
the
claude/token-lanes-subagent-carrier-20260927
branch
from
September 27, 2026 04:19
85dd27c to
eb64a38
Compare
Owner
Author
Cross-family review (GPT-6), one round
Re-verification on the final head
🤖 Generated with Claude Code |
seathatflowsinourveins
pushed a commit
that referenced
this pull request
Sep 27, 2026
The GPT-6 review of #378 at 85dd27c found that the text test checked len(block), a character count, although the decision record states a 3,500-byte budget: a 3,280-character, 3,520-byte block would pass. The test now measures the file's bytes through fits_budget() and adds that case as a regression test. Controls: a character-counting fits_budget fails the regression test, and a block padded to 3,560 bytes (3,360 characters) fails the byte check but passed the old character check. The committed block is ASCII, 3,159 bytes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seathatflowsinourveins
force-pushed
the
claude/token-lanes-subagent-carrier-20260927
branch
from
September 27, 2026 04:53
eb64a38 to
3917bc4
Compare
Owner
Author
Replayed onto
|
Adds a stdlib, fail-open SubagentStart hook that returns adoption/hooks/claude/token-lanes-block.md as additionalContext to every subagent except agent types starting "blind-", registers it in the Claude settings template beside ai-memory, and installs both files through the existing sha256-checked guard step. docs/token-session-handbook.md "Token lanes carried into subagents" is the source of truth the block copies line for line. Its RTK line is the measured RTK 0.50.0 rule (rtk hook check and the rtk hook claude PreToolUse hook; rewrite_multiline_block, rtk-ai/rtk#3319): && chains and multi-line blocks are rewritten segment by segment; $(...), backticks, <(...), file redirects and heredocs are never rewritten; gh pipelines are not rewritten. Native probe (Claude Code 2.1.283, Agent-tool Haiku children): with the hook the child found and quoted the block's first 60 characters exactly; without it, and for a blind-judge child with it, the child found nothing. Decision record: docs/decisions/2026-09-27-token-lanes-subagent-start.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
evidence/artifacts/token-lanes-subagent-start-20260927/ retains, sanitized, the five native probe runs (Claude Code 2.1.283, Agent-tool Haiku children: without the hook, with it, and a blind-judge child with it, plus the failed v1 question kept as a failed design) and 17 RTK 0.50.0 inputs through both `rtk hook check` and the `rtk hook claude` PreToolUse processor. Raw CLI output and child transcripts stay private and are identified by SHA-256 and counts. Evidence class local_integration; not native_proven for Workflow children, which have not run with the hook. The handbook's RTK sources paragraph and the decision record now cite the receipt instead of unretained observations. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The GPT-6 review of #378 at 85dd27c found that the text test checked len(block), a character count, although the decision record states a 3,500-byte budget: a 3,280-character, 3,520-byte block would pass. The test now measures the file's bytes through fits_budget() and adds that case as a regression test. Controls: a character-counting fits_budget fails the regression test, and a block padded to 3,560 bytes (3,360 characters) fails the byte check but passed the old character check. The committed block is ASCII, 3,159 bytes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replayed onto main: the bootstrap.md note merges after #366's OTEL tool-details sentence, manifests/evidence.json is re-registered, and the matrix and grand list are regenerated. validate FAILS=0; 438 related tests OK. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seathatflowsinourveins
force-pushed
the
claude/token-lanes-subagent-carrier-20260927
branch
from
September 27, 2026 05:54
3917bc4 to
7d53389
Compare
seathatflowsinourveins
deleted the
claude/token-lanes-subagent-carrier-20260927
branch
September 27, 2026 06:11
seathatflowsinourveins
pushed a commit
that referenced
this pull request
Sep 28, 2026
… conditions Token-lanes decision, addendum 2026-09-28: why the default carrier line now asks only for evidence (Opus 5 guide L61, L81; Opus 5.5 guide L9; prompting best practices L780; Claude Code best practices L52), why the builder line is removed on its own merits (isolated-builder.md L5, L7-9, L12; sub-agents reference L600), sizes, the failing-first control, the non-Opus boundary, alternatives, #381 freeze and overturn. Skills-trial record, addendum 2026-09-28: condition log C0-C3 (#378, 2026-10-25 review rule for verification-before-completion: a with/without comparison on frozen builder tasks through an upstream harness named with its pin (tokens, elapsed time, review-found defects). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seathatflowsinourveins
pushed a commit
that referenced
this pull request
Sep 28, 2026
… conditions Token-lanes decision, addendum 2026-09-28: why the default carrier line now asks only for evidence (Opus 5 guide L61, L81; Opus 5.5 guide L9; prompting best practices L780; Claude Code best practices L52), why the builder line is removed on its own merits (isolated-builder.md L5, L7-9, L12; sub-agents reference L600), sizes, the failing-first control, the non-Opus boundary, alternatives, #381 freeze and overturn. Skills-trial record, addendum 2026-09-28: condition log C0-C3 (#378, 2026-10-25 review rule for verification-before-completion: a with/without comparison on frozen builder tasks through an upstream harness named with its pin (tokens, elapsed time, review-found defects). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seathatflowsinourveins
pushed a commit
that referenced
this pull request
Sep 28, 2026
… conditions Token-lanes decision, addendum 2026-09-28: why the default carrier line now asks only for evidence (Opus 5 guide L61, L81; Opus 5.5 guide L9; prompting best practices L780; Claude Code best practices L52), why the builder line is removed on its own merits (isolated-builder.md L5, L7-9, L12; sub-agents reference L600), sizes, the failing-first control, the non-Opus boundary, alternatives, #381 freeze and overturn. Skills-trial record, addendum 2026-09-28: condition log C0-C3 (#378, 2026-10-25 review rule for verification-before-completion: a with/without comparison on frozen builder tasks through an upstream harness named with its pin (tokens, elapsed time, review-found defects). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seathatflowsinourveins
pushed a commit
that referenced
this pull request
Sep 28, 2026
… conditions Token-lanes decision, addendum 2026-09-28: why the default carrier line now asks only for evidence (Opus 5 guide L61, L81; Opus 5.5 guide L9; prompting best practices L780; Claude Code best practices L52), why the builder line is removed on its own merits (isolated-builder.md L5, L7-9, L12; sub-agents reference L600), sizes, the failing-first control, the non-Opus boundary, alternatives, #381 freeze and overturn. Skills-trial record, addendum 2026-09-28: condition log C0-C3 (#378, 2026-10-25 review rule for verification-before-completion: a with/without comparison on frozen builder tasks through an upstream harness named with its pin (tokens, elapsed time, review-found defects). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seathatflowsinourveins
added a commit
that referenced
this pull request
Sep 28, 2026
…l line (AN-15, after #447) (#456) * Token-lanes carrier: evidence line replaces the verification-skill instruction Default block line 13 now asks for evidence (the command and what it returned, or the file:line read) and keeps the search-first sentence: 4,094 -> 4,088 bytes against the unchanged 4,100-byte bound (AN-15). The builder block drops its verification sentence (2,883 -> 2,747 bytes): isolated-builder.md:7-9 preloads the skill and :12 names it. Sources: code.claude.com/docs/en/best-practices.md L52 (show evidence); platform.claude.com prompting-claude-opus-5.md L61, L81 (remove explicit verification instructions), prompting-claude-opus-5-5.md L9 (carried forward), claude-prompting-best-practices.md L780 (Opus 5 exception). Handbook mirror: carrier line, its sources paragraph naming only search-first, and the builder table row and variant. Tests: the default key phrase becomes "Show evidence before a success claim", the builder drops the skill phrase, and no block may name the withdrawn skill. SHA256SUMS refreshed for both blocks. No installer run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Decision records: verification-line addendum and skills-trial carrier conditions Token-lanes decision, addendum 2026-09-28: why the default carrier line now asks only for evidence (Opus 5 guide L61, L81; Opus 5.5 guide L9; prompting best practices L780; Claude Code best practices L52), why the builder line is removed on its own merits (isolated-builder.md L5, L7-9, L12; sub-agents reference L600), sizes, the failing-first control, the non-Opus boundary, alternatives, #381 freeze and overturn. Skills-trial record, addendum 2026-09-28: condition log C0-C3 (#378, 2026-10-25 review rule for verification-before-completion: a with/without comparison on frozen builder tasks through an upstream harness named with its pin (tokens, elapsed time, review-found defects). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Decision records: date the builder preload boundary; drop an unretained count Skills-trial condition log: isolated-builder's verification-before-completion preload and the body line that names it came from #376 (623d34f, 2026-09-27T03:38:47Z per TZ=UTC git log -S on adoption/agents/claude/isolated-builder.md), a boundary inside C0, not a constant across every condition. The one recorded install time is attributed as measured-gaps.md reports it (the coordinator's local measurement), without naming a host. Token-lanes addendum: the community alternative keeps superpowers as the verifiable example and drops a survey count that is not retained in the repository. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Token-lanes carrier: tag the evidence sentence's upstream item; narrow the no-verification claim Repair round for the verification-line change (review findings R-F2, R-F7). - token-lanes-block.md line 13 moves "(code.claude.com best practices)" to follow "the command and what it returned", the item Claude Code best practices L52 names (https://code.claude.com/docs/en/best-practices.md, re-read 2026-09-28). The file:line alternative is local policy, not in L52. Zero-byte reorder: the block stays 4,088 bytes and line 13 295. - SHA256SUMS lists the new block hash; `sha256sum -c SHA256SUMS` passes. - Handbook: the mirrored line follows, and the sources paragraph records the file:line alternative as local policy. It now says the carrier gives no instruction to verify finished work and names no verification skill, since the codebase-memory line still checks caller lists (handbook L264). - Test comment: WITHDRAWN_PHRASES is a literal skill-name check, not a check for every verification wording. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Decision records: keep the manifest prune rule, name confounds and overturn variables Repair round for the verification-line addendum and the skills-trial carrier-condition addendum (findings V-F1, R-F1, R-F3, R-F4, R-F5, R-F6, R-F7, GAP-3, GAP-6, GAP-7). Skills-trial addendum: - The review no longer "replaces" the count-based prune rule. It adds a with/without comparison that varies the builder's preload for the skill's Claude listing; trial.prune_rule (adoption/skills/manifest.json L30) and tools/skill-usage/skill_usage.py L516-538 still apply, and Codex enablement stays under that rule. A disagreement is written into the manifest update the trial window end already requires. - Other sources and role changes: the landscape-sweep templates name both skills from 1b0e459 (templates.json common; build_args.py L59 TEMPLATE_SKILLS), for the Claude workers and the GPT-6 lane; the C0 baseline counts (child-lane baseline README L128-130) match that list without proving cause; #398 (5483412) and #402 (d022295) change the sweep workers' type and model and the builder's model inside C1. - Boundaries: the installer writes no install record (shutil.copy2 at install_claude_profile.py L113, L143 keeps the source mtime), and #381 step 2 freezes hashes, not install times. Verification-line addendum: - The builder runs model: opus, which is Opus 5.5 on this host since September 22 (grand-catalog-handbook.md L242-244), so the Opus 5 advice reaches it through the 5.5 guide's L9; before #402 it ran sonnet. - #381 records hashes, not an install time; a Supersedes note corrects the qmd addendum's L389 wording the same way. - Overturn names what each comparison varies: default-block line 13, a non-Opus child set, the builder line with the preload held on, or a prompting-guide reversal. - Line 13's quote, the local file:line policy, the re-read of every documentation quote at its cited line (2026-09-28 08:55Z), the installed SKILL.md hash check and the control's own returned lines. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Token-lanes record: the no-command-output case needs neither Bash nor ctx_execute security-reviewer has no Bash but runs commands through Context Mode's ctx_execute (Codex review), so the rationale is qualified to children with no command runner. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Evidence manifest: re-register this change's files Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Scout <scout@local> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
adoption/hooks/claude/token-lanes-subagent-start.py(stdlib only, fail-open, always exit 0) and its siblingtoken-lanes-block.md(3,159 bytes, first bytesTOKEN LANES). The hook returns the block asSubagentStarthookSpecificOutput.additionalContextto every subagent whoseagent_typedoes not start withblind-.adoption/templates/claude.settings.template.jsonas its ownSubagentStartgroup (matcher"", timeout 5) beside ai-memory's, and installs both files through the existing sha256-checked guard step (tools/adoption/install_claude_profile.pyHOOKS,adoption/hooks/claude/SHA256SUMS).docs/token-session-handbook.mdgains "Token lanes carried into subagents", the source of truth the block copies line for line, with sources for each line. The RTK line is the measured RTK 0.50.0 rule: a call containing$(...), backticks,<(...), a file redirect or a heredoc is never rewritten;&&chains and multi-line blocks are rewritten segment by segment; in a pipeline only a supported producer feedingcat/head/tailor a finalgrep/rgstage is rewritten, notgh.evidence/artifacts/token-lanes-subagent-start-20260927/(native probe and RTK hook checks, sanitized), decision recorddocs/decisions/2026-09-27-token-lanes-subagent-start.md, three anti-pattern log rows indocs/harness-defaults.md, and bootstrap notes for the guard step and the template.evidence/artifacts/child-lane-baseline-20260926/, local integration) found the routing block in 42/42 Agent-tool child prompts and 0/597 Workflow child prompts, and SubagentStart context in 0/639 children.Verification
Native probe (receipt above; evidence class
local_integration; Claude Code 2.1.283; each run oneclaude -psession in this repository's checkout, main model Opus 5.5, one Haiku 4.5 child launched with the Agent tool; positive runs add a settings file whoseSubagentStartgroup runs this branch's hook, negative runs use the host's live settings, which have no such hook):general-purposeNOT FOUNDgeneral-purposeFOUND,"TOKEN LANES (source: docs/token-session-handbook.md, "Token "(the committed block's exact first 60 characters)hook_additional_contextattachment; hook exit 0, 3,258 bytes of output (the same count recomputed from the committed files)blind-judgeNOT FOUNDgeneral-purposeNOgeneral-purposeNOv1 asked whether a block whose first line starts with
TOKEN LANESwas present. It answeredNOin both arms even though the positive transcript held the block, so v1 did not discriminate; it is kept as a failed design. The likely cause is that Claude Code frames attached context (contextRendering: announced); the child's reasoning was redacted, so that cause is not observed. Provider usage for all five runs, as the CLI reported it:costUSD$1.44; Opus 5.5 input 20, output 2,344, cache read 263,466, cache creation 153,558; Haiku 4.5 input 50, output 4,290, cache read 14,666, cache creation 70,203.RTK 0.50.0 hook checks (receipt, 03:28Z): 17 inputs through
rtk hook checkand through thertk hook claudePreToolUse processor the template runs, with identical results.git status/git diff --staton two lines →rtk git status/rtk git diff --stat;cd /tmp/git status→cd /tmp/rtk git status;git status && git log -n 3→rtk git status && rtk git log -n 3;git diff | head -n 5→rtk git diff | head -n 5;git log -n 20 | grep fix→git log -n 20 | rtk grep fix. Not rewritten:gh pr view 1 | head -n 5,$(...), backticks,<(...),> /tmp/x.txt, a heredoc, a two-line block with$(...)on one line, andecho a/echo b(echohas no RTK rule).Tests (Python 3.13.15,
python -m unittestas CI runs it): the full suite passed on this head, 6,474 tests in 723 s (643 skipped), run with a privateTMPDIRoutside/tmp. An earlier run of the pre-#374 head reported 16 errors and failures, all intests.test_data_lake_backfill. That module refused its temporary directories because/tmphad become a git work tree during the run; the repository was gone afterwards, and another unit's full suite was running on the host at the time. Touched modulestests.test_token_lanes_subagent_start,tests.test_install_claude_profileandtests.test_render_config: 9, 50 and 19 tests, all OK; #374'stests.test_context_mode_practice_docsandtests.test_apply_claude_settingsalso pass (5 and 22).Discriminating controls, each in a throwaway copy:
agentTypefield (1 error). After the review repair, a character-counting budget check fails the new regression test, and a block padded to 3,560 bytes (3,360 characters) fails the byte check; the pre-repair character check passed that block.HOOKSentries (2), without the template's token-lanes group (1), and with a wrong block checksum (2 failures, 2 errors).Cross-family review (GPT-6
gpt-6-astra, effort max, read-only, one round) of the first pushed head85dd27cd: DEFECTS FOUND, one low finding. The text test counted characters against the 3,500-byte budget. It holds, and commit2e17bae6repairs it; the finding table is in a PR comment.Repository checks on this head (replayed onto
6e53809e, after #376, #354 and #374, with main's manifest re-registered for the eight carried files it lists or that are new underevidence/):FAILS=0. It coversscripts/validate.py,scripts/host_receipts.py validate,scripts/release_due.py --strict-if-repinned origin/main, the catalog, foundation, landscape, audit, convergence, verdict, component-matrix, grand-list, gap, ecosystem and evidence-manifest checks, and the workflow sums and node tests.SHA256SUMSpasssha256sum --check --strict.git diff --checkis clean.code.claude.comanchors and all 37 relative links on added lines resolve.Residuals
workflow-subagentchildren.blind-judgecontrol shows that no block reached the blind child, not that the hook ran and skipped; the skip is covered by the subprocess tests.plugin:blind-judgedoes not start withblind-and would receive the block. This repository installs its blind agents as user agents.6e53809e. context-mode alignment: credential twins, order-keeping settings merge and practice docs (fix plan steps 7-8) #374 inserted "Context Mode executor and session store" where this branch inserts "Token lanes carried into subagents"; both are kept, context-mode alignment: credential twins, order-keeping settings merge and practice docs (fix plan steps 7-8) #374's first, and the rest of the handbook is identical tomain. The block's Context Mode line ("explicitly cd to the actual working directory") is compatible with context-mode alignment: credential twins, order-keeping settings merge and practice docs (fix plan steps 7-8) #374's section but less detailed: context-mode alignment: credential twins, order-keeping settings merge and practice docs (fix plan steps 7-8) #374 says to passcwdfor non-shellctx_executecode. Changing the block would change the bytes the native probe ran against, so it is left for a follow-up with a re-probe.v2026.09.26.2lacks the two new files.SOTA sources
agent_typeinput;additionalContextadded to the subagent's context before its first prompt, kept (with the prompt cache) while an earlier copy is in context, and injected again after auto-compaction; plugin-scoped agent types. Add context for Claude: values over 10,000 characters go to a file with a 2,000-character preview.7779afb1: SubagentStart added in 2.0.43; hook output over 10,000 characters saved to a file in 2.1.89; command-type-only SubagentStart hooks in 2.1.142; SubagentStart context kept in a resumed subagent's prompt prefix in 2.1.265.1d87b8e7:src/hooks/decision.rsL86-88 (a call with an unattestable construct is not rewritten),src/discover/registry.rsL951-1013 (rewrite_multiline_block) and L1087-1345 (pipeline stages andrewrite_compound).fc8054eb, which added per-line rewriting of multi-line blocks; both are contained in v0.50.0.589d8214):hooks/hooks.json(no SubagentStart hook),routing.mjsL892 (PreToolUse:Agent),sessionstart.mjsL166.mcp.cL557, jCodeMunch v1.108.319server.py, Serenac6fbd1c5, SocratiCode v1.14.0, QMD v2.8.3, ai-memory v2.4.1, TOON v4.1.1, Headroom v0.37.0.adoption/hooks/claude/effort-default-guard.py,tools/adoption/install_claude_profile.py,docs/decisions/2026-09-23-max-effort-default.md).🤖 Generated with Claude Code