Skip to content

vibe: one ongoing Claude Code session takes the prompts in turn - #46

Open
rossry wants to merge 1 commit into
mainfrom
claude/luminary-vibe-session-e512rh
Open

rossry wants to merge 1 commit into
mainfrom
claude/luminary-vibe-session-e512rh

Conversation

@rossry

@rossry rossry commented Sep 22, 2026

Copy link
Copy Markdown
Owner

What

SessionCoder now keeps one Claude Code session open (the Agent SDK's ClaudeSDKClient) and feeds it the crew's prompts one after another, instead of spawning a session per prompt.

  • It remembers the night. What it shipped and what people asked stay in context, so "like foundation/light-layout/_: add comprehensive planning documentation #3 but slower" works. A generation the session shipped itself is referred to by number in the brief (# you shipped this one earlier … var/vibe/vibe-0003.py) rather than re-sent; a repo pattern's source still travels. The system-prompt addendum tells it every generation is on disk to Read when the crew names a number it doesn't remember (e.g. after a restart).
  • Faster turns. No CLI startup and no re-reading the craft notes per prompt. Live in the sandbox: prompt initial readme #1 took 30 s, prompt foundation/_ #2 in the same session 17 s — and its note shows it built on initial readme #1 ("Tide's breath now takes about two and a half minutes, and a sparse handful of cool-white stars…").
  • Lifecycle. The session lives on its own event-loop thread; the vibe worker blocks on each prompt (serial by construction). A prompt past its wall-clock cutoff (240 s) or a broken session (CLI died, stream error) is dropped and the next prompt lazily starts a fresh one, with the CLI's stderr in the error text. A session idle for 20 minutes is closed. The model switches in place (set_model) when a submitter picks a different one. VibeCore.stop() closes the session, so a server shutdown takes the CLI process with it (verified: clean exit, no orphan).
  • Repair is a follow-up in the same conversation ("The module you just shipped failed on the server: …"), not a fresh brief.
  • The ship tool is bound once per session and dispatches to the prompt in progress.
  • The thread now shows how long each generation took (seconds on each entry, · 17 s beside the model).

Verified

  • Tests: the session backend is driven by a fake ClaudeSDKClient-shaped session via the injectable session_factory — one session across prompts (model switch, self-shipped pointer vs. repo source), broken session dropped and restarted with stderr in the error, runaway prompt cut off, idle close and lazy reopen, spoken-code fallback / error result / repair follow-up, end-to-end on the stage with core.stop() closing the session. Full suite green; black + mypy on CI's lists (with and without the SDK installed locally).
  • Live: serve --stage-key k with the real CLI — two prompts in a row served by the same claude process (same PID), both validated and cut onto the stage, then a clean shutdown.

Docs

README "Vibe mode" backend paragraph, docs/deploy.md backend bullet, plan/spec/implementation-notes.md row.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N97HVk3sAr5jRGYodXcDoC


Generated by Claude Code

SessionCoder now keeps a single session open through the Agent SDK's
ClaudeSDKClient and feeds it each prompt in sequence, instead of
spawning a session per prompt. It remembers the night — what it shipped
and what people asked — so "like #3 but slower" works; a generation it
shipped itself is referred to by number rather than re-sent, and every
generation is on disk for it to Read. The session lives on its own
event-loop thread; the worker blocks on each prompt. A prompt past its
wall-clock cutoff or a broken session is dropped and the next prompt
lazily starts a fresh one; an idle session (20 min) is closed; the
model switches in place per submitter; the server's shutdown closes it.
The ship tool is bound once and dispatches to the prompt in progress.

The thread now shows how long each generation took (entry "seconds").
Live: the second prompt in a session took 17 s against 30 s for the
first, building on it without re-reading anything.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N97HVk3sAr5jRGYodXcDoC
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