Repository navigation
Token lanes carrier: fetch routing, intent, executor-backed cwd, loadable lane ids and wrapper exemption - #412
Merged
Conversation
Route evidence pages through ctx_fetch_and_index and ctx_search, expose batched requests/concurrency, and specify ctx_execute intent and shell-only cwd. Preserve verbatim wrapper returns and the unchanged 3,500-byte budget (the revised block is 3,490 bytes). Refresh the installer checksum. Keep the handbook synchronized, append a dated decision addendum, and retain counts-only M4/M3/M5 tables with unchanged .txt copies of both counters. Add failing-first injected-context tests; covering modules run 62 tests, with 3 existing optional PyYAML skips and no failures. Sources: mksglu/context-mode v1.0.169, commit 589d8214d56740a28b5f7bf63167743d586b0b40, src/server.ts L1675-1690, L1728-1740, L1979-1980 and L3423-3478; connected tool schemas; https://code.claude.com/docs/en/tools-reference#webfetch-tool-behavior and https://code.claude.com/docs/en/hooks#subagentstart (Claude 2.1.283). Measurement source: coordinator units/w3/lanes-facts.md (2026-09-27) and the unchanged profile_workflow_tools.py / containment_m3.py counters. No after-change native workflow, provider-usage or savings claim. Content written by GPT-6 (gpt-6-astra, effort max) through the Codex worker lane and the OmniRoute pool; committed by the coordinator harness. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Follow the executor rather than stale schema: non-shell child calls without cwd use the coordinator checkout and writes persist; Rust needs absolute paths. Load exact granted lane ids, keep search limit <=3, and exempt verbatim returns from output routing and footers. Date the false-correction erratum, qualify smoke-2 counts outside #381's M4 population, require per-child tool exposure, and correct counter provenance. Record the 2.1.283 teammate boundary. Carrier: 4,051 bytes, bound 4,100; refresh checksum. Preserve non-blind additionalContext, blind gating and fail-open code. Sources: mksglu/context-mode v1.0.169 at 589d8214d56740a28b5f7bf63167743d586b0b40, src/executor.ts L290-312, hooks/core/routing.mjs L939-941, src/server.ts L1822, L1733-1740, L1979-1980, L3423-3478, src/search/ctx-search-schema.ts L88-94; https://code.claude.com/docs/en/tools-reference#webfetch-tool-behavior, https://code.claude.com/docs/en/mcp#scale-with-mcp-tool-search and https://code.claude.com/docs/en/hooks#subagentstart; native-agent-stack 5f3a7c2 sweep.js L83-87; #381 preregistration and coordinator units/w3/lanes-facts.md / units/w4/e2e-facts.md local observations. Failing-first local controls; covering modules: 64 tests OK (skipped=3). Historical harness evidence is separately attributed in the PR body. No after-repair native workflow, provider usage or savings claim. Content written by GPT-6 (gpt-6-astra, effort max) through the Codex worker lane and the OmniRoute pool; committed by the coordinator harness. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tate the byte-bound rule inline Coordinator corrections after the independent repair verification: the handbook no longer credits the matrix observations with supplying tool ids (they show only the grant boundary), and the decision record states its byte-budget rule instead of citing an unpublished brief. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
Closes the measured gaps in the SubagentStart token-lanes carrier, the block injected into every non-blind subagent.
Compared with main, the carrier now:
ctx_fetch_and_indexandctx_search, and does not use WebFetch for evidence;ctx_fetch_and_indexto the one-call ToolSearch bootstrap, with exact loadable tool ids for each lane a task needs;ctx_execute/ctx_batch_executewithintent, with specificctx_searchqueries (limit <=3);cwdfor every language (src/executor.ts:295-306, Prepare CLOCK-R2 Windows Time changes and boot persistence checks #788);The block grows from 3,159 bytes on main to 4,051 bytes, under a bound raised from 3,500 to 4,100 bytes. The byte itemization under Changes is relative to the intermediate build (3,490 bytes).
Changes
adoption/hooks/claude/token-lanes-block.md: explicit cwd for every languagewith Rust's absolute-path exception; exact task-needed ToolSearch ids and
tool-grant boundaries; specific ctx_search queries with limit <=3; full
wrapper exemption and end-of-return accounting for other agents.
adoption/hooks/claude/SHA256SUMS: refresh the installer digest. The carriermeasures 4,051 UTF-8 bytes under a 4,100-byte bound, up 561 bytes:
316 bootstrap, 122 cwd/Rust, 54 search, 69 wrapper/footer.
docs/token-session-handbook.md: mirror every carrier line and cite itssources; record the dated Claude Code 2.1.283 in-process teammate
HTTP-transport boundary without prescribing a workaround.
docs/decisions/2026-09-27-token-lanes-subagent-start.md: date repair errata,correct the false schema-based correction, justify the budget and require
per-child tool exposure for future routing counts. The original decision
before the measured-gap addendum is unchanged.
evidence/artifacts/token-lanes-subagent-start-20260927/measured-gaps.md:mark 0/15 as M4-style outside PR-H: E2E preregistration for the token-save-practice stack (frozen tasks, metrics, gate, procedure) #381's population, link the preregistration,
correct counter provenance and separately attribute later matrix/smoke-3
observations. The two counter .txt records added by the build, original
counts and historical README/receipt retain their bytes.
tests/test_token_lanes_subagent_start.py: failing-first cwd, wrapper,bootstrap and search controls; preserve UTF-8 budget, blind and fail-open
coverage. Exact additionalContext delivery covers all seven shipped
non-blind roles plus general-purpose, workflow, teammate and unknown roles.
Hook executable, installer implementation and installer tests are unchanged.
The carrier grants no tools and changes no client configuration.
Evidence
export TMPDIR=/var/tmp/claude-lanes,python3 -m unittest tests.test_token_lanes_subagent_start tests.test_install_claude_profilereturned exit 0: Ran 64 tests in 1.023s; OK (skipped=3). All 14 carrier
tests pass; three existing optional PyYAML checks are skipped. The sandbox
refused creation of the requested directory as read-only; Python used
/tmp. These covering modules passed there, not a full-suite run.scope/footer 3, bootstrap 1, search 1; each then passed. The old byte bound
rejected 4,051 bytes; the UTF-8 control now rejects 4,120 against 4,100.
The checksum control failed until its digest was refreshed. These tests
verify delivered instructions, not model compliance.
intent/cwd seven times, wrapper once; covering modules then reported 62 tests
OK, skipped=3. The old cwd assertions encoded the wrong rule and are replaced;
that earlier green run did not verify runtime cwd.
validate.shFAILS=0. The contended full suite ended with 205 failures and 119 errors.
Unit-only failing modules rerun alone with
TMPDIR=/var/tmp: 1,143 testsOK (skipped=66) and an empty rerun failset. The base failed only
tests.test_pre_commit_gate, absent from the unit failset. The reviewerattributed no regression to this unit. These are historical build results,
not a repair validation/full-suite run.
git diff --checkexit 0; all carrier linesmatch the handbook; documentation links resolve. Carrier digest:
2a9bab79fea04ec2c626973428e7db73fad6ace1267e34c2a9553f586e1f8b76.Added-text scan: zero personal paths, emails, UUIDs and bearer values.
Historical receipts, both counters and this repair's evidence manifest are
unchanged. Read-only Python/JavaScript ctx_execute probes with explicit cwd
saw the worktree and carrier, while script files were outside it; persistence
is source-backed, with no write probe.
population, with ctx_fetch_and_index exposure unknown. M3 oversized-byte
shares remain 61.4%, 70.7%, 74.7%; ctx_execute M5-style counts 40/119, 78/214,
16/34; wrapper copy check 2/2. Later peer smoke 3 reported ctx_search 11/20
and ctx_execute 27/52 over 5 KB; it is not an after-measurement of this repair.
The matrix describes exposure on 2.1.283, not general client guarantees.
remain local integration evidence; no native transcripts were synthesized.
distinct from upstream runtime acceptance.
native workflow, installation, provider usage or savings claim.
SOTA sources
Rust L290-292,
handler L1822,
routing.mjs L939-941:
operative cwd (Prepare CLOCK-R2 Windows Time changes and boot persistence checks #788), correcting stale schema text. Installed source was
checked first; release notes were read with
gh api repos/mksglu/context-mode/releases/tags/v1.0.169.intent L1733-1740,
derived answers L1675-1690,
threshold L1979-1980,
ctx_search default 3, L88-94.
MCP tool search
and SubagentStart.
Installed CLI returned 2.1.283. Lane ids use the pinned contracts cited in
the handbook and coordinator ToolSearch matrix observations.
complete stdout unmodified, source of the routing/footer exemption.
evidence/artifacts/token-adoption-e2e-20260926/preregistration.json,thresholds.M4: stack-researcher/Codex B, routed rate >=0.9. Coordinator
units/w3/lanes-facts.md,units/w4/e2e-facts.md, the independent reviewand retained counters provide attributed local measurements.
tools/adoption/install_claude_profile.pyand tests supply thechecksum/install path;
docs/lanes.mdsupplies the registration-only lanerule. No new runtime or installation mechanism is introduced.
Review dispositions
All six findings are accepted; none is disputed.
checksum and measured budget.
warning for non-shell child calls without cwd.
harness results, accurate registration status. Corrected commit-build.txt
and supplied commit-repair.txt; no Git history rewritten.
position, sweep.js citation and tests.
child's exposure to both fetch tools. Only confirmed ctx_fetch_and_index
exposure contributes to the routing denominator; absent/unknown is separate.
later ctxSrch edit; both counter copies preserved.
A1-A4 are incorporated: exact lane ids, specific queries with limit <=3, dated
teammate boundary, and unchanged non-blind context injection.
Residuals and not done
Coordinator acceptance at the replayed head (local integration, this host):
validate.shFAILS=0 after the replay onto main.python3 -m unittest tests.test_token_lanes_subagent_start tests.test_install_claude_profile tests.test_adaptive_paper_metrics tests.test_secret_path_guardran 126 tests OK (skipped=3). The replay resolvedadoption/hooks/claude/SHA256SUMSby recomputing every entry from the files;sha256sum -cpasses. The re-registration is limited to this branch's own files.Cross-unit residual: once the measure unit (PR-A) lands, the decision addendum should name this unit's figures after their counters (for example "fetch-tool share", "results over 5 KB") and state that PR-H: E2E preregistration for the token-save-practice stack (frozen tasks, metrics, gate, procedure) #381's overturn gate uses PR-A's published M3/M4/M5 definitions, not these scratch counts.
The branch's first commit message still says "shell-only cwd" and "unchanged 3,500-byte budget". The squash-merge subject and body use this PR's text instead.
Re-measure routing/containment on the next sweep and coordinator waves with
per-child exposure and population boundaries; smoke 2 cannot retroactively
supply an access-qualified compliance baseline.
Private transcripts and original counter argv/timing/exit records and stdout
were not supplied; retained methods and tables do not independently reproduce
historical counts.
No after-repair model run or live installation. Three PyYAML skips and the
requested-TMPDIR sandbox restriction remain recorded.
Coordinator owns committing, evidence registration, generated reports,
validate.sh and full-suite acceptance. Builder left manifests/evidence.json
unchanged and ran no prohibited Git/report-writing operations.
The existing plugin-scoped blind-role caveat is unchanged.
Recommended lane label: lane:foundation. The coordinator's reviewed final
the branch's last commit changes manifests/evidence.json only by re-registering this branch's own files;
docs/lanes.md L147-148 keeps that work in foundation. This repair checkout starts
at
67f4a88fand leaves the next registration to the harness.Token tools: context-mode processing and indexed source fetches/searches; RTK
for commands and rtk proxy for exact blobs. No compression or savings claim.
🤖 Generated with Claude Code