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
This commit is contained in:
Paul O'Reilly
2026-07-25 16:29:46 +12:00
parent 5623f75c3b
commit 916acd39e1
2 changed files with 37 additions and 0 deletions

View File

@@ -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

View File

@@ -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 <project>` — spawn for a named project folder
- `/spawn-session <project> --mode <mode>` — override engagement mode
- `/spawn-session <project> --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 <project> [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`.