Skip to content

Comments

frontend: optimize Claude context files and add legacy import linter warnings#2227

Merged
weeco merged 1 commit intomasterfrom
ms/optimize-claude-context
Feb 17, 2026
Merged

frontend: optimize Claude context files and add legacy import linter warnings#2227
weeco merged 1 commit intomasterfrom
ms/optimize-claude-context

Conversation

@weeco
Copy link
Contributor

@weeco weeco commented Feb 17, 2026

Motivation

Two recent papers show that bloated context files hurt agent performance:

  • Evaluating AGENTS.md: Context files reduce task success rates and increase inference cost 20%+. Extraneous specifications cause counterproductive exploration — agents waste time following irrelevant instructions instead of solving the task.
  • SkillsBench: Focused skill modules (2-3 components) outperform comprehensive documentation. 19 of 84 tasks showed negative performance with skills. Self-generated skills provide zero net benefit.

Key takeaway: every line in a context file should pass the test "would removing this cause Claude to make mistakes?" — if not, cut it. And never send an LLM to do a linter's job.

Changes

  • Trim context: AGENTS.md 86→47 lines, e2e-tester SKILL.md 725→80 lines, form-refactorer 252→77 lines
  • Split oversized skills: e2e-tester → focused entrypoint + 3 reference files
  • Delete/merge redundant rules: 15 rules removed (basic JS patterns, linter-enforced, merged overlaps)
  • Delegate to Biome: legacy import bans → noRestrictedImports warnings in biome.jsonc
  • Fix factual errors: wrong utility name in zustand-persist rule, Next.js assumptions in Rsbuild project
  • Add auto-loading rule: .claude/rules/test-unit-vs-integration.md with paths frontmatter
  • Remove inert globs: skill rules don't support glob-based auto-loading, removed from all 18 files

Net: -880 lines, 37 files changed.

…nings

Trim AGENTS.md, split oversized SKILL.md files into focused entrypoints
with reference files, and delete/merge redundant rules.

- AGENTS.md: 86 → 47 lines (remove discoverable patterns, add verify cmd)
- e2e-tester SKILL.md: 725 → 80 lines (split into 3 reference files)
- form-refactorer SKILL.md: 252 → 77 lines
- Delete 15 rules (basic JS, linter-enforced, merged overlaps)
- Fix factual errors (wrong utility names, Next.js assumptions)
- Remove inert `globs` from skill rules (not supported there)
- Add .claude/rules/test-unit-vs-integration.md (paths auto-loading)
- Add noRestrictedImports warnings to biome.jsonc for legacy packages
@weeco weeco force-pushed the ms/optimize-claude-context branch from 898ce10 to 62b71c3 Compare February 17, 2026 17:02
@weeco weeco merged commit bd19acb into master Feb 17, 2026
21 of 24 checks passed
@weeco weeco deleted the ms/optimize-claude-context branch February 17, 2026 19:13
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.

2 participants