AppInspected

Fix guides

Your Claude Code settings file can leak the tokens in commands you approved.

Last reviewed November 8, 2026 against the providers' current documentation.

The short version

Open https://yoursite.com/.claude/settings.local.json. If it shows JSON with a permissions list, the file is public: rotate every token, password and connection string in it, then stop deploying the .claude folder. Also check your git history and any npm package you published.

Why it matters

When Claude asks to run a command and you choose "Yes, and don't ask again", Claude Code saves that approval as an allow rule in .claude/settings.local.json, as the command text. If the command had a token in it, like curl -H "Authorization: Bearer ..." or NPM_TOKEN=... npm publish, the token is now in that file. Claude Code keeps the file out of git commits, but anything that copies the project folder without git (an upload, a static host serving the project root, npm publish, a Docker build) takes it along. Lakera found the file in 428 of about 46,500 npm packages it monitored, and credentials in 33 of those files.

Fix it, in this order

  1. Check your live site

    Open https://yoursite.com/.claude/settings.local.json in a private window. If you see JSON with "permissions" and "allow", it's exposed. Your normal homepage or a 404 means it isn't. Our free check requests this path too and only flags real settings files, not your app's fallback page.
  2. Read every rule in the file

    Look inside each Bash(...) rule for anything secret: Authorization: or Bearer headers, TOKEN=, API_KEY=, --password, database URLs like postgres://user:password@host, and token prefixes such as ghp_, github_pat_, npm_ or sk-. Rules that only name a command (Bash(npm run test *)) are harmless on their own.
  3. Rotate what you find

    For each credential, create a new one in that service's dashboard and revoke the old one: GitHub tokens, npm tokens, API keys, database passwords. Deleting the file doesn't help once it was public, because copies may already exist.
  4. Stop shipping the .claude folder

    Deploy your build output (dist/, build/, out/), not the project root. Add .claude/ to .gitignore, and to .npmignore or .dockerignore if you publish packages or build images. Run npm pack --dry-run to see exactly which files a publish would include. As a safety net, block dotfiles at your server:
    location ~ /\.(?!well-known) {
        deny all;
    }
  5. Check git and old packages

    git log --all -- .claude/settings.local.json shows whether the file was ever committed (empty output means never). If you published npm packages from the folder, check older versions too: deprecating a version doesn't remove its files.
  6. Keep secrets out of approved commands

    Pass tokens through environment variables ($GITHUB_TOKEN) or your password manager's CLI instead of typing them into the command, so the saved rule holds the variable name, not the value. The file is plain JSON: you can delete rules that contain secrets, and Claude Code reloads settings when the file changes.

Or ask your AI tool to do it

Paste this into Lovable, Bolt, Cursor, Claude Code or whichever tool built your app. Review what it changes before you deploy.

My Claude Code permission file .claude/settings.local.json may have been published. Read it and list every allow rule that contains a credential (token, password, API key, Authorization header, database URL), with the service each belongs to, so I can rotate them. Then rewrite those rules to use environment variables instead of the values, add .claude/ to .gitignore, .npmignore and .dockerignore where they exist, make sure my host deploys only the build output folder, and tell me whether the file appears anywhere in git history (git log --all -- .claude/settings.local.json).

How this happens

Claude Code creates the file the first time you give a standing approval and keeps adding rules as you approve more commands. Because it's in a hidden folder, nobody looks at it, and the tools that ship a project folder (static hosts, zip uploads, npm publish) don't read your global git excludes.

Check that it's really fixed

After you deploy, run the free check. It reads your live site the way an attacker would and tells you if any secret key is still visible.

Topic check: Claude Code security check

Find the other leaks before someone else does

The free check reads your home page and its scripts. The website security report goes through up to 30 pages and 40 JavaScript files, plus .env and .git files, security headers, cookies and CORS, domain and email records, and libraries with known vulnerabilities. Every finding comes with the fix for your host and a prompt for your AI tool.

$19 once, including 20 runs over 30 days so you can fix things and check again.

Get the report, $19 See an example report

Example report header: a score out of 100, findings by severity, Download PDF and Email me this report.

Questions

Isn't settings.local.json ignored by git already?

Usually. The first time Claude Code writes the file in a git repository, it adds **/.claude/settings.local.json to your global git excludes on that machine. That protects commits, not uploads, npm packages or Docker images, and not a file you created by hand.

What about .claude/settings.json?

That one is meant to be committed and shared with your team, so treat everything in it as public. Never put a secret in its env block or its permission rules.

Does the AppInspected free check look for this?

Yes. It requests /.claude/settings.local.json on your site and flags it only when it returns a real Claude Code settings file. It's rated high, or critical when a rule looks like it contains a token, password or connection string. It can't see your git history or npm packages.

Sources

Related guides