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
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.
About
Use cases: productivity, agent-building
Reviews
Write a reviewNo 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.
More from amoniacou/agent-skills
- 0.565score
brainstorm
amoniacou
Use before any creative work or significant changes.
SkillAFreshness: AClaude Code +9 - 0.564score
helmcheck
amoniacou
Use before writing, changing or reviewing Helm charts, values, shared helpers, migration hooks or chart validation.
SkillAFreshness: AClaude Code +9 - 0.561score
naming
amoniacou
Naming rules for files, directories, classes, modules, structs, errors, methods, functions and variables.
SkillAFreshness: AClaude Code +9 - 0.558score
principles
amoniacou
Design rules for writing and changing code.
SkillAFreshness: AClaude Code +9 - 0.553score
go-best-practices
amoniacou
Best practices for writing Go code.
SkillAFreshness: AClaude Code +9 - 0.531score
testing
amoniacou
Rules for writing tests - which level to test at, when a mock is allowed, isolation, waiting, structure and fixtures.
SkillAFreshness: AClaude Code +9 - 0.278score
plan
amoniacou
No description from the publisher yet.
SkillBFreshness: BClaude Code +9
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
- Repository
- github.com/amoniacou/agent-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from amoniacou
- 0.565score
brainstorm
amoniacou
Use before any creative work or significant changes.
SkillAFreshness: AClaude Code +9 - 0.564score
helmcheck
amoniacou
Use before writing, changing or reviewing Helm charts, values, shared helpers, migration hooks or chart validation.
SkillAFreshness: AClaude Code +9 - 0.561score
naming
amoniacou
Naming rules for files, directories, classes, modules, structs, errors, methods, functions and variables.
SkillAFreshness: AClaude Code +9 - 0.558score
principles
amoniacou
Design rules for writing and changing code.
SkillAFreshness: AClaude Code +9 - 0.553score
go-best-practices
amoniacou
Best practices for writing Go code.
SkillAFreshness: AClaude Code +9 - 0.531score
testing
amoniacou
Rules for writing tests - which level to test at, when a mock is allowed, isolation, waiting, structure and fixtures.
SkillAFreshness: AClaude Code +9
Cite this page
spawn-session skill. Agent Mart. https://agentmart.dev/skills/amoniacou-spawn-session (last updated 2026-10-24)