agent-context-isolation
Agent Context Isolation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Agent Context Isolation
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Maestro spec-driven development for Claude Code. Load this skill when invoking Maestro commands so workflows stay aligned with LeIndex and the Rust TUI.
Maestro spec-driven development for Gemini CLI. Load this skill when invoking Maestro commands so workflows stay aligned with LeIndex and the Rust TUI.
Maestro spec-driven development for Amp CLI. Load this skill when invoking Maestro commands so workflows stay aligned with LeIndex and the Rust TUI.
Show users how Maestro works - the opinionated setup with hooks, memory, and coordination
Full 5-layer analysis of a specific function for debugging or deep understanding
Get a token-efficient overview of any project using the TLDR stack
| name | agent-context-isolation |
| description | Agent Context Isolation |
| user-invocable | false |
Prevent agent output from polluting the main context window.
# RIGHT - background agent writes to file, main reads file
Task(subagent_type="...", run_in_background=true, prompt="... Output to: /path/to/file.md")
# WRONG - foreground agent dumps full transcript into main context
Task(subagent_type="...", run_in_background=false)
Background agents with run_in_background=true isolate their context. Have them write results to files in .maestro/cache/agents/<agent-type>/.
# WRONG - dumps entire transcript (70k+ tokens) into context
TaskOutput(task_id="<id>")
TaskOutput(task_id="<id>", block=true)
# RIGHT - check expected output files
Bash("ls -la .maestro/cache/agents/<agent-type>/")
Bash("bun test") # verify with tests
TaskOutput returns the full agent transcript. Always use file-based coordination instead.
# System reminders come automatically:
# "Agent a42a16e progress: 6 new tools used, 88914 new tokens"
# To detect completion:
# - Watch for progress reminders to stop arriving
# - Poll for expected output files: find .maestro/cache/agents -name "*.md" -mmin -5
# - Check task output file size growth: wc -c /tmp/claude/.../tasks/<id>.output
Stuck agent detection:
After agent work:
bun testResearch agent → .maestro/cache/agents/planner/output.md
↓
Plan agent → .maestro/cache/agents/plan-agent/output.md (reads research)
↓
Validate agent → .maestro/cache/agents/validate-agent/output.md (reads plan)
↓
Implement agent → src/module.ts (reads validated plan)
Each agent reads the previous agent's file output, not TaskOutput.
Agent context isolation preserves the main conversation's context budget. Reading agent outputs via TaskOutput floods context, causing: