claude-code - 💡(How to fix) Fix [Bug] Plan mode state changes don't emit system reminders, causing agent desynchronization [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54206Fetched 2026-04-29 06:33:28
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

Error Message

[{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T06:32:50.328Z"}]

Code Example

[{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T06:32:50.328Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description Title: Plan mode silently desyncs — agent acts as if exited while user expects it active

Repro:

  1. User enters plan mode.
  2. Agent writes plan, calls ExitPlanMode.
  3. System reminder fires: ## Exited Plan Mode + ## Auto Mode Active.
  4. Agent acts (correct).
  5. User flips plan mode back on via UI shortcut/toggle (no explicit text in transcript).
  6. Next user message arrives WITHOUT a Plan mode is active system reminder — at least none visible to the agent in the next turn.
  7. Agent proceeds to edit files freely, thinking it's still in auto mode.

Expected: every user-driven plan-mode toggle should fire a Plan mode is active/Exited Plan Mode system reminder on the very next agent turn, so the agent can't drift.

Actual: the agent's last-seen "Auto Mode Active" reminder persists in its mental model. Subsequent edits violate plan mode but neither agent nor harness raises an alarm until the user notices.

Impact: silent rule-bypass; trust erosion. Especially bad when the user toggles plan mode mid-session as a "stop and let's design first" signal — exact moment they need the agent to obey.

Environment Info

  • Platform: linux
  • Terminal: tmux
  • Version: 2.1.121
  • Feedback ID: 25b98b0c-5d4b-492e-a9b1-5fbb4d60ecfb

Errors

[{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-28T06:32:50.328Z"}]

extent analysis

TL;DR

The agent's failure to receive a "Plan mode is active" system reminder after the user toggles plan mode back on may be due to a desynchronization issue, and a potential fix could involve ensuring that the agent receives an explicit reminder after every plan mode toggle.

Guidance

  • Investigate the ExitPlanMode call and the system reminder firing mechanism to ensure that they are correctly handling the plan mode toggle events.
  • Verify that the agent's mental model is being updated correctly after each plan mode toggle, and that it is not relying on a cached or outdated state.
  • Check the error message "Request was aborted" to see if it is related to the desynchronization issue, and if it can provide any clues about the root cause of the problem.
  • Consider adding additional logging or debugging statements to track the agent's state and the system reminders to better understand the issue.

Example

No code snippet is provided as the issue does not contain enough information to create a specific example.

Notes

The issue seems to be related to a desynchronization between the agent's mental model and the actual plan mode state, but the root cause is not entirely clear. Further investigation is needed to determine the exact cause of the problem.

Recommendation

Apply workaround: Implement a mechanism to ensure that the agent receives an explicit "Plan mode is active" system reminder after every plan mode toggle, to prevent the agent from acting as if it is in auto mode when it is actually in plan mode. This can help mitigate the issue until the root cause is identified and fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING