You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
decisions.md has ballooned to 298KB (~80K tokens) — that's 40% of a 200K context window consumed on every agent spawn. Combined with squad.agent.md growth (29K tokens) and agent histories (~47K tokens), each agent spawn now costs 82-93K tokens (41-46% of context). This leaves agents working with barely half a context window.
Root Causes
decisions.md bloat — 266 blocks, 131 of which are sub-section fragments from old analysis docs. No pruning/archival mechanism exists (unlike history.md which has Scribe summarization). Most blocks are stale sprint artifacts from v0.3.0 planning.
squad.agent.md spawn template duplication — Three near-identical spawn templates (background, sync, generic) at lines 592-809, each ~1,800 tokens. They differ only in mode/description examples and placeholder names.
Init Mode dead weight — Init Mode (lines 28-112, ~1,471 tokens) is loaded on every message but only used once per repo lifetime (when .ai-team/team.md doesn't exist).
Solution
Immediate (this issue — v0.4.0)
Prune decisions.md: Manual pass — keep ~30-40 active decisions, archive rest to decisions-archive.md. Target: 298KB → ~50KB (~13K tokens)
Dedup spawn templates: Collapse 3 templates into 1 generic template with mode as a variable. Save ~3,600 tokens
Activity
feat: context window optimization — decisions pruning, template dedup…
bradygaster commentedon Feb 13, 2026
Shipped in b5aa6c1.
Results:
173 archived decisions preserved in decisions-archive.md. Memory doc updated. README budget table updated.
docs(nap): add archiveDecisions() contract comment (closes #37) (#648)
feat(piece-37): repair dogfood-surfaced defects and publish-model fixes
feat(piece-37): repair dogfood-surfaced defects and publish-model fixes
docs(e2e): record E4 agent-binding verification result
docs(e2e): record E4 agent-binding verification result (PASS, n=1) (#…