Skip to content

chore(agents): cap the root agents file with a byte budget - #123371

Closed
gantoine wants to merge 1 commit into
stack/slim-root-agentsfrom
chore/agents-md-size-budget
Closed

gantoine wants to merge 1 commit into
stack/slim-root-agentsfrom
chore/agents-md-size-budget

Conversation

@gantoine

Copy link
Copy Markdown
Member

Problem

Changes

  • A new repo invariant, test_agents_md_size_budget.py, fails when the root AGENTS.md exceeds 23,000 bytes.
  • The budget leaves about 500 bytes of headroom over the size after chore(agents): move topic rules out of the root agents file #123122, enough for a small edit but not a new section.
  • The failure message says what to do instead: move the rule to a .agents/ guide or a skill, or cut an older line.
  • The budget counts bytes, not lines. The file uses semantic line breaks, so line count tracks sentences, not tokens.
  • /editing-agents-md now names the test, replaces the 200-line target with it, and asks for a reason in the PR before anyone raises the budget.
  • The repo_invariants CI filter already matches AGENTS.md, so an edit to the file runs the test.

Note

Stacked on #123122. That PR comes from a fork, so its head sits in this repo as stack/slim-root-agents to give this PR a clean diff. Retarget to master once #123122 merges.

How did you test this code?

Test rationale: the new test catches the root file growing past its budget. No existing test checks the size. The tag invariant checks only the content.

  • The test passes on this branch at 22,490 bytes.
  • With the budget lowered to 22,000, it fails with the message above.

Release status

  • No feature flag controls this change

Docs update

None. The /editing-agents-md skill carries the budget rule.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code, Claude Opus 5.5 (claude-opus-5-5)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gantoine gantoine self-assigned this Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🤖 CI report

🚨 Trunk lane — universal lane

This PR is assigned to the universal lane. It cannot merge in parallel with other PRs, so it can take longer to merge. Ask dev-ex if you think this is wrong.

✅ Duplication (Python) — clean

New Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

✅ Duplication (TypeScript) — clean

New TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying.

@gantoine gantoine closed this Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant