Forked skill execution with isolated context

From ychampion/cskill-agents · View interactive version

Forked skill execution with isolated context is an AI agent skill from the GitHub repository ychampion/cskill-agents. Run SkillTool slash commands inside a forked sub-agent so the skill has isolated budget, telemetry, and lifecycle.

How to use this skill

Skill file

SKILL: Forked Skill Execution With Isolated Context

Domain: agentic-loop

Trigger: Load this skill when SkillTool needs to wrap a prompt command marked with context:'fork' into a sub-agent run that cannot touch the parent session state.

Source Pattern: Distilled from reviewed subagent orchestration, isolation, and lifecycle implementations.

Core Method

Merge the command metadata (model, effort, telemetry tags) into a cloned agent definition, record the forked skill invocation, and run the skill prompt through run agent so it executes in a dedicated loop with its own agent id. Buffer the streaming messages, emit progress when tool content appears, and once run agent completes extract and return a clean result string after releasing the temporary message buffer and invoked-skill state. The parent context still honors overrides (allowed tools, effort, model suffix) via context modifier, while telemetry uses sanitized names and agent IDs so the forked execution is auditable separately.

Key Rules

Example Application

If a CLI-style review skill needs to spawn its own interpreter to run analysis on a repo snapshot, mark it as context:'fork', let SkillTool merge its effort override, and rely on this method to keep the review sub-agent separate while streaming progress back to the caller.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.