perf: context window protection — reduce overhead and add agent guardrails#3
Merged
psklarkins merged 8 commits intomainfrom Feb 14, 2026
Merged
Conversation
Design to reduce main context consumption from 70-103k tokens (35-52%) to 25-40k tokens (13-20%) before implementation starts. Three priority tiers: - P1: Remove always-loaded design @imports, deduplicate AGENTS.md (~17k saved) - P2: Delegate brainstorming context gathering, writing-plans, and spec writing to subagents instead of running in main context (~18-45k saved) - P3: Add context budget guardrails to all 30 agent definitions, with specific limits for 7 high-risk agents 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
12 tasks across 2 repos (amplifier + superpowers), 3 priority tiers: - P1 (Tasks 1-3): Remove design @imports, deduplicate AGENTS.md, archive DISCOVERIES - P2 (Tasks 4-7): Context scout subagent, delegate spec/plan writing, output discipline - P3 (Tasks 8-10): Universal context budget for 30 agents, specific limits for 7 high-risk - Verification (Tasks 11-12): Token savings, skill changes, agent guardrails, cleanup Also aligned spec subagent_type references with 449100e pattern (general-purpose). 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Design files (DESIGN-PHILOSOPHY, DESIGN-PRINCIPLES, DESIGN-FRAMEWORK, DESIGN-VISION) are now loaded on demand by design agents only. Saves ~14,000 tokens per session for non-design tasks. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Implementation Philosophy and Modular Design Philosophy sections were duplicated from ai_context/ files already loaded via CLAUDE.md @imports. Replaced with references. Saves ~2,000 tokens per session. Reduced file from 757 to 424 lines. All other sections preserved: - Git commit message guidelines - Sub-agent strategy - Incremental processing pattern - Partial failure handling - Decision tracking system - Configuration management - Response authenticity guidelines - Zero-BS principle - Build/test/lint commands - Code style and formatting - Dev environment tips - Testing instructions - Documentation guidelines 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Moved DevContainer Setup, pnpm Global Bin, and OneDrive/Cloud Sync entries to DISCOVERIES-archive.md. Kept Tool Generation Patterns and LLM Response Handling (still actively relevant). Saves ~1,000 tokens. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Every agent now has file read limits (max 15), output size targets (max 300 lines), stop conditions (10 reads without progress), and no-replan instructions. Prevents agent context window exhaustion. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
content-researcher: max 20 scan, 5 deep-read analysis-engine: mode-specific caps (30/3/5) bug-hunter: 10 reads before hypothesis, 3 cycles max security-guardian: require explicit scope, no unbounded scans post-task-cleanup: summary review for >15 file changesets amplifier-cli-architect: lazy-load references modular-builder: return paths+summaries for large files 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
…loading Design agents now read DESIGN-PHILOSOPHY, DESIGN-PRINCIPLES, DESIGN-FRAMEWORK, and DESIGN-VISION on demand. These files were removed from the always-loaded @import chain in Task 1 to save ~14,000 tokens per non-design session. 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
psklarkins
pushed a commit
that referenced
this pull request
Feb 24, 2026
…subagents' (#3) from feature/readonly-research-agents into main
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
Impact: Active @import chain reduced from ~21,200 words to 6,933 words (68% reduction). All agents now have context budget guardrails.
Test plan
🤖 Generated with Claude Code