[BUG] enableArtifact: false also disables the scratchpad directory
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
"enableArtifact": false in settings.json also removes the Scratchpad directory: line from the system prompt. Artifact publishing and the agent's session temp directory are unrelated features.
isScratchpadEnabled() = P("tengu_scratch", false) || isArtifactToolEligible()
isArtifactToolEligible() = !br() && vl()
br() = !tWe().enabled
tWe() = {enableKey:"enableArtifact", legacyDisableKey:"disableArtifact",
envDisableVar:"CLAUDE_CODE_DISABLE_ARTIFACT", defaultOn:true}
The || isArtifactToolEligible() arm entered in 2.1.186. In 2.1.185 and earlier the expression was P("tengu_scratch", false) alone, so the artifact setting could not affect the scratchpad. disableArtifact already existed then, so this is a change in behavior, not a new setting.
With tengu_scratch off (its default), enableArtifact: false alone now disables the scratchpad. There is no local opt-in for tengu_scratch: getEnvironmentOverrides() returns null, readConfigOverrides() returns undefined, and cachedGrowthBookFeatures is skipped whenever remoteEvalFeatureValues.size > 0. Turning artifacts off is therefore a one-way door.
Builds checked: coupling absent in 121, 161, 174, 179, 183, 185; present in 186, 187, 202, 224, 236, 238, 240, 241, 242, 258, 259, 267, 268, 269.
What Should Happen?
The scratchpad is gated on its own setting, not on enableArtifact.
Steps to Reproduce
- Open an interactive session; the
# Environmentblock names aScratchpad directory:. - Set
"enableArtifact": falsein~/.claude/settings.json. - The session receives
# Environment update: The scratchpad directory announced earlier is no longer available. - Set it back to
true; the line returns.
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.185
Claude Code Version
2.1.269 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell