[BUG] /btw question re-executes after exiting debug view (Ctrl+O) during subagent task

Resolved 💬 2 comments Opened Apr 8, 2026 by mostafa20021212 Closed May 23, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using /btw during an active task with subagents, the question is unexpectedly re-executed after toggling debug view with Ctrl+O.

Specifically:

/btw works correctly at first (returns an overlay answer)
After opening debug view (Ctrl+O) and returning
Claude re-runs the /btw query automatically and answers it again

This should not happen because /btw is designed to be ephemeral and not part of the main conversation state.

What Should Happen?

/btw should execute only once
It should not persist in conversation history
Toggling debug view (Ctrl+O) should not cause it to re-run

Error Messages/Logs

No explicit error message
Behavior issue (unexpected duplicate execution)

Steps to Reproduce

Start a Claude Code session
Run a task that triggers a subagent (e.g., code analysis or multi-step task)

While the task is running, execute:

/btw <any question>
Observe Claude answers correctly
Press Ctrl+O to open debug/verbose view
Exit debug view
Result:

Claude automatically answers the same /btw question again

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.97

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

This issue seems related to:

/btw being incorrectly restored into active state
or debug mode (Ctrl+O) replaying interaction context

It may be caused by:

improper separation between ephemeral /btw context and main agent state
or UI/debug layer re-triggering last command

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗