{"version":"2.1.329","anchor":"scratchpad-dir-override-via-claude-code-scratchpad-dir-arti","canonical_anchor":"scratchpad-dir-override-via-claude-code-scratchpad-dir-arti","heading":"Scratchpad folder can be set with an environment variable","tier":"use","area":"Artifacts","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.329\/e\/scratchpad-dir-override-via-claude-code-scratchpad-dir-arti","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.329","markdown":"### Scratchpad folder can be set with an environment variable\n\nClaude Code reads `CLAUDE_CODE_SCRATCHPAD_DIR` as a scratchpad folder, but only if the path ends in a folder named `.artifact-work`\n\n**Unclear.** It is not stated what Claude Code puts in the scratchpad folder or when it uses it.\n\n**What**\n\nClaude Code now reads an environment variable, `CLAUDE_CODE_SCRATCHPAD_DIR`. An environment variable is a named value you set in your terminal before starting a program. It names a scratchpad folder, a working area for files tied to artifact work.\n\nClaude Code accepts the value only when all of these are true:\n\n- The path is absolute, meaning it starts from the root of the drive.\n\n- The path is already in its simplest form, with no shortcuts such as `..`.\n\n- The last folder in the path is named `.artifact-work`.\n\n- The path passes some further checks.\n\nIf any check fails, Claude Code ignores the variable as if it were not set.\n\n**Why**\n\nThis gives artifact work a scratch location you can choose from the environment. Because a wrong path is silently ignored, make sure the folder you point it at ends in `.artifact-work`.\n\n- Area: Artifacts\n- Names: `CLAUDE_CODE_SCRATCHPAD_DIR`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}