iw start always launches an agent, so the unattended path must find a PID and kill it #581

Closed
opened 2026-09-21 07:50:37 +00:00 by claude · 0 comments
Member

The unattended path — iw kanon/autonomous-bootstrap then iw kanon/batch-implement — needs a worktree and nothing else. iw start always creates the workspace and then runs the SessionAction hook, and the kanon hook launches claude --dangerously-skip-permissions /iterative-works:triage-issue <key> on an issue worktree.

So today the unattended path starts a session it must immediately kill. Done on IW-578: iw start IW-578, then kill the claude process in the worktree. It costs a session start, and it is a race — the bootstrap runs triage itself, so two triage sessions can write the same analysis file if the kill is late.

Asked for: a way to create and register the worktree and return, with no workspace and no session hook. For example iw start <key> --no-session.

Design note. The decision probably belongs to iw-cli, not to the hook. Start.createSessionAndRunHooks creates the workspace and dispatches the hook together; a flag that skips both needs no new hook interface, and a hook cannot be given arguments today. Skipping the hook alone would still leave an empty workspace behind.

Found while driving the IW-578 loop by hand.


Type: feature
Filed from: /home/mph/Devel/iw/iw-cli on branch main


Restated intent (2026-09-21) — this supersedes the design note above

What we are avoiding is the agent launch, not the workspace.

The harm is one human-only step in the middle of an otherwise unattended path. The recipe today is iw start <key>, then find the claude process by PID and kill it, then autonomous-bootstrap, then batch-implement. Only that middle step needs a person, so there is no one-line script from an issue to a final pull request. It was done by hand four times on 2026-09-21 alone (IW-578, IW-583, IW-491, IW-581).

Two smaller costs come with it: a wasted claude process, ~2 GB at a moment when the memory guard is killing runs, and a race in which the launched triage and the bootstrap's own triage both write analysis.md.

The workspace is not the harm. It is where the built-in SessionSetup hooks run — DirenvSetup and ZvecGrepIndexSetup. iw open creates a workspace deliberately and launches nothing, which is exactly the shape the unattended path wants.

So the ask is iw start minus the SessionAction hook: create the worktree, register it with the dashboard, create the workspace, run direnv allow and build the zg index, and launch no agent.

The earlier design note argued for skipping the workspace and the hook together, because the name --no-session led it there. That is wider than the goal and it costs the setup work. A worktree with no zg index changes how an unattended agent searches code, which is the subject of a running observation (dev-docs DEVDOCS-293), and --no-session would change it silently.

Name it for what it skips: --no-agent. It is generic — the hook launches whatever agent is installed — and it stays true if the agent is not Claude.

Out of scope: a flag together with --prompt is a contradiction and should be refused before any work, the way phase-pr refuses --batch with --no-wait.

The unattended path — `iw kanon/autonomous-bootstrap` then `iw kanon/batch-implement` — needs a worktree and nothing else. `iw start` always creates the workspace and then runs the SessionAction hook, and the kanon hook launches `claude --dangerously-skip-permissions /iterative-works:triage-issue <key>` on an issue worktree. So today the unattended path starts a session it must immediately kill. Done on IW-578: `iw start IW-578`, then kill the claude process in the worktree. It costs a session start, and it is a race — the bootstrap runs triage itself, so two triage sessions can write the same analysis file if the kill is late. **Asked for:** a way to create and register the worktree and return, with no workspace and no session hook. For example `iw start <key> --no-session`. **Design note.** The decision probably belongs to iw-cli, not to the hook. `Start.createSessionAndRunHooks` creates the workspace and dispatches the hook together; a flag that skips both needs no new hook interface, and a hook cannot be given arguments today. Skipping the hook alone would still leave an empty workspace behind. Found while driving the IW-578 loop by hand. --- **Type:** feature **Filed from:** `/home/mph/Devel/iw/iw-cli` on branch `main` --- ## Restated intent (2026-09-21) — this supersedes the design note above **What we are avoiding is the agent launch, not the workspace.** The harm is one human-only step in the middle of an otherwise unattended path. The recipe today is `iw start <key>`, then *find the claude process by PID and kill it*, then `autonomous-bootstrap`, then `batch-implement`. Only that middle step needs a person, so there is no one-line script from an issue to a final pull request. It was done by hand four times on 2026-09-21 alone (IW-578, IW-583, IW-491, IW-581). Two smaller costs come with it: a wasted claude process, ~2 GB at a moment when the memory guard is killing runs, and a race in which the launched triage and the bootstrap's own triage both write `analysis.md`. **The workspace is not the harm.** It is where the built-in `SessionSetup` hooks run — `DirenvSetup` and `ZvecGrepIndexSetup`. `iw open` creates a workspace deliberately and launches nothing, which is exactly the shape the unattended path wants. So the ask is `iw start` **minus the `SessionAction` hook**: create the worktree, register it with the dashboard, create the workspace, run `direnv allow` and build the zg index, and launch no agent. The earlier design note argued for skipping the workspace and the hook together, because the name `--no-session` led it there. That is wider than the goal and it costs the setup work. A worktree with no zg index changes how an unattended agent searches code, which is the subject of a running observation (dev-docs DEVDOCS-293), and `--no-session` would change it silently. **Name it for what it skips: `--no-agent`.** It is generic — the hook launches whatever agent is installed — and it stays true if the agent is not Claude. Out of scope: a flag together with `--prompt` is a contradiction and should be refused before any work, the way `phase-pr` refuses `--batch` with `--no-wait`.
claude changed title from iw start cannot make a worktree without a session, which the unattended path does not want to iw start always launches an agent, so the unattended path must find a PID and kill it 2026-09-21 17:54:10 +00:00
mph closed this issue 2026-09-21 19:27:52 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#581
No description provided.