spawn-agent
Spawn an AI coding agent in a new terminal (Claude, Codex, Gemini, Cursor, OpenCode, Copilot). Defaults to Claude Code if unspecified.
Best use case
spawn-agent is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Spawn an AI coding agent in a new terminal (Claude, Codex, Gemini, Cursor, OpenCode, Copilot). Defaults to Claude Code if unspecified.
Spawn an AI coding agent in a new terminal (Claude, Codex, Gemini, Cursor, OpenCode, Copilot). Defaults to Claude Code if unspecified.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "spawn-agent" skill to help with this workflow task. Context: Spawn an AI coding agent in a new terminal (Claude, Codex, Gemini, Cursor, OpenCode, Copilot). Defaults to Claude Code if unspecified.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/agent/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How spawn-agent Compares
| Feature / Agent | spawn-agent | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Spawn an AI coding agent in a new terminal (Claude, Codex, Gemini, Cursor, OpenCode, Copilot). Defaults to Claude Code if unspecified.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# Purpose
Spawn an AI coding agent in a new terminal window. Follow the 'Instructions', execute the 'Workflow', based on the 'Cookbook'.
## Variables
| Variable | Default | Description |
|----------|---------|-------------|
| DEFAULT_AGENT | claude-code | Agent to use when not explicitly specified |
| ENABLED_CLAUDE_CLI | true | Enable Claude Code agent |
| ENABLED_CODEX_CLI | true | Enable OpenAI Codex agent |
| ENABLED_GEMINI_CLI | true | Enable Google Gemini agent |
| ENABLED_CURSOR_CLI | true | Enable Cursor agent |
| ENABLED_OPEN_CODE_CLI | true | Enable OpenCode agent |
| ENABLED_COPILOT_CLI | true | Enable GitHub Copilot agent |
| LOG_TO_FILE | false | Write full terminal output to debug file |
| LOG_AGENT_OUTPUT | true | Write clean agent JSON response to file |
| READ_CAPTURED_OUTPUT | false | Read and display agent output after spawn |
| AGENTIC_CODING_TOOLS | claude-code, codex-cli, gemini-cli, cursor-cli, opencode-cli, copilot-cli | Available agentic tools |
## Instructions
**MANDATORY** - You MUST follow the Workflow steps below in order. Do not skip steps.
### Agent Selection
1. **Explicit request**: If user specifies an agent (e.g., "use gemini", "spawn codex"), use that agent
2. **No agent specified**: Use DEFAULT_AGENT (claude-code)
3. **Check enabled**: Verify the ENABLED_*_CLI flag is true before proceeding
### Reading Cookbooks
- Based on the selected agent, follow the 'Cookbook' section to read the appropriate .md file
- You MUST read and execute the appropriate cookbook file before spawning the agent
## Red Flags - STOP and follow Cookbook
If you're about to:
- Spawn an agent without reading the cookbook first
- Execute a CLI command without running --help
- Skip steps because "this is simple"
- Run a CLI agent with a prompt but without checking INTERACTIVE_MODE requirements
**STOP** -> Read the appropriate cookbook file -> Follow its instructions -> Then proceed
> **Common Mistake**: When spawning agentic CLIs (Claude, Codex, Gemini) with a prompt,
> most require command chaining (e.g., `&& claude --continue`) to stay in interactive
> mode after the prompt completes. Always check the cookbook for the correct pattern.
### Spawn Summary User Prompt
- IF: The user requests spawning an agent with a summary of the conversation
- THEN:
- Read and REPLACE the <user_prompt_summary> and <agent_response_summary> fields in './prompts/fork-summary-user-prompt.md' with the history of the conversation between you and the user.
- Include the next users request in the `Next User Request` field.
- This will be what you pass into the PROMPT field of the agentic coding tool.
- Spawn the agent with: fork_terminal(command: str, capture=False, log_to_file=False, log_agent_output=True)
- Examples:
- "Spawn agent use claude code to <xyz> with a summary"
- "spin up a new terminal with <xyz> with claude code. Include a summary of the conversation."
- "create a new agent with claude code to <xyz>. Summarize work so far."
- "spawn agent use gemini to <xyz> with a summary"
## Workflow
**MANDATORY CHECKPOINTS** - Verify each before proceeding:
1. [ ] Understand the user's request
2. [ ] **SELECT AGENT**: Determine which agent (explicit or DEFAULT_AGENT)
3. [ ] READ: './fork_terminal.py' to understand the tooling
4. [ ] Follow the Cookbook (read the appropriate .md file for selected agent)
5. [ ] **CHECKPOINT**: Confirm cookbook instructions were followed (e.g., ran --help)
6. [ ] Execute fork_terminal(command: str, capture=False, log_to_file=False, log_agent_output=True)
7. [ ] IF 'READ_CAPTURED_OUTPUT' is true: Read and display the agent output using read_fork_output()
## Cookbook
### Claude Code (Default)
- IF: User requests Claude Code OR no agent explicitly specified
- THEN: Read and execute './cookbook/claude-code.md'
- Examples:
- "Spawn an agent to <xyz>"
- "Fork terminal to <xyz>" (no agent specified = claude-code)
- "Spawn agent use claude code to <xyz>"
- "spin up a new terminal with claude code"
### Codex CLI
- IF: User requests Codex/OpenAI agent and 'ENABLED_CODEX_CLI' is true
- THEN: Read and execute './cookbook/codex-cli.md'
- Examples:
- "Spawn agent use codex to <xyz>"
- "create a new terminal with codex cli to <xyz>"
- "spawn openai agent to <xyz>"
### Gemini CLI
- IF: User requests Gemini/Google agent and 'ENABLED_GEMINI_CLI' is true
- THEN: Read and execute './cookbook/gemini-cli.md'
- Examples:
- "Spawn agent use gemini to <xyz>"
- "create a new terminal with gemini cli to <xyz>"
- "spawn google agent to <xyz>"
### Cursor CLI
- IF: User requests Cursor agent and 'ENABLED_CURSOR_CLI' is true
- THEN: Read and execute './cookbook/cursor-cli.md'
- Examples:
- "Spawn agent use cursor cli to <xyz>"
- "create a new terminal with cursor to <xyz>"
- "spawn cursor agent to <xyz>"
### OpenCode CLI
- IF: User requests OpenCode agent and 'ENABLED_OPEN_CODE_CLI' is true
- THEN: Read and execute './cookbook/opencode-cli.md'
- Examples:
- "Spawn agent use opencode cli to <xyz>"
- "create a new terminal with opencode to <xyz>"
- "spawn opencode agent to <xyz>"
### Copilot CLI
- IF: User requests Copilot/GitHub agent and 'ENABLED_COPILOT_CLI' is true
- THEN: Read and execute './cookbook/copilot-cli.md'
- Examples:
- "Spawn agent use copilot cli to <xyz>"
- "create a new terminal with copilot to <xyz>"
- "spawn github copilot agent to <xyz>"
## Output Retrieval
The `fork_terminal()` function supports three output controls:
| Parameter | Default | Output File | Description |
|-----------|---------|-------------|-------------|
| `log_agent_output` | `True` | `/tmp/fork-agent-*.json` | Clean agent JSON response |
| `log_to_file` | `False` | `/tmp/fork-debug-*.txt` | Full terminal output (debug) |
| `capture` | `False` | N/A | Block and return content directly |
### Parameter Combinations
| `capture` | `log_agent_output` | `log_to_file` | Behavior |
|-----------|-------------------|---------------|----------|
| `False` | `True` (default) | `False` | Returns agent JSON file path |
| `False` | `False` | `True` | Returns debug file path |
| `False` | `False` | `False` | Returns empty string |
| `True` | `True` | * | Blocks, returns agent JSON content |
| `True` | `False` | `True` | Blocks, returns debug content |
### Retrieving Output Later
When `log_agent_output=True` (default), clean agent output is logged. Use `read_fork_output(file_path)` to retrieve it:
```python
# Spawn without blocking (returns path to JSON output)
file_path = fork_terminal(cmd, log_agent_output=True)
print(f"Agent output will be at: {file_path}")
# Later, read the output when needed
output = read_fork_output(file_path, timeout=60)
```
### Debug Mode
For debugging, enable `log_to_file=True` to capture full terminal output (including stderr):
```python
# Debug mode: capture everything
file_path = fork_terminal(cmd, log_to_file=True, log_agent_output=False)
```Related Skills
spawn-terminal
Spawn a new terminal window to run CLI commands (ffmpeg, curl, python, etc.). Use for non-AI command execution.
spawn
Skills for spawning external processes - AI coding agents and generic CLI commands in new terminal windows. Parent skill category for agent and terminal spawning.
spawn-parallel
Pattern for spawning parallel subagents efficiently. Use when you need multiple independent tasks done concurrently.
azure-quotas
Check/manage Azure quotas and usage across providers. For deployment planning, capacity validation, region selection. WHEN: "check quotas", "service limits", "current usage", "request quota increase", "quota exceeded", "validate capacity", "regional availability", "provisioning limits", "vCPU limit", "how many vCPUs available in my subscription".
raindrop-io
Manage Raindrop.io bookmarks with AI assistance. Save and organize bookmarks, search your collection, manage reading lists, and organize research materials. Use when working with bookmarks, web research, reading lists, or when user mentions Raindrop.io.
zlibrary-to-notebooklm
自动从 Z-Library 下载书籍并上传到 Google NotebookLM。支持 PDF/EPUB 格式,自动转换,一键创建知识库。
discover-skills
当你发现当前可用的技能都不够合适(或用户明确要求你寻找技能)时使用。本技能会基于任务目标和约束,给出一份精简的候选技能清单,帮助你选出最适配当前任务的技能。
web-performance-seo
Fix PageSpeed Insights/Lighthouse accessibility "!" errors caused by contrast audit failures (CSS filters, OKLCH/OKLAB, low opacity, gradient text, image backgrounds). Use for accessibility-driven SEO/performance debugging and remediation.
project-to-obsidian
将代码项目转换为 Obsidian 知识库。当用户提到 obsidian、项目文档、知识库、分析项目、转换项目 时激活。 【激活后必须执行】: 1. 先完整阅读本 SKILL.md 文件 2. 理解 AI 写入规则(默认到 00_Inbox/AI/、追加式、统一 Schema) 3. 执行 STEP 0: 使用 AskUserQuestion 询问用户确认 4. 用户确认后才开始 STEP 1 项目扫描 5. 严格按 STEP 0 → 1 → 2 → 3 → 4 顺序执行 【禁止行为】: - 禁止不读 SKILL.md 就开始分析项目 - 禁止跳过 STEP 0 用户确认 - 禁止直接在 30_Resources 创建(先到 00_Inbox/AI/) - 禁止自作主张决定输出位置
obsidian-helper
Obsidian 智能笔记助手。当用户提到 obsidian、日记、笔记、知识库、capture、review 时激活。 【激活后必须执行】: 1. 先完整阅读本 SKILL.md 文件 2. 理解 AI 写入三条硬规矩(00_Inbox/AI/、追加式、白名单字段) 3. 按 STEP 0 → STEP 1 → ... 顺序执行 4. 不要跳过任何步骤,不要自作主张 【禁止行为】: - 禁止不读 SKILL.md 就开始工作 - 禁止跳过用户确认步骤 - 禁止在非 00_Inbox/AI/ 位置创建新笔记(除非用户明确指定)
internationalizing-websites
Adds multi-language support to Next.js websites with proper SEO configuration including hreflang tags, localized sitemaps, and language-specific content. Use when adding new languages, setting up i18n, optimizing for international SEO, or when user mentions localization, translation, multi-language, or specific languages like Japanese, Korean, Chinese.
google-official-seo-guide
Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation