agent-context-isolation

Agent Context Isolation

By parcadei · 509 installs

npx skills add parcadei/continuous-claude-v3 --skill agent-context-isolation

Source repository · Upstream listing

Agent Context Isolation Prevent agent output from polluting the main context window. Rules 1. Use Background Agents with File Based Coordination Background agents with run in background=true isolate their context. Have them write results to files in .claude/cache/agents/<agent type / . 2. Never Use TaskOutput to Retrieve Results TaskOutput returns the full agent transcript. Always use file based coordination instead. 3. Monitor Agent Progress via System Reminders Stuck agent detection: 1. Progress reminders stop arriving 2. Task output file size stops growing 3. Expected output file not created after reasonable time 4. Verify with Tests, Not Output After agent work: 1. Run the test suite directly: bun test 2. Report pass/fail counts 3. Only investigate failures if tests fail 5. File Based Agent Pipeline Pattern Each agent reads the previous agent's file output, not TaskOutput. Why This Matters Agent context isolation preserves the main conversation's context budget. Reading agent outputs via TaskOutput floods context, causing: Mid conversation compaction Lost context about user's original request Repeated explanations needed Source Session where TaskOutput flooded 70k+ tokens into main context Session 2026 01 01: Successfully used background agents with file based coordination for SDK Phase 3