agent-context-isolation

agent-context-isolation is a skill for Claude Code, Codex from vibeeval/vibecosystem. It costs 8 tokens per session (627 once invoked), scanned B, a copy of agent-context-isolation, MIT.

A practice for keeping background agent results out of the main conversation by having them write their findings to files. This preserves the main context for the primary task.

In plain words
What is it for?
Running background agents, storing their results in coordination files, and checking those files instead of loading full transcripts.
Why use it?
Long agent transcripts can fill the available context and make the main task harder to follow.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/vibeeval/vibecosystem/agent-context-isolation
Any agent
npx skills add vibeeval/vibecosystem --skill agent-context-isolation
Clone the repo
git clone --depth 1 https://github.com/vibeeval/vibecosystem

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-context-isolation

README.md
[![agentmods](https://agentmods.dev/badge/skills/vibeeval/vibecosystem/agent-context-isolation.svg)](https://agentmods.dev/skills/vibeeval/vibecosystem/agent-context-isolation)
Your own site
<a href="https://agentmods.dev/skills/vibeeval/vibecosystem/agent-context-isolation"><img src="https://agentmods.dev/badge/skills/vibeeval/vibecosystem/agent-context-isolation.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 627 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.00627
Opus 5 $0.00004 $0.00313
Sonnet 5 $0.00002 $0.00125
Haiku 4.5 $0.00001 $0.00063

Measured yesterday against content hash c48d6344bc44, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

agent-context-isolation scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

# - Poll for expected output files: find .claude/cache/agents -name "*.md" -mmin -5
Origin

This is a copy

100% identical to agent-context-isolation — 162 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/agent-context-isolation/SKILL.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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)

Read the full file on GitHub · 82 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 82 lines · 8 tokens per session scan B c48d6344bc44

Subscribe to this mod's changes

agent-context-isolation is a skill published in the GitHub repository vibeeval/vibecosystem (530 stars, last pushed 27d ago), licensed MIT. It adds 8 tokens to every session and 627 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). It is 100% identical to agent-context-isolation, differing in 162 lines, and is treated as a copy.