Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/cli.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ registerPing(program)
// Any invocation that isn't a known subcommand or a top-level help/version
// request is shorthand for `agent session start --connect ...`. So a bare
// `agent`, and `agent "fix the tests" --model ...`, both forward the prompt
// and every trailing flag through to a fresh connected session. `agent --help`,
// `agent --version`, `agent help`, and every subcommand dispatch unchanged.
// and every trailing flag through to a fresh connected session. A bare
// `agent` starts the session idle (idle_start): the sandbox spins up and
// Claude Code waits for the first thing typed into the composer, like a
// local `claude`. `agent --help`, `agent --version`, `agent help`, and every
// subcommand dispatch unchanged.
const topLevelCommands = new Set([
'help',
...program.commands.flatMap((c) => [c.name(), ...c.aliases()]),
Expand Down
6 changes: 6 additions & 0 deletions src/commands/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ export function registerSession(program: Command): void {
// Appended to the initial user query at build time; gives this
// session instructions on top of the config's shared system prompt.
if (promptText) req.prompt = promptText
// A promptless connect (a bare `agent`) starts the session idle:
// no fabricated kickoff message, Claude Code waits at the prompt
// for whatever is typed into the composer, like a local `claude`.
// A promptless --watch/--detach start still runs the config's
// workflow, so this only applies to the interactive open.
if (opts.connect && !promptText) req.idle_start = true

const api = new ApiClient()
const session = await api.startAgentSession(req)
Expand Down
6 changes: 6 additions & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ export interface StartAgentSessionRequest {
// after the config's shared `claude.system` system prompt. Distinct from the
// system prompt, which is identical for every session of a config.
prompt?: string
// Start with no initial message: the sandbox spins up, Claude Code sits idle
// at the prompt, and the first message sent to the session opens turn 0,
// exactly like a local `claude`. Sent for a promptless --connect start (a
// bare `agent`). Mutually exclusive with prompt; the server ignores it when
// the resolved config is not interactive (that session runs its workflow).
idle_start?: boolean
}

// Replay payload for POST /v1/sessions/{id}/replay. Re-runs an existing
Expand Down