Use case
I create a worktree session to work on issue #123. Today I have to attach to the
session, wait for the agent to start, then type or paste "fix the auth bug
described in #123, here's the context...". I want to give the agent the task at
the moment I create the session, so it can start working immediately.
Outcome
wt session add accepts a per-session task prompt at creation time. The agent
launched in that session starts up with that prompt as its first user message
(or however the configured agent ingests work items). When no task prompt is
supplied, the session behaves exactly as it does today.
The mechanism is agent-agnostic — it must work for claude, opencode, aider,
and any other CLI a user has set as agent_cmd. The user, not wt, decides how
the prompt is handed to their specific agent (since each agent has its own flag
for this, e.g. claude accepts a positional prompt, opencode --prompt, etc.).
Why now
Today the workflow is wt session add → attach → context-switch → paste prompt.
Each step adds friction and makes the flow unscriptable. With per-session task
prompts, scripts and slash-commands like /do <issue> can spin up a worktree
session that's already working on the right thing.
Acceptance criteria
Out of scope
- A separate prompt for the agent's persona/system behavior (separate issue).
- Auto-opening the prompt in the editor pane (separate issue).
Use case
Outcome
wt session addaccepts a per-session task prompt at creation time. The agentlaunched in that session starts up with that prompt as its first user message
(or however the configured agent ingests work items). When no task prompt is
supplied, the session behaves exactly as it does today.
The mechanism is agent-agnostic — it must work for
claude,opencode,aider,and any other CLI a user has set as
agent_cmd. The user, not wt, decides howthe prompt is handed to their specific agent (since each agent has its own flag
for this, e.g.
claudeaccepts a positional prompt,opencode --prompt, etc.).Why now
Today the workflow is
wt session add → attach → context-switch → paste prompt.Each step adds friction and makes the flow unscriptable. With per-session task
prompts, scripts and slash-commands like
/do <issue>can spin up a worktreesession that's already working on the right thing.
Acceptance criteria
wt session add foo --prompt "..."(or equivalent) and theagent in that session receives the prompt at launch.
quotes,
$, backticks, and newlines (e.g.--prompt "$(cat implement-fib-task.md)").no new files, no behavior change.
session/window that already exists (no silent re-launch).
that the same mechanism extends to other agents.
Out of scope