[BUG] Resuming sessions doesn't work in non-interactive mode (Claude Code SDK)
Resolved 💬 7 comments Opened Jul 19, 2025 by presmihaylov Closed Aug 4, 2025
I'm running in MacOS and run the following commands:
$ claude -p --session-id 0f096bd6-56cd-4fc4-aaa2-331954a6d83e "hello"
Hello! I'm Claude Code, ready to help you with software engineering tasks. What would you like me to work on?
$ claude -p --resume 0f096bd6-56cd-4fc4-aaa2-331954a6d83e "what is 2+2"
4
$ claude -p --resume 0f096bd6-56cd-4fc4-aaa2-331954a6d83e "what did i jsut ask"
You asked "hello" - which was a greeting.
Notice how claude is not aware of my previous conversations in this session. It seems that --resume doesn't work at all in non-interactive mode.
This prevents a lot of potential SDK integrations from being built.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗