{"version":"2.1.317","anchor":"new-session-writes-lost-system-message-and-full-disk-exit-ha","canonical_anchor":"new-session-writes-lost-system-message-and-full-disk-exit-ha","heading":"claude -p now reports session data lost to a full disk","tier":"notice","area":"Headless Mode","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317\/e\/new-session-writes-lost-system-message-and-full-disk-exit-ha","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.317","markdown":"### `claude -p` now reports session data lost to a full disk\n\nIf a full disk or used-up quota stops Claude Code saving session data in print mode, it now reports this when the run ends\n\n**What**\n\nPrint mode is the way to run Claude Code once from a script, with `claude -p`, instead of in an interactive chat. When such a run ends, Claude Code now checks whether any writes were lost because the disk was full (ENOSPC) or a disk quota was used up (EDQUOT). It checks two kinds of write:\n\n- the session transcript, which is the saved record of the conversation\n\n- `~\/.claude.json`\n\nIf writes were lost:\n\n- An error is written to stderr, the error output stream.\n\n- Runs with `stream-json` output also get a system message with the subtype `session_writes_lost`.\n\n- Runs with any other output format exit with code 1, which scripts treat as a failure.\n\nThe check is skipped for runs started with `--sdk-url`. The message is never sent there or in Claude Desktop. The check sits behind a remote switch whose built-in default is on, so it applies unless it is switched off remotely.\n\n**Why**\n\nBefore, lines could be dropped from the transcript without any sign. Scripts that run `claude -p` can now notice when a full disk caused this.\n\n- Flag `tengu_rosy_crab`: Not enough to say (read for one account on one subscription tier against v2.1.317; this account: no value returned, anonymous baseline: no value returned, compiled default: on) These values were read against a different version of Claude Code, so treat them as the nearest reading available instead of one taken on this release.\n- Area: Headless Mode\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}