본문으로 건너뛰기
cccskills
무료GitHub에 공개

agent-context-isolation

Agent Context Isolation

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md2.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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/<agent-type>/.

2. Never Use TaskOutput to Retrieve Results

# 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 .claude/cache/agents/<agent-type>/")
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/<id>.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

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Agent Orchestration Rules

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

parcadei/Continuous-Claude-v33.9천2026년 1월 27일 업데이트

Agentic Workflow Pattern

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

parcadei/Continuous-Claude-v33.9천2026년 1월 27일 업데이트

Guide for integrating Agentica SDK with Claude Code CLI proxy

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

parcadei/Continuous-Claude-v33.9천2026년 1월 27일 업데이트

Reference guide for Agentica multi-agent infrastructure APIs

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

parcadei/Continuous-Claude-v33.9천2026년 1월 27일 업데이트

Write reliable prompts for Agentica/REPL agents that avoid LLM instruction ambiguity

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

parcadei/Continuous-Claude-v33.9천2026년 1월 27일 업데이트

Build Python agents with Agentica SDK - @agentic decorator, spawn(), persistence, MCP integration

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

parcadei/Continuous-Claude-v33.9천2026년 1월 27일 업데이트

parcadei의 스킬 모두 보기

이 스킬의 문제 신고