Free Intensive Nov 21–22Free 2-day hands-on Vibecoding Intensive on Nov 21–22 at 16:00 MSK (Sat–Sun) · Live Cohort 3 starts Nov 23Join Free →Cohort 3 (Nov 23)
ReleaseAPI / Product · ActionableHabr AI→ original

Banned from Claude Code: 5 Files with IDs and Tokens to Clean Off Your Disk

If Claude has blocked your account, open it in a browser first: it offers an appeal form and a data export, and you don't need to clean your disk to use either. Claude Code stores two random IDs (userID and machineID) on your computer in ~/.claude.json, and login tokens in ~/.claude/.credentials.json. If you need a different account, delete these files along with their backups. A leaked API key, however, has to be revoked with the provider.

AI-processed from Habr AI; edited by Hamidun News
Banned from Claude Code: 5 Files with IDs and Tokens to Clean Off Your Disk
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1/logout in the CLI is the standard way to sign out of the account on this computer
Key metric #2The script does not clean settings.json, environment variables, or .claude/ directories inside projects
Key metric #3The author did not verify through network traffic whether the IDs are sent with every request

Picture this: you open Claude and, instead of the usual window, you see a lockout screen. Your first thought is to erase everything related to Claude Code right away and "start with a clean slate." The author of a write-up on Habr advises against rushing: you don't need to clean your computer to file an appeal, and Claude Code stores identifiers and tokens in exactly five places locally. That is what this article covers. The practical upshot: you learn what on your disk belongs to the account, what you can safely delete when switching accounts, and which secrets the cleanup script does not touch.

Appeal first, cleanup second

If a lockout screen appears when you sign in, open your account in a browser. On the restriction screen, Anthropic shows the available actions: an appeal form and, in the cases where it is provided, a data export. It is better to do this before touching any files. If the problem stems from an account suspension, support handles it through the appeal form. The write-up makes no claim that cleaning files on your computer lifts a block.

If your goal is simpler, such as finishing work on this machine, the standard /logout command inside the CLI is enough. API keys are a different story. Suppose a separate key from a project falls into someone else's hands: deleting the local file won't help, because a secret that has already been copied keeps working. You have to revoke the key with the provider.

What Claude Code stores on disk

The main file is ~/.claude.json. It holds three groups of data:

  • userID is a random identifier created on first launch: 32 bytes, written as 64 hexadecimal characters. It stays in the config regardless of which account you sign in to;
  • machineID is a second random identifier in the same format. The error-reporting code uses its 12-character prefix. It is not a hardware serial number and not the system /etc/machine-id;
  • oauthAccount holds account details: the account and organization UUIDs, email, and subscription parameters. The server sends them during authorization.

The other locations:

  • ~/.claude/.credentials.json holds access and refresh tokens with their expiry times and permissions; they are tied to the account;
  • ~/.claude/.claude.json and ~/.claude/.config.json are possible alternative configs. Check them only if the files exist; the first may contain a separate userID and machineID pair;
  • ~/.claude/backups/.claude.json.backup.* are config backups that may retain the old IDs.

The author did not find an anonymousId identifier of the form claudeco… in the version he tested or in the config.

What the cleanup script does and does not do

For switching accounts, the author suggests this sequence: close all Claude Code processes, delete ~/.claude.json and ~/.claude/.credentials.json, then the alternative configs and backups, remove old keys from environment variables and settings.json, restart Claude, and sign in only to the new account without restoring the old config.

The scripts from the claude-code-config-audit repository automate the same steps for Linux, macOS, and Windows (PowerShell). They terminate claude processes, delete the files listed above, and print a list of what was removed. After running them, open a new terminal so the environment variables reset. Save any important data before you run them.

There are limitations. The scripts do not modify settings.json, so you will have to remove API keys and tokens from it manually. They do not clear environment variables in the current session, and they do not delete project settings from .claude/ directories inside repositories. They do not guarantee full anonymization: that requires additional measures.

The author adds a separate caveat: he did not directly verify whether userID and machineID are sent with every request to the model. To make that claim about a specific CLI version, you would need to observe the network traffic, and the write-up did not include that measurement.

The practical takeaway: appeal and export your data first, then clean up. Revoke secrets with the provider rather than just erasing them locally. The instructions do include curl | bash commands, but they also list a safer option: clone the repository and run the script locally after reading its code first.

Story

Key Questions Answered

What are the key details on Appeal first, cleanup second?

If a lockout screen appears when you sign in, open your account in a browser. On the restriction screen, Anthropic shows the available actions: an appeal form and, in the cases where it is provided, a data export. It is better to do this before touching any files. If the problem stems from an account suspension, support handles it through the appeal form. The write-up makes no claim that cleaning files on your computer lifts a block.

What Claude Code stores on disk?

The main file is ~/.claude.json. It holds three groups of data: userID is a random identifier created on first launch: 32 bytes, written as 64 hexadecimal characters. It stays in the config regardless of which account you sign in to; machineID is a second random identifier in the same format. The error-reporting code uses its 12-character prefix.

What the cleanup script does and does not do?

For switching accounts, the author suggests this sequence: close all Claude Code processes, delete ~/.claude.json and ~/.claude/.credentials.json, then the alternative configs and backups, remove old keys from environment variables and settings.json, restart Claude, and sign in only to the new account without restoring the old config. The scripts from the claude-code-config-audit repository automate the same steps for Linux, macOS, and Windows (PowerShell).

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…