claude-code - 💡(How to fix) Fix [FEATURE] Open a read-only side chat from a REPL text selection [2 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#48099Fetched 2026-04-15 06:33:14
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Timeline (top)
commented ×2labeled ×2

Root Cause

  1. I ask Claude to grep for all usages of a function across the codebase.
  2. The tool returns 40 hits.
  3. I select hit #17 because it "looks weird" and open a side chat on it.
  4. In the side chat I ask: "Read this file and tell me why this usage looks different from the others."
  5. I get my answer, close the side chat, and the main planning conversation continues from where it was.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

When working through long-form tasks in Claude Code (writing drafts, exploring code, reviewing tool output), I frequently want to dig deeper on ONE specific chunk of Claude's output without letting that tangent pollute the main conversation. Today, any follow-up question gets appended to the main thread, which:

  1. Derails outline-level conversations with micro-edits (e.g. writing a book chapter, then 20 turns rephrasing one paragraph)
  2. Inflates the main session's context with side exploration it doesn't need to "remember"
  3. Pushes the main session toward its context limit faster than necessary

There is currently no way to branch off a short, focused sub-conversation anchored to a specific piece of Claude's prior output.

Proposed Solution

Let the user select text in the REPL output and open a side chat from that selection.

Trigger. Select text in the REPL (selection + copy-on-select already works today in fullscreen mode), then press a hotkey (e.g. Ctrl+Shift+K) or right-click and pick "Open in side chat".

UI. A side panel (split view) or a modal overlay similar to the Ctrl+O transcript view, containing:

  • The selected text pinned at the top as an "anchor"
  • A fresh input prompt scoped to that side thread
  • A visible indicator that the context is forked and read-only

Context. The side chat inherits the main session's context as read-only:

  • Can see prior messages, tool results, CWD, project files
  • Write tools (Edit, Write, mutating Bash) off by default; reads and web fetch on; configurable toggle for users who want to let the side chat try a fix in isolation
  • Any side-chat messages and tool calls are never appended to the main session

Lifecycle. Closing the side chat discards it, or optionally saves a transcript to .claude/sidechats/ with a timestamp. The main session is untouched either way.

Multiple side chats. Ideally N concurrent side chats, listed in a sidebar. One-at-a-time would be an acceptable v1.

Alternative Solutions

  • Second terminal running claude. Loses all context; I have to manually recreate the shared state and re-read the same files.
  • Ask inline and accept the pollution. Works, but bloats the main thread and wastes context on one-off tangents.
  • /resume after the fact. Too heavyweight and breaks flow; requires finishing, exiting, resuming, then continuing.
  • Copy/paste into claude.ai. No tool access, no project context, different auth.

None of these preserve the "right where I am, same context, temporary" shape of the workflow.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

Scenario 1: writing a book.

  1. I ask Claude to draft Chapter 3 of a book I'm writing.
  2. Claude produces a 2000-word draft.
  3. I select paragraph 4 ("The protagonist arrives at the harbor...") and open a side chat anchored to it.
  4. In the side chat I ask: "Give me three alternative openings for this paragraph with more sensory detail."
  5. Claude replies with three options. I read them, close the side chat, and manually edit the chosen phrasing into the main draft (or decide none of them work and just close).
  6. The main conversation has no record of the side exploration. My next main-thread message is still about the overall chapter structure, not buried under paragraph-level nits.

Scenario 2: exploring tool output.

  1. I ask Claude to grep for all usages of a function across the codebase.
  2. The tool returns 40 hits.
  3. I select hit #17 because it "looks weird" and open a side chat on it.
  4. In the side chat I ask: "Read this file and tell me why this usage looks different from the others."
  5. I get my answer, close the side chat, and the main planning conversation continues from where it was.

Additional Context

Technical feasibility notes (from an end-user perspective, based on observed behavior):

  • Selection detection already exists. In fullscreen / alt-screen mode, Claude Code already tracks mouse-driven text selection and auto-copies to clipboard on mouse-up (iTerm2-style). The selected string is already available client-side, so no new terminal plumbing appears necessary for the trigger.
  • IDE selection passthrough already exists. When running alongside VS Code / Cursor / Windsurf, editor selections already flow to the agent. The same mechanism could reasonably trigger a side chat from a REPL selection.
  • Prior art for overlay UI. The Ctrl+O transcript overlay demonstrates a temporary alt-screen panel that does not clobber the main view. A similar pattern could host the side-chat UI without disrupting the main REPL.

Known constraints the maintainers should know up front:

  • Outside fullscreen mode (streaming REPL, scrollback), the native terminal owns text selection. The feature would likely need to be alt-screen-only for the REPL case, or require the IDE extension for the streaming / non-fullscreen case.
  • An MVP does not need persistent side-chat history; discard-on-close is fine.
  • The "read-only context" model is the important safety property. It is fine for v1 to be strict about this (no write tools at all) and relax later.

extent analysis

TL;DR

Implement a side chat feature that allows users to select text in the REPL output and open a new conversation scoped to that selection, without polluting the main conversation thread.

Guidance

  • Identify the technical requirements for detecting text selection in the REPL output and triggering a side chat, considering the existing selection detection and IDE selection passthrough mechanisms.
  • Design a UI for the side chat that includes the selected text as an anchor, a fresh input prompt, and a visible indicator of the forked and read-only context.
  • Determine how to implement the read-only context inheritance from the main session, including access to prior messages, tool results, and project files.
  • Plan for the lifecycle of the side chat, including closing and optionally saving a transcript, without affecting the main session.

Example

No code snippet is provided as the issue focuses on the feature request and high-level design.

Notes

The implementation of the side chat feature may require consideration of the technical constraints mentioned, such as the need for alt-screen-only support in the REPL case or the use of the IDE extension for non-fullscreen cases.

Recommendation

Apply a workaround by using the existing /resume feature or copying and pasting into a separate Claude instance, although these solutions do not fully address the requested functionality. A better approach would be to implement the proposed side chat feature, which would require significant development effort.

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