← Back to BlogSecurity

Infostealer Targets Claude Code Login Files: What to Rotate

Check Point and Symantec report an infostealer that copies Claude Code login files. What it collects, what the sandbox misses, what to rotate.

Malware named Aokigahara is reported to copy Claude Code login and settings files. Symantec described it on October 15, 2026, and Check Point Research published a technical analysis on October 23, 2026. Neither report describes a flaw in Claude Code, and Claude Code's sandbox and deny rules cannot stop this kind of malware, because they limit what the agent does, not what other programs on your machine do. If a machine may be infected, rotate every credential those files could reach, from a clean device.

Sources: Symantec Threat Hunter Team: Aoki, Infostealer Targets AI Coding Assistant Credentials (15 Oct 2026), Check Point Research: Infostealer riding the AI Train (October 23, 2026)

Disclosure: we build TLM Forge, a process layer for Claude Code, so weigh the product section accordingly. That section is short on purpose, because TLM Forge does not address this threat.

What Symantec and Check Point reported

Symantec's Threat Hunter Team calls the malware Aoki, also known as Aokigahara. It says recent versions are designed to harvest credential and session files for AI coding assistants including Claude, OpenAI's Codex, Cursor, Codeium and Gemini, and that older samples did not look for AI-related files, so the capability appears to be a recent addition. The newest version it analyzed targeted .claude.json, Claude desktop cookies, ChatGPT cookies, and the Codex config.toml and .env files. Symantec also says the malware stole credential, token and session files rather than source code, with one exception: Cursor's local state database, which can cache chat context and code snippets.

Sources: Symantec Threat Hunter Team: Aoki, Infostealer Targets AI Coding Assistant Credentials (15 Oct 2026)

Check Point Research describes Aokigahara as a newly observed infostealer seen in the wild, with an aisessions module for AI and developer-tool credentials and sessions. For Claude Code and Claude Desktop, its table of targeted paths lists .claude\credentials.json, .claude.json and two Claude application folders. The same module covers Codex, Cursor, Windsurf, GitHub Copilot, Gemini CLI, Kiro, Amazon Q, JetBrains AI Assistant and the AWS CLI and SSO cache, and it queries Windows Credential Manager. A second module, ide, collects Git credential files, files under .ssh, and AWS, Azure and Google Cloud credential files. Both reports also list browser logins, cryptocurrency wallets, password managers, messaging and VPN data, so AI files are one part of a general-purpose stealer.

Sources: Check Point Research: Infostealer riding the AI Train (October 23, 2026), Check Point Blog: Infostealers Are Targeting AI (October 23, 2026), Symantec Threat Hunter Team: Aoki, Infostealer Targets AI Coding Assistant Credentials (15 Oct 2026)

A related but different incident, in which a compromised npm release harvested AI agent configuration files and planted new ones, is covered in Tensorlake npm Worm Rewrote Your AI Agent Config Files. It also carries its own advice about the order in which to revoke tokens, so follow the advice for the incident you actually have.

What the reports do not establish

  • Delivery: neither report says how the malware reaches a machine, and Check Point gives no victim count.
  • Use of stolen AI credentials: Check Point says it has not confirmed that the operators reused or sold stolen AI credentials, and that its analysis does not confirm how they monetize the data.
  • Contents: Check Point notes that not every targeted file necessarily contains an authentication secret.
  • Attack chain: Check Point says the AI and developer modules are separate, and that the research does not establish that attackers deliberately combine these credentials into a single attack path.
  • Platform: every path in Check Point's table of AI targets is written as a Windows path, and the report does not mention macOS or Linux. That is not evidence that those systems are safe, only that the report does not cover them.
  • Attribution: Symantec says it does not know which threat group is behind the malware.

So the evidence is a description, from two security vendors, of what this malware is built to collect. Neither report documents a Claude account being misused. That points to a proportionate response: find out where your credentials live, make them cheap to replace, and know the rotation steps before you need them.

Where Claude Code keeps your login

Anthropic's authentication documentation says Claude Code stores credentials in the macOS Keychain on macOS. If the Keychain rejects the write, for example when it is locked in an SSH session, Claude Code falls back to ~/.claude/.credentials.json with file mode 0600, which is also what it uses on Linux. On Windows the file is %USERPROFILE%\.claude\.credentials.json, and it inherits the access controls of your user profile directory. Setting CLAUDE_CONFIG_DIR moves the file under that directory.

Sources: Claude Code docs: Authentication, Claude Code docs: Troubleshoot installation and login

The file ~/.claude.json is separate. The .claude directory documentation describes it as holding app state, account details, UI toggles and personal MCP servers. The MCP documentation says local and user scope servers are stored there, and recommends local scope for servers with credentials you do not want in version control. An API key you gave a personal MCP server can therefore sit in the same file Check Point and Symantec both name.

Sources: Claude Code docs: Explore the .claude directory, Claude Code docs: Connect Claude Code to tools via MCP, Check Point Research: Infostealer riding the AI Train (October 23, 2026), Symantec Threat Hunter Team: Aoki, Infostealer Targets AI Coding Assistant Credentials (15 Oct 2026)

One small discrepancy: Check Point's table spells the Claude Code credential file credentials.json, while Claude Code's documentation names it .credentials.json. The report does not explain the difference, so the table is not proof either way about your own file.

Sources: Check Point Research: Infostealer riding the AI Train (October 23, 2026), Claude Code docs: Authentication

File permissions do not change the picture much. A 0600 mode, or the access controls on a Windows profile, keep other user accounts out. Malware running under your own account is not another user. That is our reading of the documentation, not a statement from Anthropic or Check Point, and the report analyzes a Windows sample, so it says nothing about how the macOS Keychain fares.

Environment variables are not clearly safer. Check Point lists environment variables among what its sysinfo module collects, without saying which ones. The same report lists .env files in the Codex and Gemini CLI folders, and a collector for the Desktop, Documents and Downloads folders whose filter list the author says is unconfirmed. A key pasted into a shell profile or an .env file is plaintext on disk either way.

Sources: Check Point Research: Infostealer riding the AI Train (October 23, 2026)

Why the sandbox and deny rules do not cover this

Anthropic's sandboxing documentation is explicit about scope: the sandbox covers shell commands only, and Claude's file tools, hooks and local MCP servers run outside it. By default, sandboxed commands can read most of the machine, including credential files such as ~/.ssh and ~/.aws/credentials, and the documentation says there is no built-in credential deny list, so only the files and variables you list are restricted. The sandbox.credentials setting, added in Claude Code v2.1.187, is how you list them.

Sources: Claude Code docs: Sandboxing, Claude Code release v2.1.187 (GitHub)

That setting guards against a different attacker: a hijacked agent, or a script in a repository, asking a shell command to read your files. An infostealer is a separate program. It is not a command Claude ran, and none of these settings is documented as a defense against it. Permission deny rules share the same limit of governing Claude's own tools, and their gaps even inside that scope are covered in Claude Code Permissions: What Deny Rules Miss.

The table sorts four threats by which controls actually apply to them.

ThreatWhere it runsDo the sandbox and deny rules help?What does help
Infostealer on your PC (the Aokigahara class)A separate program under your user accountNo. They govern Claude Code's tools and the shell commands it runsEndpoint protection, rotation from a clean device, short-lived credentials
Hijacked agent reads ~/.aws/credentials from a shell commandA shell command Claude runsYes for sandboxed commands, if you list the file under sandbox.credentialssandbox.credentials deny entries
Hijacked agent reads the same file with the Read toolClaude Code's built-in file toolNot through the sandbox: the docs say a denyRead entry does not stop the Read tool, and permission rules apply insteadRead deny rules, knowing their gaps
Stolen token used from the attacker's machineThe attacker's own computerNo. Nothing of yours is runningRevoke the token, then rotate what it could reach

If a machine may be infected: a rotation checklist

Treat it as a whole-machine event, not an AI-account event. Check Point recommends that AI sessions and credentials be considered alongside browser, cloud and developer credentials when investigating credential exposure, and both reports list many non-AI targets. Work from a clean device, roughly in this order.

Sources: Check Point Blog: Infostealers Are Targeting AI (October 23, 2026), Symantec Threat Hunter Team: Aoki, Infostealer Targets AI Coding Assistant Credentials (15 Oct 2026)

  • Stop signing in on the suspect machine. A stealer that can read your old login can read a new one. Clean or replace the machine before you sign in to anything on it again.
  • Claude subscription login: revoke the Claude Code authorization tokens on your claude.ai account. Reports in the Claude Code repository describe a Claude Code page in claude.ai settings, at claude.ai/settings/claude-code, that lists authorization tokens with a Revoke Access button. One user says it shows no fragment of the token, so a leaked token cannot be matched to an entry. Another reports that the list does not update after you click Revoke Access and the token only disappears when you reload the page. If you cannot tell which is which, revoke them all and sign in again on each machine you still trust. One commenter on issue 43801 reports that the tokens for the VS Code and Claude in Chrome extensions did not appear in that list, so the list may not show every token. On a machine whose token was revoked, the error reference says Claude Code reports OAuth token revoked and asks you to run /login.
  • Console API keys, including any ANTHROPIC_API_KEY: rotate them in the Claude Console at platform.claude.com/settings/keys and update your secret store. The authentication documentation describes an API key as a static credential, so rotate it by hand.
  • Tokens from claude setup-token: the documentation describes a one-year token that is printed to the terminal and not saved anywhere, so every place you pasted it holds a copy, including shell profiles and CI secrets. It does not describe a revoke command. Users report that tokens made by claude setup-token appear on the same claude.ai page, and that running the command again mints an additional token instead of replacing the old one. So revoke the old token on that page, and mint a replacement only where you need one.
  • MCP servers: the documentation says removing a remote server deletes the tokens Claude Code stored locally but does not revoke them at the issuing authorization server. Its documented route is claude mcp logout <name> before claude mcp remove <name>, which revokes the tokens where the authorization server supports revocation. That command runs in a shell on the machine that holds the stored tokens, which may be the suspect one, so also revoke them in each service's own account settings from a clean device, and rotate any API key you put into a personal MCP server entry.
  • Everything else in the reports' scope: replace Git credentials and SSH keys, rotate AWS, Azure and Google Cloud keys and sign out SSO sessions, sign out of claude.ai and the Claude desktop app on every device (Symantec says the newest version it analyzed targeted Claude desktop cookies), and cycle browser, password-manager and other AI tool sessions.
  • Look for use you did not make: model usage, repository activity and cloud API calls. Symantec notes that a stolen key can be resold or used to run up usage on the victim's account, a practice it says is sometimes called LLMjacking.

When you reissue credentials, scope them narrowly. Least-Privilege Access for AI Coding Agents covers how to size a token to one task.

We found no Anthropic documentation of how quickly revocation takes effect. A GitHub issue opened in April 2026 reported that a token kept working for days after revocation through claude.ai. A repository collaborator closed it on May 19, 2026 with a comment saying it was a server-side issue that was now fixed, and that revoking a Claude Code token now takes effect promptly. Later commenters disagreed: some said the token list did not shrink or that their usage kept climbing after they revoked, while one user who revoked a claude setup-token token on August 5, 2026 found it rejected five minutes later. These are individual reports, so assume revocation may lag, rotate the downstream credentials in the same sitting, and check your usage afterwards.

Sources: anthropics/claude-code issue 43801

Make a stolen file worth less before it happens

  • Prefer credentials that expire. The documentation says apiKeyHelper, a script that returns an API key, is for dynamic or rotating credentials, such as short-lived tokens fetched from a vault. AI Agent Tokens Need Rotation, Not Just Scope covers lifetime and server binding in more depth.
  • Keep the one-year token for automation. The documentation presents claude setup-token for CI pipelines, scripts and other places where interactive browser login is not available. In our view, a CI secret store is a smaller target than a dotfile on a developer laptop.
  • Separate work from everything else. Both reports list browser, wallet, gaming and messaging data next to the AI files, so one infection on a shared personal and work machine exposes all of it. A dedicated work profile or machine limits the haul.
  • Run endpoint protection that detects stealers. Check Point lists monitoring endpoints for information-stealing malware among its recommendations.

Separately, and only against a hijacked agent, you can stop sandboxed commands from reading the files that matter to you. This is the example from Anthropic's sandboxing documentation. Merge it into ~/.claude/settings.json to block sandboxed commands from reading the AWS credentials file and the SSH directory, and to remove two token variables from their environment:

Sources: Claude Code docs: Sandboxing

{"sandbox":{"enabled":true,"credentials":{"files":[{"path":"~/.aws/credentials","mode":"deny"},{"path":"~/.ssh","mode":"deny"}],"envVars":[{"name":"GITHUB_TOKEN","mode":"deny"},{"name":"NPM_TOKEN","mode":"deny"}]}}}

Insight

The snippet protects against a hijacked agent and does nothing against an infostealer. It also sets enabled to true, which turns the sandbox on and restricts shell commands in other ways, so read the sandboxing page before you adopt it. Add more paths or variable names to the same lists for anything else you want hidden from sandboxed commands, since nothing is protected unless you list it. The sandbox runs on macOS, Linux and WSL2. The documentation says Claude Code runs commands unsandboxed on native Windows, so do not rely on this snippet there.

Where TLM Forge fits

Mostly, it does not. An infostealer runs on your operating system, outside any Claude Code session, and TLM Forge works inside the session. It does not detect malware, protect credential files or revoke tokens. The one control that touches nearby ground is the commit hook, which blocks git commit, git push and gh pr merge when the code changed since the final review (Commits and pushes pause if code changes after review). It matches the command text of those three commands in your own session, so someone pushing with a stolen GitHub token from their own machine never passes through it.

The review wave is aimed at the code a task changes, not at the state of your machine. For this problem, use the checklist above, with or without us.

Frequently asked questions

01Can an infostealer steal my Claude Code login?

Security researchers report that one can try. Check Point and Symantec describe the Aokigahara stealer collecting Claude Code files, including .claude.json, and Check Point lists only Windows paths. Neither confirms that stolen AI credentials were reused or sold, and not every targeted file necessarily holds a secret. Treat those files as sensitive anyway.

02Where does Claude Code store its credentials?

Per Anthropic documentation: the macOS Keychain on macOS, with a fallback to ~/.claude/.credentials.json if the Keychain rejects the write. On Linux it is that file with mode 0600, and on Windows it is .credentials.json inside the .claude folder of your user profile. The separate ~/.claude.json holds account details and personal MCP servers.

03Does the Claude Code sandbox protect my credentials from malware?

No. The documentation says the sandbox covers shell commands Claude runs, while file tools, hooks and local MCP servers run outside it. Sandboxed commands can read most of the machine by default. The sandbox.credentials setting helps against a hijacked agent, not against a separate program such as an infostealer.

04How do I revoke a Claude Code token?

Rotate API keys in the Claude Console. For a claude.ai login, user reports describe a Claude Code page in claude.ai settings with a Revoke Access button for authorization tokens. Claude Code's documentation describes no command to revoke a token made by claude setup-token, so revoke it through that page and issue a replacement.

05Should I run claude setup-token on my laptop?

Only if you need it. The documentation presents the one-year token for CI pipelines and scripts where browser login is unavailable, and says the command prints the token without saving it. Every place you paste it keeps a long-lived copy. In our view, a CI secret store is a smaller target than a laptop dotfile.

Ship AI-written code you can trust

TLM Forge is the missing process layer for Claude Code: a spec audit, independent multi-agent review, enforced TDD, and an adversarial red-team gate.

Get TLM Forge