Skip to content

fix(box): a new claude chat opens in its terminal before its first prompt - #168

Merged
sean-brydon merged 1 commit into
mainfrom
i-m-getting-an
Oct 19, 2026
Merged

sean-brydon merged 1 commit into
mainfrom
i-m-getting-an

Conversation

@pumfleet

Copy link
Copy Markdown
Contributor

What broke

Start a Claude chat in a new worktree, switch it to the terminal before sending anything: the pane flashes a red No conversation found with session ID: …, the session ends and the tab goes with it.

Claude Code learns its conversation id at startup (its SessionStart hooks' hook_started/hook_response events carry session_id), so toTerminal's "hasn't started yet" guard passed. But Claude saves the conversation only at its first prompt, so claude --resume <id> found nothing and exited. The chat's own restart (launchClaudeIn with a resume id) failed the same way (error_during_execution).

The fix

  • toTerminal (switch.go): when Claude's transcript for the id isn't there yet (claudeFile), the TUI starts with --session-id <id>, and the handoff points at where it will write, from 0, so what's typed there is imported going back.
  • launchClaudeIn (claudedriver.go): a resume id becomes --session-id when the conversation's log has had nothing said in it (prompted: no user line sent, nothing imported). carryOn always imports its history first, so it still resumes.

Tests

  • The fake stream Claude now behaves like the real one: hook events with session_id at startup, transcript saved at the first prompt, --resume of an unsaved id fails with Claude's message, --session-id of a saved one is refused.
  • TestAStructuredSessionNeverPromptedGoesToItsTerminalAndBack fails on main and passes here.
  • TestAClaudeConversationIsResumedOnlyOnceSomethingWasSaid covers the flag choice.
  • go vet ./... && go test -race ./... pass; docs build passes.

🤖 Generated with Claude Code

…ompt

Claude Code names a conversation at its start (SessionStart hooks carry
the id) but saves it only at its first prompt, so `--resume` of a chat
nobody had written in yet printed "No conversation found" and quit,
ending the session. The terminal, and the chat started again, now use
`--session-id` until something has been said.

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

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
berth Building Building Preview Oct 19, 2026 4:12pm UTC
berth-docs Ready Ready Preview Oct 19, 2026 4:12pm UTC

Request Review

@sean-brydon
sean-brydon merged commit 15c4e51 into main Oct 19, 2026
8 checks passed
@linear-code

linear-code Bot commented Oct 19, 2026

Copy link
Copy Markdown

ENG-6465

This branch was successfully deployed

2 active deployments
Preview – berth-docs — 5312b552 Deployed Oct 19, 2026 by vercel[bot]
Preview – berth — 5312b552 Deployed Oct 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci Run CI on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants