← Back to news
The Hacker News9 Nov 2026 · 2 min read

Researchers Find Secrets Exposed in Public Claude Code Settings Files

Security firm Apiiro says public GitHub repositories contain passwords, API tokens and cloud credentials stored in configuration files created by Anthropic's Claude Code assistant. The researchers ide...

Security firm Apiiro says public GitHub repositories contain passwords, API tokens and cloud credentials stored in configuration files created by Anthropic's Claude Code assistant. The researchers identified 1,122 publicly accessible copies of .claude/settings.local.json containing at least one potential secret.

Claude Code can record shell-command approval rules when a user selects an option allowing similar commands to run without further prompts. According to Apiiro, when an approval applies to a specific command rather than a general pattern, the full command may be saved in the project configuration file. If that command includes a password, token or key directly in its text, the credential can be retained in plain text.

Scope of the reported exposure

Apiiro reported finding 104,185 copies of the local settings file across 103,617 public repositories. Its analysis classified 1,379 distinct credentials in 1,122 files as secrets, using key-format detection, contextual indicators and AI-assisted review. The company said it did not validate whether the exposed credentials remained active, although one organization reportedly confirmed that a notified key was still valid.

  • Reported findings included database passwords, SSH credentials, source-control and package-registry tokens, and AWS keys.
  • Older Git history contained an additional 734 secrets in 509 repositories, according to the research.
  • Forked repositories may preserve exposed files even after an original project removes them.
  • Apiiro also identified secrets in the shared .claude/settings.json file and in agent-related logs.

Claude Code reportedly adds the local settings file to a user's global Git exclusion list when it first creates the file in a repository. However, that protection is local to the developer's machine and does not prevent a file from being committed by another workflow or from remaining in repository history. Apiiro said the file is not automatically added to each project's .gitignore.

Organizations should search repositories, commit histories and forks for Claude Code settings files, then rotate any credentials that may have appeared in saved commands before attempting cleanup. Removing a file from the current branch alone does not eliminate historical copies.

Developers can reduce risk by passing secrets through environment variables or managed secret stores rather than placing them directly in command lines. Security teams may also want to include AI-agent directories and configuration files in pre-commit checks, CI scanning and repository ignore templates. Apiiro noted that conventional secret scanners can miss ordinary passwords embedded in shell commands because they do not match recognizable key formats.

Share this article:TwitterLinkedIn