claude-sessions spawn: add --headless/--create for non-interactive use
Claude-Session: https://claude.ai/code/session_01JXneLTuvb5Gxim3DTN2tQa
This commit is contained in:
@@ -16,6 +16,10 @@ Python script (`scripts/claude-sessions`, symlinked to `~/sbin/`). Manages Claud
|
||||
- **Folder browser.** `zenity --file-selection --directory` when `DISPLAY`/`WAYLAND_DISPLAY` is set and zenity exists (has Create Folder). Otherwise a terminal browser: number = open, `u` up, `n` new folder, `/text` filter, `>` `<` page, `h` hidden, `~`/`/path` jump, Enter/`s` select, `q` cancel.
|
||||
- **Topic.** Becomes the tmux session name and the Remote Control name (passed as `--name` to `claude-tmux`). Defaults to the Title-Cased folder name. If that name is already a live tmux session, no default is offered and a unique topic is required. Topics containing `.` or `:` are rejected because tmux rewrites them to `_`.
|
||||
|
||||
## Headless spawn
|
||||
|
||||
`claude-sessions spawn <folder> --headless [--name topic] [--create] [--mode m] [--profile p]` — no prompts, no attach, for scripts and the `/spawn-session` skill. Exit 1 = folder missing (or `--create` needs an absolute path); exit 2 = topic in use (default topic is the Title-Cased folder name; no `#N` suffix is added). Without `--headless`, `spawn` behaves as before.
|
||||
|
||||
## Gotchas
|
||||
|
||||
- "In use" means a live tmux session. Resumable registry entries do not block a topic.
|
||||
|
||||
@@ -12,14 +12,14 @@ from the Claude app.
|
||||
|
||||
- `/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
|
||||
Calls `claude-sessions spawn <folder> --headless [--name topic] [--create]` (since 2026-10-26),
|
||||
which wraps `claude-tmux` (in `small-scripts`, symlinked to `~/sbin`). The skill only resolves
|
||||
the folder from `$ARGUMENTS` (or asks). Headless mode never prompts or attaches, and exits 2
|
||||
if the topic is already a live tmux session (the skill then asks for a unique topic). 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user