Skip to content
Agentmart
Submit a tool

spawn-session

Hand off a task to a new, independent `claude` or `codex` session in a new tmux window or kitty tab — not a background subagent.

Skill by amoniacou

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/amoniacou-spawn-session

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Hand off a task to a new, independent `claude` or `codex` session in a new tmux window or kitty tab — not a background subagent. Activates on "spawn a new session for this", "hand this off to a new session", "start a separate session for this job", "delegate this to a new terminal session", "run this in a separate/parallel session", "spin up a session for this slice", or when the user is slicing a larger job into pieces to hand off one at a time.

Use cases: productivity, agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/spawn-session

Tools it pre-approves 3

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash,
  • AskUserQuestion,
  • ListAgents

What's inside

Skill name
spawn-session
Description
Hand off a task to a new, independent `claude` or `codex` session in a new tmux window or kitty tab — not a background subagent. Activates on "spawn a new session for this", "hand this off to a new session", "start a separate session for this job", "delegate this to a new terminal session", "run this in a separate/parallel session", "spin up a session for this slice", or when the user is slicing a larger job into pieces to hand off one at a time.
License
MIT
Allowed tools
Bash,, AskUserQuestion,, ListAgents
Instructions
105 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Spawn a Task in a Separate Session

Hand a task prompt to a new `claude` or `codex` process in a new tmux window
(when this session runs inside tmux) or a new kitty tab (inside kitty). The
user can switch to it and drive it, and it keeps running after this
conversation ends. Not an `Agent` subagent: those are hidden and die with this
conversation.

The command is typed into the new window's own shell, so it runs exactly as
if the user typed it: their shell (bash, zsh or fish 3.4+), their rc files,
their `PATH`. When the CLI exits, the user is back at that shell.

## Step 1: Resolve the task prompt

The task prompt passed as the argument, if any:

<task-prompt>
$ARGUMENTS
</task-prompt>

- If it isn't empty, use it verbatim, every line of it.
- Otherwise write a self-contained prompt: what to do, which files/areas are
  involved, how to verify it's done. The new session cannot see this
  conversation.
- Line 1 must be the task itself as an imperative ("Fix the parser…"), not a
  description of the hand-off ("Spawn a session to…").

## Step 2: Name the session

A short window/tab title, e.g. `Spawn: <slug>`. Slices sharing a stateful
resource (database, lock, port): spawn one at a time, not back to back.

## Step 3: Choose a runtime

Ask with `AskUserQuestion` — question "Which CLI should the new session run?",
header "Runtime", single-select, options:

- **Claude** (Recommended) — a `claude` process, matching this session
- **Codex** — a `codex` process (Codex CLI)

## Step 4: Choose a model

Check the Step 3 answer first — Codex gets its own question.

**Claude:** ask with `AskUserQuestion` — question "Which model should the new
session use?", header "Model", single-select, options:

- **Inherit** — whatever `claude` launches with by default
- **Opus** — most capable; complex or subtle work
- **Sonnet** — faster and cheaper; straightforward tasks
- **Haiku** — fastest and cheapest; simple mechanical changes

**Codex:** ask with `AskUserQuestion` — question "Which model should the new
Codex session use?", header "Model", single-select, options:

- **Inherit** (Recommended) — Codex uses its configured default model
- **Enter a model name** — the exact Codex model name, typed via "Other"

`CLI_FLAGS` is `--model <lower-cased label>` for a Claude tier,
`--model <exact text the user typed>` for Codex, or nothing for **Inherit**.
Never guess a Codex model name.

## Step 5: Spawn

**Claude runtime only:** call `ListAgents` first. Its first line reads
"This session is <name> [<ref>]"; `PARENT_NAME` is the bare `<name>`. End the
prompt with this footer. It carries no instruction on purpose: "report back"
wording makes spawned sessions message this one unasked. Codex gets no
footer, nor does a Claude spawn when `ListAgents` gives no name.

```
---
Spawned from Claude session PARENT_NAME.
```

Run one Bash call. The prompt goes in on stdin through a **quoted** heredoc
(`<<'PROMPT_EOF'`) so it isn't shell-expanded. Don't pre-check tmux or kitty;
the script does that and exits non-zero with a reason.

```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/spawn-session.sh" RUNTIME "$PWD" "SESSION_NAME" "CLI_FLAGS" <<'PROMPT_EOF'
<task prompt from Step 1>
<footer, Claude runtime with a PARENT_NAME only>
PROMPT_EOF
```

`RUNTIME` is `claude` or `codex`. Drop the `"CLI_FLAGS"` argument for
**Inherit**.

If the script rejects line 1, it names the saved prompt file. `Edit` just
line 1 of that file into an imperative and rerun the same command with
`< <that file>` in place of the heredoc.

## Step 6: Report the outcome

Exit 0: the stdout line says where it opened (`tmux window: <name>` or
`kitty tab: <name>`). Report that, the runtime, and the model unless Inherit.
Non-zero: quote stderr. If it says "not available", ask whether they want a
background subagent instead of silently falling back to one. If it says the
kitty socket is not set, relay the `kitty.conf` lines from the message and
that kitty needs a full restart.

Either way, stop — do not implement the task in this session.

From amoniacou/agent-skills, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 15, 2026 (15 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from amoniacou

Cite this page

spawn-session skill. Agent Mart. https://agentmart.dev/skills/amoniacou-spawn-session (last updated 2026-10-24)