Skip to content

AGENTS.md: scope trading-lane wave rules, drop planning prose and a migration-relative clause (prompt audit) - #499

Merged
seathatflowsinourveins merged 2 commits into
mainfrom
claude/prompt-audit-20260929
Sep 29, 2026
Merged

seathatflowsinourveins merged 2 commits into
mainfrom
claude/prompt-audit-20260929

Conversation

@seathatflowsinourveins

@seathatflowsinourveins seathatflowsinourveins commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

  • What this PR changes: three prompt-fit edits from a prompt audit of the repository instruction surface. It drops planning prose and one migration-relative clause, and moves the trading-lane wave rules (2,647 bytes, unchanged) out of the always-loaded root AGENTS.md into a path-scoped blueprints/us-equities/AGENTS.md, leaving one pointer line. Root AGENTS.md goes from 13,862 to 11,450 bytes (about 0.6K tokens, estimated at 4 bytes per token, not tokenizer-counted). Agents that set omitClaudeMd never loaded the root file, and a session that reads files under blueprints/us-equities/ loads the nested file again, so the saving is for sessions and children that do not touch that directory.
  • Base commit: cf2960a7 (AGENTS.md is unchanged between it and origin/main 9ad7bebe).
  • Lane: lane:shared. AGENTS.md is a shared hot file and blueprints/us-equities/ is trading-lane owned. The trading lane acknowledged head 715e043c in a comment on this PR (2026-09-29 06:18Z); ecosystem-roadmap-2026 holds the lane per docs/decisions/2026-09-28-ecosystem-roadmap.md:319 at origin/main. The head then changed after an independent review (pointer wording, one restored sentence, the nested file's header, hash registration and a decision-record addendum), so a fresh acknowledgement of the new head is requested before merge.
  • Owned paths touched: AGENTS.md, examples/claude-native/CLAUDE.md, blueprints/us-equities/AGENTS.md (new), blueprints/us-equities/CLAUDE.md (new, @AGENTS.md import stub), docs/decisions/2026-09-26-harness-rules-cleanup.md (addendum), manifests/evidence.json (hash registration only).

SOTA sources

  • Claude Code memory docs, "How Claude remembers your project" (https://code.claude.com/docs/en/memory, fetched 2026-09-29, Claude Code 2.1.284): "Files in subdirectories load on demand when Claude reads files in those directories" is the scoping this PR uses. "CLAUDE.md files are loaded into the context window at the start of every session, consuming tokens alongside your conversation" and "target under 200 lines per CLAUDE.md file" are the size guidance.
  • Anthropic claude-api skill, prompt-audit guide (shared/prompt-audit.md, bundled with Claude Code 2.1.284; a public mirror was not verified, the bundled copy was read in full): Group 1b "plan before acting" prose is deleted because current models plan unprompted; Group 1d flags migration-relative phrasing such as "no longer"; Group 2 states that size in an instruction file is a tax paid on every load.
  • Codex AGENTS.md discovery, as recorded from the fetched Codex docs in docs/decisions/2026-09-26-harness-rules-cleanup.md:42: Codex reads the Codex-home file and the project root-to-working-directory chain.
  • Repository precedent: blueprints/convergence-practice/application-delivery/AGENTS.md plus its CLAUDE.md import stub (the same nested-file pattern).

Evidence-class table

Claim Evidence class Command / receipt
The moved text is byte-identical (2,647 bytes) to the block in origin/main:AGENTS.md, and the root shrinks by 2,412 bytes local_integration script comparing the origin/main block with the nested file's body: True
Claude Code 2.1.284 loads both new files when a session reads a file under blueprints/us-equities/ local_integration (one headless run; the observation is in the session transcript, not a committed receipt) claude -p "Read the file blueprints/us-equities/north-star.md ..." --model haiku from the repo root, exit 0; the transcript holds two nested_memory attachments: blueprints/us-equities/CLAUDE.md and blueprints/us-equities/AGENTS.md (3,185 bytes)
Blind exports replace instruction files at any depth, so the new files do not reach blind lanes local_integration, source_review TMPDIR=/dev/shm/pra-tests python3 -m unittest tests.test_blind_checkout: 40 tests OK on this branch and on origin/main; tools/sota-convergence/blind_checkout.py:877-889
The 11 test_blind_checkout errors seen with the default TMPDIR are environmental, not caused by this change local_integration same command without TMPDIR: 11 errors with the same names on this branch and on origin/main, each --export ... is inside the git repository /tmp (a stray /tmp/.git on this host)
No test, workflow or script asserts a changed sentence, and the tests that read these files pass local_integration, source_review git grep -F on each removed string matches only AGENTS.md, decision records and the historical artifact evidence/artifacts/native-claude-profile-20260920/instructions-after.md:3; unittest tests.test_adoption_docs_consistency tests.test_install_claude_profile tests.test_runtime_worker_skills: 122 tests OK (4 skipped); node examples/claude-native/workflows/test-envelope.mjs: passed=254 failed=0
scripts/validate.py passes with the re-registered hashes local_integration exit 0, "status": "passed" (69 components, 8065 hashed files)

Local commands run

$ python3 scripts/validate.py
exit 0  {"components": 69, "hashed_files": 8065, "profiles": 4, "receipts": 169, "status": "passed"}
$ python3 -m unittest tests.test_adoption_docs_consistency tests.test_install_claude_profile tests.test_runtime_worker_skills
Ran 122 tests ... OK (skipped=4)
$ (cd examples/claude-native/workflows && node test-envelope.mjs)
exit 0  SUMMARY passed=254 failed=0 total=254
$ TMPDIR=/dev/shm/pra-tests python3 -m unittest tests.test_blind_checkout
Ran 40 tests ... OK   (same on origin/main)
$ python3 -m unittest tests.test_blind_checkout          # default TMPDIR
FAILED (errors=11)   (identical names on origin/main; each: --export is inside the git repository /tmp)
$ python3 -m unittest tests.test_osv_lockfile_coverage.LockfileInventoryTests.test_every_tracked_lockfile_and_manifest_is_listed tests.test_blind_checkout.RepositoryClassificationTests.test_every_blueprint_value_under_a_label_key_is_classified tests.test_workflow_security_coverage.NewWorkflowSecurityCoverageTests.test_all_published_workflows_are_listed_and_covered
Ran 3 tests ... OK

Decision record

docs/decisions/2026-09-26-harness-rules-cleanup.md, "Addendum (2026-09-29)": it amends the scope sentence "AGENTS.md keeps trading-only rules under Trading north star", records the loading behaviour of Claude Code and Codex, the acknowledgement, and what would move the paragraphs back (a moved rule missed at the point of use, or a client release that changes nested loading). The audit target was Claude Opus 5.5 for role agents and workflow stages and Claude Sonnet 5.5 for the running coordinator. Findings this PR does not act on:

  • flag (Codex): a Codex session started at the repository root sees only the pointer line, not the moved text; the line says to read the file before a trading research wave, experiment, data acquisition, strategy-gate change or decision-array registration. A trading session that must have the rules at start can open with the directory as its working directory.
  • flag: whether omitClaudeMd also suppresses a nested load is not established. The host ~/.claude/CLAUDE.md still carries the pre-edit "Use a short plan" sentence until the profile sync runs after merge and outside any Gate A window.
  • flag: root AGENTS.md, examples/claude-native/CLAUDE.md and the global instructions still carry the same "Top rule" paragraph in slightly different words. They agree, so this is working redundancy and is left alone.
  • flag (frozen for Gate A, owner native-agent-stack-2d): the default ToolSearch select: list in adoption/hooks/claude/token-lanes-block.md loads serena in every child. The exact-command-shapes rule in the stack-researcher, stack-verifier and source-scout bodies omits jq and the cd builtin that the carrier and the Codex template list.
  • flag: evidence-reviewer and security-reviewer have identical 20-tool grants and near-duplicate lane paragraphs; they differ in task focus and one skill preload, so this is left as a roster question.

Host evidence

Not applicable (no evidence/hosts/ files).

Checklist

  • New/changed GitHub Actions are pinned to a full commit SHA with a version comment (none changed).
  • New/changed workflows declare top-level permissions: contents: read (none changed).
  • No secrets are printed, logged or committed; no new required secret was added.
  • No new paid hosting, subscription or billing surface was introduced.
  • Peer-owned untracked files and worktrees were preserved.

🤖 Generated with Claude Code

… a migration-relative clause

Prompt audit of the repository instruction surface (Claude Code 2.1.284 claude-api prompt-audit
guide, target Opus 5.5 / Sonnet 5.5). Three edits, one finding each:
- AGENTS.md line 15 and examples/claude-native/CLAUDE.md line 18: drop "Use a short (internal) plan"
  (planning prose the target models do not need); keep the no-intake, no-approval-gate constraint.
- AGENTS.md line 35: "no longer turns its workflow orchestration off" -> "keeps its workflow
  orchestration on" (state the current rule, not a diff against an older prompt).
- AGENTS.md lines 66-103: the trading-lane wave rules move verbatim to blueprints/us-equities/AGENTS.md
  (with the CLAUDE.md import stub already used by blueprints/convergence-practice/application-delivery),
  so foundation sessions and every subagent stop loading 2.2 KB of lane-specific text on every call.

Hashes re-registered per docs/lanes.md hot-file protocol.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@seathatflowsinourveins seathatflowsinourveins added the lane:shared Touches files owned by both lanes; needs both lanes' acknowledgement label Sep 29, 2026
@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Trading lane acknowledgement (docs/lanes.md:149-150). Reviewed at head 715e043c by ecosystem-roadmap-2026, which holds the trading lane.

  • What moves: only the wave-specific research, data-readiness and experiment paragraphs. The trading north-star paragraph, including the paper-lane authorization and the docs/paper-lane-policy.md pointer, stays at the root.
  • How the moved text loads: blueprints/us-equities/CLAUDE.md imports @AGENTS.md, so Claude Code loads it when a session reads files under that subtree, per the official memory docs on nested CLAUDE.md files. Codex loads a nested AGENTS.md only when its working directory is inside blueprints/us-equities/. Codex workers started at the repository root therefore rely on the new root pointer line; this lane's briefs will name that file explicitly.

No objection.

Restore the unscoped ban on intake, repeated approvals, diagnostic campaigns and restarts in
examples/claude-native/CLAUDE.md (the first edit had scoped it to bounded work). Widen the root
pointer to name every trigger the moved block covers, replace the nested file's migration-relative
header with a state description, register the two new files in manifests/evidence.json, and add an
addendum to the 2026-09-26 harness-rules record that amends its scope sentence and states how
Claude Code and Codex load the nested file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@seathatflowsinourveins

Copy link
Copy Markdown
Collaborator Author

Trading lane re-acknowledgement at head 26e15b0f (ecosystem-roadmap-2026).

  • Pointer: the broadened root pointer now covers research waves, experiments, data acquisition, strategy-gate changes and decision-array registration. That matches the moved text.
  • Root text: the north-star paragraph and paper-lane authorization are still unmoved.
  • Loading: the headless Claude Code 2.1.284 nested-memory evidence is noted. Codex workers at the root still see only the pointer, and this lane's briefs name the file explicitly.

No objection.

@seathatflowsinourveins
seathatflowsinourveins merged commit bbc34ac into main Sep 29, 2026
25 of 30 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/prompt-audit-20260929 branch September 29, 2026 08:00
seathatflowsinourveins pushed a commit that referenced this pull request Sep 29, 2026
…er the delta review

The dollar breakdown counted claude-sonnet-5-5's unsplit cache writes twice. The receipt now reconciles
dollars per model (data.reconciliation.cost_usd.by_model: Fable, Haiku and the scan agree with ccusage
to the cent; the gap is claude-sonnet-5-5 unpriced by ccusage, claude-opus-4-8 priced only by ccusage and
the unsplit writes of the other models, with a residual of about a dollar). The cache-creation limitation
states both the field difference and the clamped remainder, the artifact's docstring no longer credits the
merge rule to ccusage's loader, commands are recorded consistently with the snapshot directory, the
session-view percentile method is stated, and the decision record words the advisor switch as an absence
result and refers to #499 as merged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
seathatflowsinourveins added a commit that referenced this pull request Sep 29, 2026
…eipt, run-shape section and decision record (#500)

* Spend attribution 2026-09-29: count-only scan, ccusage-reconciled receipt, run-shape section and decision record

Adds evidence/artifacts/claude-spend-scan.py.txt (a portable count-only scan of Claude Code
transcripts: one row per message.id with the per-field maximum, advisor iterations from
usage.iterations, list-price cost by class and model, child length and agent-type mix, session-tree
concentration, effort, context bins, cache misses and tool invocations, with a synthetic control that
runs one mutant per counting rule), tests/test_claude_spend_scan.py, and the receipt
claude-spend-attribution-20260929, whose token totals match ccusage 20.0.26 within 0.001% on a shared
copy of the transcript tree. docs/token-practice.md gains a "Run shape and accounting" section and
docs/decisions/2026-09-29-token-spend-attribution.md records the decisions (effort max and the
advisor stay by the user's answers; the subagent cache TTL stays by the receipt's arithmetic), the
practice status and the levers by owner.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Spend attribution: fix the unsplit-write double count and wording after the delta review

The dollar breakdown counted claude-sonnet-5-5's unsplit cache writes twice. The receipt now reconciles
dollars per model (data.reconciliation.cost_usd.by_model: Fable, Haiku and the scan agree with ccusage
to the cent; the gap is claude-sonnet-5-5 unpriced by ccusage, claude-opus-4-8 priced only by ccusage and
the unsplit writes of the other models, with a residual of about a dollar). The cache-creation limitation
states both the field difference and the clamped remainder, the artifact's docstring no longer credits the
merge rule to ccusage's loader, commands are recorded consistently with the snapshot directory, the
session-view percentile method is stated, and the decision record words the advisor switch as an absence
result and refers to #499 as merged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Scout <scout@local>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:shared Touches files owned by both lanes; needs both lanes' acknowledgement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant