Skip to content

fix: don't resume a Claude session that ended before its first prompt (INC-404) - #512

Merged
arzafran merged 3 commits into
mainfrom
franco/inc-404-skip-empty-session-resume
Oct 30, 2026
Merged

arzafran merged 3 commits into
mainfrom
franco/inc-404-skip-empty-session-resume

Conversation

@arzafran

Copy link
Copy Markdown
Member

If you quit Programa before sending a Claude session its first prompt, the next launch no longer types claude --resume <id> into that pane and fails with "No conversation found". Claude only writes a transcript after the first prompt, so there was nothing to resume.

Ported from cmux #20498, adapted to Programa's own resume store.

What changed

  • Auto-resume on relaunch, the command palette's resume, and programa resume skip a Claude session whose transcript doesn't exist. Other agents are unaffected.
  • The Claude hooks now send the transcript path they get from Claude (transcript_path on agent.event), and the app saves it with the session. Relaunch checks that exact file, so a session run with CLAUDE_CONFIG_DIR set only in your shell still resumes.
  • Sessions saved before this change have no path, so they fall back to searching $CLAUDE_CONFIG_DIR/projects and ~/.claude/projects. A session like that, run under a shell-only CLAUDE_CONFIG_DIR, can be skipped once on the first relaunch after updating.
  • The new field is optional, so older saved sessions still load.

Testing

  • Debug build, structural budgets, and the v2 contract check pass.
  • 22 resume and transcript unit tests pass locally, including new ones for the reported-path check, a missing reported file, decoding a saved session without the field, and keeping the first path reported.
  • tests/test_cli_agent_resume.py covers the session-start hook sending the path; it runs in CI.
  • Not run end to end with a live Claude session.

Fixes INC-404

…script (INC-404)

The transcript check and its tests; the resume paths do not use it yet,
so the relaunch and CLI tests fail until the fix commit.
…t (INC-404)

Claude writes no transcript until the first prompt, so claude --resume
fails with "No conversation found". Relaunch now reopens that pane as a
plain shell, the palette command beeps, and programa resume explains why.
@arzafran
arzafran merged commit d9c8f70 into main Oct 30, 2026
12 checks passed
@arzafran
arzafran deleted the franco/inc-404-skip-empty-session-resume branch October 30, 2026 14:17
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.

1 participant