Feature Request: Auto-exit

Resolved 💬 6 comments Opened Feb 27, 2025 by djrodgerspryor Closed Jan 4, 2026

I'm using claude semi-interactively, and I'd love to be able to get it to do some work and then exit. This would allow for external tools that verify the work and possibly try again and for normal unix composition with other commands, for example:

claude "run `cargo build` and fix all of the errors until the build passes" && cargo test

I know about the --print option, but that disables all file-modification and tool use. I'd love an option like --exit-when-finished (or just --non-interactive) which just exits successfully when Claude would normally wait for the next user instruction.

For bonus points, claude could self-assess whether it was successful at following the prompt and return an exit status code if not, but that can be filled in by external tools for now.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗