Skip to content

Stop Claude from acting on its own after /muse:stop - #6

Open
webandseo wants to merge 2 commits into
rtravellin:mainfrom
webandseo:fix/stop-guardrail
Open

webandseo wants to merge 2 commits into
rtravellin:mainfrom
webandseo:fix/stop-guardrail

Conversation

@webandseo

Copy link
Copy Markdown
Contributor

commands/stop.md ran the bridge and gave Claude no instructions about what to do with the result. After a user cancelled a run, Claude was free to read that as "the task is still open" and start a new run, resume the cancelled one, or carry on with the task itself, which is the opposite of what someone typing /muse:stop wants.

The command now tells Claude to present the bridge output and stop there:

  • no new, restarted or resumed Muse run;
  • no continuing or finishing the cancelled task itself;
  • no editing or reverting files. For a write-capable run it says the run may have left partial edits in the working tree and leaves the decision to the user.

Prompt-only change: five lines in commands/stop.md, no bridge code touched.

  • commands.test.mjs: asserts stop.md carries each of those instructions, in the same style as the other command-file tests.
  • CHANGELOG entry under Unreleased.

Independent of #2 to #5 apart from the shared top line of the CHANGELOG's Unreleased section; I'll rebase whichever lands later.

Tests: 109/109 locally on Windows.

🤖 Generated with Claude Code

@rtravellin rtravellin left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, one small gap.

commands/stop.md:13: the new instruction says to mention possible partial edits "if it was a write-capable run", but nothing in the stop output tells the model whether it was. renderCancelReport (scripts/lib/render.mjs) and the already-ended message in muse-bridge.mjs only print the run id, title, summary and whether the kill was delivered, and the command only allows Bash(node:*) and says to stop there. So the warning ends up either dropped after stopping a run --write delegate, or added after every read-only run.

Suggested fix: include write / worktree in the stop report, and for --worktree runs say the edits are in the separate checkout rather than the main working tree.

This will also need a rebase: #2 and #3 are merged and the CHANGELOG Unreleased section conflicts.

webandseo and others added 2 commits October 4, 2026 13:47
The command ran the bridge and gave Claude no instructions, so Claude
could restart the run or finish the task itself after the user cancelled
it. It now reports the cancellation and forbids a new or resumed run,
finishing the task, and editing or reverting files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stop.md told Claude to mention partial edits "if it was a write-capable
run", but the stop output never said. The report now has a Mode line
(read-only, write-capable, or write-capable in its own worktree) on every
stop path, --json carries write and worktree, and stop.md keys the
warning off that line. Records without the flag get no line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@webandseo

Copy link
Copy Markdown
Contributor Author

Fixed in c6f8e66: the stop report now has a Mode: line on every path (read-only / write-capable / write-capable in its own worktree, with the edits in that worktree), --json carries write and worktree, and stop.md keys the warning off that line. Records without the flag get no line rather than a guess. Rebased on main. If #7 lands first, I'll add the same line to its "already finished" message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants