Summary
Currently, the only way to stop the harness mid-run is Ctrl+C, which kills the entire process.
Claude Code supports pressing Escape to gracefully interrupt an in-progress agent turn
without exiting the session.
Current behavior
input.rs binds Ctrl+C → ReadOutcome::Cancel / ReadOutcome::Exit
- No
KeyCode::Esc binding exists during an active turn
- No in-flight request cancellation is wired up
Desired behavior
Press Escape while the agent is running to:
- Cancel the active API request
- Transition the worker state from
Running → Interrupted
- Return control to the REPL prompt without exiting the session
Implementation sketch
- Detect
KeyCode::Esc in rusty-claude-cli/src/input.rs during an active turn
- Add an
Interrupted state to the worker lifecycle in runtime/
- Cancel the in-flight HTTP request (e.g., via a
CancellationToken)
- Emit a cancellation event for observability
Summary
Currently, the only way to stop the harness mid-run is Ctrl+C, which kills the entire process.
Claude Code supports pressing Escape to gracefully interrupt an in-progress agent turn
without exiting the session.
Current behavior
input.rsbinds Ctrl+C →ReadOutcome::Cancel/ReadOutcome::ExitKeyCode::Escbinding exists during an active turnDesired behavior
Press Escape while the agent is running to:
Running→InterruptedImplementation sketch
KeyCode::Escinrusty-claude-cli/src/input.rsduring an active turnInterruptedstate to the worker lifecycle inruntime/CancellationToken)