From 916acd39e12ec9b966d7da754822bb33f0677546 Mon Sep 17 00:00:00 2001 From: Paul O'Reilly Date: Sat, 25 Jul 2026 16:29:46 +1200 Subject: [PATCH] docs(memory): add /spawn-session skill reference Per the skill convention, document /spawn-session (purpose, usage, how it wraps claude-tmux, gotchas) and index it in MEMORY.md. Claude-Session: https://claude.ai/code/session_014oa7T7z1h5n34vu8vX9zGT --- MEMORY.md | 1 + memory/skill-spawn-session.md | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 memory/skill-spawn-session.md diff --git a/MEMORY.md b/MEMORY.md index 66cfa60..cd034f3 100644 --- a/MEMORY.md +++ b/MEMORY.md @@ -30,6 +30,7 @@ - [/orchestrate](memory/skill-orchestrate.md) — Check task state, launch container agents in git worktrees. Use `/loop 2m /orchestrate` for auto-polling - [/review-plan](memory/skill-review-plan.md) — Review plan against best practices (API, security, specs, TDD) before implementation - [/review-spec](memory/skill-review-spec.md) — Review spec for structure, requirement quality, security coverage, and testability +- [/spawn-session](memory/skill-spawn-session.md) — Spawn a new detached tmux Claude Code session with Remote Control, named after a project (wraps claude-tmux) ## References diff --git a/memory/skill-spawn-session.md b/memory/skill-spawn-session.md new file mode 100644 index 0000000..af68087 --- /dev/null +++ b/memory/skill-spawn-session.md @@ -0,0 +1,36 @@ +# /spawn-session + +## Purpose + +Spawn a new, separate Claude Code session inside a detached `tmux` session with Remote +Control enabled, in a project's directory, named after the project (e.g. "Agent Runtimes", +auto-incrementing to "Agent Runtimes #2"). Lets the user start a session for another project +that persists on the host and is reachable later via `tmux attach` (over VPN) or driveable +from the Claude app. + +## Usage + +- `/spawn-session ` — spawn for a named project folder +- `/spawn-session --mode ` — override engagement mode +- `/spawn-session --attach` — attach after spawning +- `/spawn-session` — lists projects and asks which one + +## How it works + +Thin wrapper over the `claude-tmux` script (in `small-scripts`, symlinked to `~/sbin`). +The skill only resolves the project name from `$ARGUMENTS` (or asks) and shells out to +`claude-tmux [flags]`. All real logic — folder resolution, mode selection +(profile `last-mode` unless `--mode`), Title-Casing, ` #N` auto-increment, tmux creation, +and launching `claude --remote-control` via `claude-profile` — lives in the script. + +## Gotchas + +- **Separate process, not a sub-agent.** The spawned session does not share the current + conversation's context. It's a full interactive Claude Code session the user drives. +- **Remote Control only registers once `claude` is running.** The script guarantees this by + passing the engagement mode explicitly so `claude-profile` never stalls at its interactive + picker. Don't "fix" the skill to omit the mode. +- **Default profile is `oreillyit-anthropic`.** Only override with `--profile` on request. +- **Concurrent same-profile sessions** race on the shared `active-mode.env`, but each + session's cwd takes precedence for project auto-selection, so the right project is picked. +- Spec + tests: `small-scripts/specs/claude-tmux.spec.md`, `tests/test-claude-tmux.sh`.