# Fork Terminal

> Purpose

- Skill: `ranjanpoudel1234/fork-terminal` (Agent Skill, multi-file: 11 files)
- Install (CLI): `npx skillmds@latest add ranjanpoudel1234/fork-terminal`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ranjanpoudel1234/fork-terminal/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ranjanpoudel1234 (https://skillmd.com/u/ranjanpoudel1234)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/ranjanpoudel1234/fork-terminal

---


# Purpose

Fork a terminal session to a new terminal window. Using one agentic coding tools or raw cli commands.
Follow the `Instructions`, execute the `Workflow`, based on the `Cookbook`.

## Variables

ENABLE_RAW_CLI_COMMANDS: true
ENABLE_GEMINI_CLI: true
ENABLE_CODEX_CLI: true
ENABLE_CLAUDE_CODE: true
AGENTIC_CODING_TOOLS: claude-code, codex-cli, gemini-cli

## Instructions

- Based on the user's request, follow the `Cookbook` to determine which tool to use.

### Fork Summary User Prompts

- IF: The user requests a fork terminal with a summary. This ONLY works for our agentic coding tools `AGENTIC_CODING_TOOLS`. The tool MUST BE enabled as well.
- THEN:
  - **STEP 1 - Create Context File**: ALWAYS create/overwrite `C:\Users\261906\.claude\skills\fork-terminal\temp-fork-context.md` with the conversation history
    - Use the template structure from `.claude/skills/fork-terminal/prompts/fork_summary_user_prompt.md`
    - Fill in the conversation history in YAML format
    - Include current status and next steps
    - This file will be overwritten each time to keep context fresh

  - **STEP 2 - Launch Terminal**: Fork terminal WITHOUT using `-p` parameter (to avoid Windows batch escaping issues)
    - Use: `claude --model opus --dangerously-skip-permissions` (or appropriate model)
    - Do NOT include -p parameter - launch interactive mode only

  - **STEP 3 - Provide User Instruction**: After terminal launches, tell the user to paste this into the new Claude session:
    ```
    Read C:\Users\261906\.claude\skills\fork-terminal\temp-fork-context.md for the full conversation history, then help me continue working.
    ```

- IMPORTANT: This file-based approach avoids Windows command-line escaping issues with long `-p` prompts
- EXAMPLES:
  - "fork terminal use claude code to <xyz> summarize work so far"
  - "spin up a new terminal request <xyz> using claude code include summary"
  - "create a new terminal to <xyz> with claude code with summary"
  - "start a new terminal session with claude code" (implies summary if in ongoing conversation)

## Workflow

1. Understand the user's request.
2. READ: `.claude/skills/fork-terminal/tools/fork_terminal.py` to understand our tooling.
3. Follow the `Cookbook` to determine which tool to use.
4. Execute the `.claude/skills/fork-terminal/tools/fork_terminal.py: fork_terminal(command: str)` tool.

## Cookbook

### Raw CLI Commands

- IF: The user requests a non-agentic coding tool AND `ENABLE_RAW_CLI_COMMANDS` is true.
- THEN: Read and execute: `.claude/skills/fork-terminal/cookbook/cli-command.md` 
- EXAMPLES:
  - "Create a new terminal to <xyz> with ffmpeg"
  - "Create a new terminal to <xyz> with curl"
  - "Create a new terminal to <xyz> with python"

### Claude Code

- IF: The user requests a claude code agent to execute the command AND `ENABLE_CLAUDE_CODE` is true.
- THEN: Read and execute: `.claude/skills/fork-terminal/cookbook/claude-code.md`
- EXAMPLES:
  - "fork terminal use claude code to <xyz>"
  - "spin up a new terminal request <xyz> using claude code"
  - "create a new terminal to <xyz> with claude code"

### Codex CLI

- IF: The user requests a codex CLI agent to execute the command AND `ENABLE_CODEX_CLI` is true.
- THEN: Read and execute: `.claude/skills/fork-terminal/cookbook/codex-cli.md`
- EXAMPLES:
  - "fork terminal use codex to <xyz>"
  - "spin up a new terminal request <xyz> using codex"
  - "create a new terminal to <xyz> with codex"

### Gemini CLI

- IF: The user requests a gemini CLI agent to execute the command AND `ENABLE_GEMINI_CLI` is true.
- THEN: Read and execute: `.claude/skills/fork-terminal/cookbook/gemini-cli.md`
- EXAMPLES:
  - "fork terminal use gemini to <xyz>"
  - "spin up a new terminal request <xyz> with gemini"
  - "create a new terminal to <xyz> using gemini"

