{"version":"2.1.336","anchor":"artifact-write-supports-in-memory-staging","canonical_anchor":"artifact-write-supports-in-memory-staging","heading":"File writes can now be staged in memory with an in_memory option","tier":"internal","area":"File Writes","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336\/e\/artifact-write-supports-in-memory-staging","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336","markdown":"### File writes can now be staged in memory with an in_memory option\n\nChunked and archive file writes accept an in_memory option to stage data in memory when possible, falling back to the disk\n\n**Unclear.** It is not clear what turns the in-memory option on.\n\n**What**\n\nWhen Claude Code writes a file in pieces (a chunked or archive write, used for things like artifacts and file transfers), the data is first staged, meaning held somewhere temporary before being put in its final place. Before, staging always went to disk through a directory handle. Now:\n\n- The write and abandon requests accept a new `in_memory` option.\n\n- A mode passed as `\"if_possible\"` lets the write be staged in memory, with a fallback to the disk when it cannot (for example, when the write has already begun on the disk).\n\n- The write's output now includes an `in_memory` field saying how it was staged.\n\n- The final placing step now tracks the path of a kept file and checks `willWrite` before writing.\n\n**Why**\n\nThis changes where files are held while they are being written. In practice, some writes can now skip a temporary copy on disk, and the reported `in_memory` field shows which path a given write took.\n\n- Area: File Writes\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}