agent-context-isolation — скилл для Claude Code: изоляция контекста
Скилл agent-context-isolation для Claude Code учит передавать работу фоновых агентов через файлы. Он помогает не загружать их полные транскрипты в основной контекст.
MIT ★ 3 951 обновлён 2026-01-26
npx skills add parcadei/Continuous-Claude-v3 --skill agent-context-isolation -a claude-codeЧто делает agent-context-isolation
Скилл задаёт файловый способ координации фоновых агентов: каждый записывает результат в файл, а следующий читает этот файл. Для промежуточных результатов используются каталоги .claude/cache/agents/; за ходом работы следят по системным напоминаниям и появлению файлов, а не через TaskOutput.
После работы агента скилл предлагает запускать bun test и проверять результат по тестам. В примере конвейера исследование, планирование и проверка передаются между агентами через отдельные файлы, а реализация читает проверенный план. Команда TaskOutput возвращает полный транскрипт агента и может занять контекст основного диалога.
Какие задачи решает
- передать результаты фонового агента через файл
- не загружать полный транскрипт агента в основной контекст
- связать этапы исследования, планирования и реализации файлами
- проверить работу агента запуском тестов
Примеры запросов агенту
- Передай исследование фоновому агенту и сохрани результат в файл.
- Организуй планирование и проверку так, чтобы каждый агент читал файл предыдущего.
- Проверь результат работы агента с помощью
bun test, не загружая его транскрипт.
Как установить agent-context-isolation
1Через Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill agent-context-isolation -a claude-code2Вручную: положить файлы
~/.claude/skills/agent-context-isolation/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/agent-context-isolation/
1Через Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill agent-context-isolation -a codex2Вручную: положить файлы
.agents/skills/agent-context-isolation/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill agent-context-isolation -a cursor2Вручную: положить файлы
.cursor/skills/agent-context-isolation/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install parcadei/Continuous-Claude-v3 .claude/skills/agent-context-isolation2Вручную: положить файлы
.github/skills/agent-context-isolation/SKILL.md1Через Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill agent-context-isolation -a gemini-cli2Командой платформы
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/agent-context-isolationВручную: положить файлы
.devin/skills/agent-context-isolation/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы об agent-context-isolation
Как установить agent-context-isolation в Claude Code?
Выполни npx skills add parcadei/Continuous-Claude-v3 --skill agent-context-isolation -a claude-code. Файл скилла устанавливается по пути ~/.claude/skills/agent-context-isolation/SKILL.md.
Что делает agent-context-isolation?
Он задаёт правила координации фоновых агентов через файлы вместо передачи полных транскриптов в основной контекст. Также предлагает проверять результат запуском bun test.
Почему скилл не рекомендует использовать TaskOutput?
TaskOutput возвращает полный транскрипт агента. Его чтение может заполнить основной контекст и вытеснить сведения о первоначальном запросе.
Исходный текст
SKILL.md · MIT
---
name: agent-context-isolation
description: Agent Context Isolation
user-invocable: false
---
# 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
© parcadei · MIT · parcadei/Continuous-Claude-v3