Skip to main content

Sessions

Sessions are persistent PTY processes that run in the background. They survive disconnects — start a process, close your terminal, reconnect later.
cw run creates a local PTY session. cw launch creates a workspace on the platform. See Platform commands for workspace management.

run

Start a new session in a persistent PTY.
cw run [name] [--dir <dir>] [--tag <tag>...] -- <command> [args...]
FlagDescription
nameOptional positional name before -- for stable messaging identifier
--dirWorking directory for the process
--tagTags for filtering and orchestration (repeatable)
# Run with tags
cw run worker --dir ~/project --tag build -- claude -p "refactor the auth module"

# Run unnamed
cw run --tag lint -- eslint src/

attach

Connect to a running session interactively. Detach with Ctrl+B d.
cw attach [<id>] [--no-history]
FlagDescription
idSession ID. Omit to auto-select the oldest unattached session
--no-historyDon’t replay buffered output on attach

list

Show all sessions with status, tags, age, and command.
cw list [node] [--json]
 ID  NAME      STATUS     TAGS           AGE     COMMAND
  1  planner   running    worker,build   2m ago  claude -p "refactor the auth module"
  2  coder     running    worker         45s     claude -p "implement changes"

kill

Terminate a session by ID, tag, or all.
cw kill <id> [--all] [--tag <tag>]
cw kill 1                    # kill session 1
cw kill --tag worker         # kill all workers
cw kill --all                # kill everything

logs

View captured output without attaching.
cw logs <id> [--follow] [--tail <N>]
FlagDescription
--follow, -fStream new output in real-time
--tailShow last N lines

send

Send input to a session without attaching.
cw send <id> [input] [--stdin] [--file <path>] [--no-newline]
FlagDescription
inputText to send as positional argument
--stdinRead input from stdin
--fileRead input from a file
--no-newlineDon’t append a newline after input

watch

Monitor a session in real-time without attaching. Read-only observation.
cw watch <id> [--tail <N>] [--no-history] [--timeout <s>]

status

Get detailed session info including exit code, duration, tags, PID, and output stats.
cw status <id> [--json]