[BUG] ~/.claude.json can become corrupted if disk space is low

Resolved 💬 3 comments Opened May 3, 2026 by edward-b-1 Closed May 7, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code attempts to write to ~/.claude.json to save configuration changes. If disk space is low (close to zero, or exactly zero), the file may be partially written, with the JSON contents truncated.

This happened on my workstation as a machine learning model ran the disk out of space, claude then crashed while attempting to start up, asked me to sign in again, and when it attempted to write the config file to disk, it corrupted the contents.

What Should Happen?

There should be some kind of write and mv sequence which prevents this.

Error Messages/Logs

Steps to Reproduce

  1. I guess write enough data to disk to reduce disk space to zero
  2. Start claude code, it should fail to start and ask you to sign in
  3. Sign in, this will corrupt the .json config.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.126 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗