agent-context-isolation

agent-context-isolation is a skill for Claude Code from majiayu000/claude-skill-registry. It costs 8 tokens per session (623 once invoked), scanned B, a copy of agent-context-isolation, MIT.

A workflow guide for keeping delegated agent work out of the main conversation by using background agents and shared files.

In plain words
What is it for?
It is for coordinating background agents, storing their results in files, and verifying completion without importing their full conversations.
Why use it?
It prevents long agent transcripts from filling the main context and making the task harder to follow. It also provides a way to check progress through saved results and tests.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit It is for coordinating background agents, storing their results in files, and verifying completion without importing their full conversations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majiayu000/claude-skill-registry/agent-context-isolation
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.

Any agent
npx skills add majiayu000/claude-skill-registry --skill agent-context-isolation
Clone the repo
git clone --depth 1 https://github.com/majiayu000/claude-skill-registry

Made for: Claude Code.

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/majiayu000/claude-skill-registry/agent-context-isolation/github.svg)](https://agentmods.dev/skills/majiayu000/claude-skill-registry/agent-context-isolation)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/claude-skill-registry/agent-context-isolation"><img src="https://agentmods.dev/badge/skills/majiayu000/claude-skill-registry/agent-context-isolation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-context-isolation

Your own site · 80×15
<a href="https://agentmods.dev/skills/majiayu000/claude-skill-registry/agent-context-isolation"><img src="https://agentmods.dev/badge/skills/majiayu000/claude-skill-registry/agent-context-isolation.svg" alt="Reviewed on agentmods" width="80" 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 623 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00008 $0.00623
Opus 5 $0.00004 $0.00311
Sonnet 5 $0.00002 $0.00125
Haiku 4.5 $0.00001 $0.00062

Measured 8d ago against content hash 2559aec9ef8e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 8d ago.

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 — 0 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/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

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 82 lines · 8 tokens per session scan B 2559aec9ef8e

Subscribe to this mod's changes

agent-context-isolation is a skill published in the GitHub repository majiayu000/claude-skill-registry (604 stars, last pushed yesterday), licensed MIT. It adds 8 tokens to every session and 623 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 0 lines, and is treated as a copy.