Skip to content

[BUG] Resuming a conversation by session ID broken in print mode #1967

Description

@swerner

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other:
  • Claude CLI version: 1.0.19 (Claude Code)
  • Operating System: macOS 145.5
  • Terminal: Ghostty

Bug Description

When attempting to resume a session by session ID in print mode like:
claude -p -r {session_id} "{prompt}"

I get an error of:
"No conversation found with session ID: {session_id}"

When running the command not in print mode like this it resumes the session correctly:
claude -r {session_id}

I would expect session ID to be usable regardless of the -p flag usage or not.

Steps to Reproduce

  1. claude -p "describe this project in 2 sentences" --output-format json
  2. Grab the session id that was output
  3. claude -p -r {session_id} "expand on that a bit" --output-format json

Expected Behavior

The previous session to continue further and output another blob of json

Actual Behavior

output of: No conversation found with session ID: {session_id}

Additional Context

It resumes the session just fine if I leave the -p flag off

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions