🎯

agent-context-isolation

🎯Skill

from parcadei/continuous-claude-v3

VibeIndex|
What it does

Isolates agent outputs to prevent context pollution by using file-based coordination and background task management.

agent-context-isolation

Installation

Install skill:
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill agent-context-isolation
15
Last UpdatedJan 26, 2026

Skill Details

SKILL.md

Agent Context Isolation

Overview

# Agent Context Isolation

Prevent agent output from polluting the main context window.

Rules

1. Use Background Agents with File-Based Coordination

```

# 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 .claude/cache/agents//.

2. Never Use TaskOutput to Retrieve Results

```

# WRONG - dumps entire transcript (70k+ tokens) into context

TaskOutput(task_id="")

TaskOutput(task_id="", block=true)

# RIGHT - check expected output files

Bash("ls -la .claude/cache/agents//")

Bash("bun test") # verify with tests

```

TaskOutput returns the full agent transcript. Always use file-based coordination instead.

3. Monitor Agent Progress via System Reminders

```

# 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 .claude/cache/agents -name "*.md" -mmin -5

# - Check task output file size growth: wc -c /tmp/claude/.../tasks/.output

```

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

```

Research agent β†’ .claude/cache/agents/oracle/output.md

↓

Plan agent β†’ .claude/cache/agents/plan-agent/output.md (reads research)

↓

Validate agent β†’ .claude/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.

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

More from this repository10

🎯
agentica-claude-proxy🎯Skill

Enables seamless integration between Agentica agents and Claude Code CLI by managing proxy configurations, tool permissions, and response formatting.

🎯
git-commits🎯Skill

Manages git commits by removing Claude attribution, generating reasoning documentation, and ensuring clean commit workflows.

🎯
debug-hooks🎯Skill

Systematically diagnose and resolve hook registration, execution, and output issues in Claude Code projects by checking cache, settings, files, and manual testing.

🎯
migrate🎯Skill

Systematically researches, analyzes, plans, implements, and reviews migrations across frameworks, languages, and infrastructure with minimal risk.

🎯
system-overview🎯Skill

Generates a comprehensive summary of the current system's configuration, components, and key metrics across skills, agents, hooks, and other core systems.

🎯
background-agent-pings🎯Skill

Enables background agent execution with system-triggered progress notifications, avoiding manual polling and context flooding.

🎯
agentica-infrastructure🎯Skill

Provides comprehensive reference and infrastructure for building sophisticated multi-agent coordination patterns and workflows with precise API specifications and tracking mechanisms.

🎯
cli-reference🎯Skill

Provides comprehensive CLI commands and flags for interacting with Claude Code, enabling headless mode, automation, and session management.

🎯
braintrust-tracing🎯Skill

Traces and correlates Claude Code session events across parent and sub-agent interactions using comprehensive Braintrust instrumentation.

🎯
morph-apply🎯Skill

Rapidly edits files using AI-powered Morph Apply API with high accuracy and speed, without requiring full file context.