Skip to content
BENIBIX Learn

CLAUDE_CODE_TMPDIR

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_TMPDIR=/var/tmp

It moves the folder where Claude Code keeps scratch files.

Think of it like

It is like you choose which drawer holds your scrap paper.

Example

Jack's server has a tiny /tmp that fills up. He points this at a bigger disk.

Why it matters

A full or locked temp folder can break tools in strange ways.

Definition

CLAUDE_CODE_TMPDIR moves the folder Claude Code uses for its own scratch files. Claude Code adds a folder of its own under it, named after your user on Mac and Linux. By default it is /tmp on a Mac and the system temp folder elsewhere. Project settings ignore it.

Example code

bash
export CLAUDE_CODE_TMPDIR=/var/tmp
claude
Keep scratch files off a small /tmp.

Common mistake

Expecting every Bash command to use it. Commands outside the sandbox keep your shell's own temp folder.

Key takeaways

  1. 1
    Moves scratch files. Claude Code's own.
  2. 2
    Adds its own folder. Per user.
  3. 3
    Not project settings. Shell or user.