{"version":"2.1.311","anchor":"quiet-background-wait-in-headlessprint-mode-uses-a-long-sle","canonical_anchor":"quiet-background-wait-in-headlessprint-mode-uses-a-long-sle","heading":"Print mode waits quietly on background shells instead of polling every 100ms","tier":"notice","area":"Print Mode","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.311\/e\/quiet-background-wait-in-headlessprint-mode-uses-a-long-sle","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.311","markdown":"### Print mode waits quietly on background shells instead of polling every 100ms\n\nIn print mode, waiting on background shells now sleeps until something changes instead of checking every 100ms, with a new env var to restore polling\n\n**What**\n\nIn print mode (`-p`), Claude Code answers once and exits, but it may first wait for background work to finish. The way it waits after a turn has been reworked:\n\n- Quiet wait: when the only background work still running is shell commands (`local_bash`) and nothing else is pending, Claude Code now sleeps until something changes. It wakes when the message queue, its internal state or the session state changes. Before, it checked every 100 milliseconds.\n\n- `CLAUDE_CODE_DISABLE_QUIET_BACKGROUND_WAIT`: a new environment variable (a named value you set in your shell before starting a program). Setting it restores the old 100ms checking.\n\n- Wait ceiling: the stop path for the maximum wait still reads the `tengu_print_ceiling_stop_agents` flag (fallback true), and `tengu_giggly_dragonfly` still has fallback true. Nothing has been read about either flag. Its message still says that setting `CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=0` makes Claude Code wait indefinitely. The keep-alive logic around these flags was reworked to fit the new wait.\n\n**Why**\n\nHeadless runs that sit waiting on background shells should wake up the computer less often while idle. If the new waiting causes trouble, the environment variable switches back to the old behaviour.\n\n- Area: Print Mode\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}