Resume is broken in -p mode
Using 1.0.30, when I start a task with -p mode, I get the task id, and then attempt to resume and it creates an entirely new task id and doesn't have the memory of the previous one:
FIRST: claude -p "create a hello world c program" --dangerously-skip-permissions --output-format stream-json --verbose session_id":"d247198c-a305-4c75-be27-b50bd7251ed2"
SECOND: claude -p "change it to universe" --dangerously-skip-permissions --output-format stream-json --verbose --resume d247198c-a305-4c75-be27-b50bd7251ed2
it changes session id to "session_id":"a7899bdd-2f50-4a83-93f2-f9878d750d07" and has no memory of previous convo
Resume creating a new session id is expected.
and has no memory of previous convo
are you seeing the second invocation (with --resume) not actually resuming the conversation and just starting fresh?
Hi @levpopov, could you help clarify why non-interactive mode creates a new session ID while REPL doesn't? I'm also curious about the caching implications. Does creating a new session mean cache isn't utilized? This seems to be creating challenges for tools like https://github.com/siteboon/claudecodeui that build on the non-interactive mode.
Resume creating a new session id is expected.
and has no memory of previous convo
are you seeing the second invocation (with --resume) not actually resuming the conversation and just starting fresh?
@levpopov can you explain why resume creating a new session id is expected? It creates a new .jsonl file with copied contents from the original session instead of adding to the original session, bloating storage and making it very difficult to create tools and applications that can properly track session state.