context-fork-skill

Create forked sub-agent contexts with isolated history and controlled tool access.

19|3|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/louloulin/claude-agent-sdk --skill context-fork-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-fork-skill
Source: https://github.com/louloulin/claude-agent-sdk/tree/main/crates/claude-agent-sdk/examples/.claude/skills/context-fork-skill
Command: npx skills add https://github.com/louloulin/claude-agent-sdk --skill context-fork-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables forking a sub-agent context, providing an isolated execution environment with its own conversation history and state, to prevent leakage into the main context.

Core Features & Use Cases

  • Isolated forked context with independent conversation history
  • Configurable agent types (general-purpose, Plan, Explore, code-reviewer, etc.)
  • Controlled tool access and separate state management
  • Safe testing and experimentation without cross-contamination

Quick Start

Use this skill to run a task in isolation. Example: start a forked context to analyze a codebase without affecting the main conversation.

Frequently Asked Questions about context-fork-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate testing tasks from the main conversation history?

You can isolate testing tasks by creating a forked sub-agent context with its own independent conversation history. This prevents cross-contamination, ensuring the main context remains clean and unaffected by the isolated execution environment.

What is a forked sub-agent context used for in multi-step workflows?

A forked sub-agent context is used to execute complex, multi-step workflows in an isolated environment. It maintains separate state and conversation history, preventing task-specific data from leaking into the primary agent context.

Can I configure tool access for a forked agent context?

Yes, you can enforce controlled tool access by configuring allowed_tools for the forked context. This ensures separate state management and controlled resource usage when executing specialized sub-agent tasks like code analysis.

Does isolated sub-agent execution support different agent types?

Yes, isolated sub-agent execution supports configurable agent types such as general-purpose, Plan, Explore, and code-reviewer. This allows you to tailor the forked context for specific complex analyses or testing workflows.

What is the best way to run safe experiments without affecting main agent state?

The best way to run safe experiments is by initiating a forked context for isolated task execution. This provides a separate environment with its own history, allowing safe testing without cross-contamination into the main conversation.

When should I not use a forked context for sub-agent tasks?

You should not use a forked context for simple tasks that do not require separate state or isolated conversation history. Forking is specifically designed for complex, multi-step analyses and specialized workflows where avoiding leakage is critical.