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
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.
- Nov 19, 2026Anthropic goes public and raises $81.3 billion, beating SpaceX's $75 billion record
- Nov 19, 2026Amazon and Google's Anthropic Stakes Valued at $308 Billion in IPO at $83 a Share
- Nov 19, 2026Google's Gemini 4 Neon runs twice as fast as Carbon and costs 17% less per task
- Nov 19, 2026The same Gemma 4 wrote a backend that passed 80% of checks in opencode, but only 41% in OpenHands
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).
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.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.