ShipShape

Guide

Keep AI agent settings files out of git

“Yes, and don’t ask again” can save the exact command, including a password, in .claude/settings.local.json. If that file is in git, the secret is in the repository. ShipShape scans a deployed URL, not git history, so it will not catch this.

Where this comes from

Checked on 24 November 2026. Sources: Claude Code’s settings and permissions docs, and The Hacker News on 7 November 2026, reporting research from Apiiro.

The approval is written into the project

Claude Code asks before it runs a shell command that is not already allowed. The permissions docs say that choosing “Yes, and don’t ask again” for a Bash command saves an allow rule in .claude/settings.local.json at the root of the git repository. The rule applies to later sessions in that repository.

A rule with no * matches one exact command. The permissions docs use Bash(npm run build) as that shape, and they also say the dialog can save a prefix, a command followed by *. When the saved rule is the exact command, a password, a token, or a connection string typed into it is in the file. The file is plain text in the project folder.

The Hacker News, reporting Apiiro, says 1,122 public copies of .claude/settings.local.json held 1,379 distinct secrets. Apiiro did not test whether those credentials still worked.

See if git is tracking it

From the repository root:

git ls-files .claude

If the output includes .claude/settings.local.json, the file is tracked. A gitignore entry does not hide a file that is already in the index. git ls-files is the check that shows tracked files.

If it is tracked, rotate first

Read the file, and read older versions with git log -p -- .claude/settings.local.json. Rotate every secret that appears: passwords, tokens, API keys, and database URLs. Do that at the provider before you delete anything.

Deleting the file is not enough. The old text stays in git history. Forks and clones that already fetched the repository keep it too. The shutdown checklist is the same rotation for a key that shipped in a bundle. A rewrite of history does not reach a fork that already has the commit. Rotation is what makes the old copy useless.

Then stop git from tracking it

Add the file to the project’s .gitignore. A global gitignore does not protect a fresh clone. Claude Code’s settings docs say that the first time it writes this file, it adds **/.claude/settings.local.json to your global git excludes file, on that computer. Teammates, CI, and a new laptop do not inherit that entry. If you created the file by hand, those docs say to add it to .gitignore yourself. Do that even when Claude Code wrote the file, so the ignore travels with the repository.

.claude/settings.local.json

Then remove it from the index without deleting your working copy, and commit the gitignore and the removal together:

git rm --cached .claude/settings.local.json

Do not ignore the whole .claude directory. .claude/settings.json is the shared project file Claude Code’s settings docs say you commit so the team gets the same permissions. An allow rule with a secret does not belong in that file either. The shared file is meant to be in git.

Other agents

The same idea applies to any other coding agent that stores approved commands or chats in the project folder. Run git ls-files on that folder. If a tracked file contains a command, a token, or a transcript, rotate first, then stop git from tracking it. A global gitignore still does not protect the next clone.

A key pasted into the chat, rather than saved in a project file, is a different copy. The paste guide is that case. Rotate it even when git ls-files is empty.

What the free check cannot see

ShipShape scans a deployed URL. It fetches the public page, the same-origin scripts, seven fixed paths, and source maps those scripts name. It does not read git history, and it does not open .claude/settings.local.json unless that file is actually served at one of those paths. A grade of A does not mean this file was never committed.

Run the free check for what the deploy sends a visitor. This page is the check you run in the repository. Monitor, €9 per month, repeats the same passive check each week and when a deploy hook fires. It will not read git history either.

Questions

Where does “Yes, and don’t ask again” save the command?

Claude Code’s permissions docs say that choosing “Yes, and don’t ask again” for a Bash command saves an allow rule in .claude/settings.local.json at the repository root. A rule with no wildcard matches one exact command. If that command contained a password or token, the secret is in the file.

Does a global gitignore protect a fresh clone?

No. Claude Code’s settings docs say the first write adds **/.claude/settings.local.json to your global git excludes file, on that computer. A fresh clone, a teammate, and CI do not have that excludes entry. Put the ignore in the project’s .gitignore.

What if .claude/settings.local.json is already tracked?

Rotate every secret in the file first, including secrets that appear only in older commits. Deleting the file is not enough: git history and forks keep the old text. Then add it to the project’s .gitignore and run git rm --cached so the next commit stops tracking it.

Does ShipShape scan git history for this file?

No. ShipShape scans a deployed URL. It does not read the repository, git history, or agent settings files. A clean grade does not mean .claude/settings.local.json was never committed.

Run a free check