{"version":"2.1.281","anchor":"headless-input-reader-tracks-unconsumed-stdin-to-decide-whet","canonical_anchor":"headless-input-reader-tracks-unconsumed-stdin-to-decide-whet","heading":"Headless input reader tracks unconsumed stdin to decide whether the session is busy","tier":"internal","area":"SDK","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281\/e\/headless-input-reader-tracks-unconsumed-stdin-to-decide-whet","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281","markdown":"### Headless input reader tracks unconsumed stdin to decide whether the session is busy\n\nPrint and SDK sessions now count unread input as work and do not finish while some is waiting\n\n**What**\n\nIn print mode (running with `-p`) and when Claude Code is driven by another program (the SDK), it reads its input line by line. It now keeps a `hasUnconsumedInput` flag. The flag is set when a non-blank line is waiting to be processed and is cleared once that line has been read.\n\nWhen Claude Code decides whether it is still busy, it now counts that waiting input, together with a turn that is still running and questions that are waiting for an answer.\n\n**Why**\n\nA session is less likely to finish while input sent to it has not been handled yet.\n\n- Area: SDK\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5"}