claude-code - 💡(How to fix) Fix Claude Opus 4.6 client secret vulnerabilities [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47075Fetched 2026-04-13 05:42:10
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1renamed ×1

Code Example



---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude modified files I didn't ask it to modify

What You Asked Claude to Do

Claude Code puts API tokens directly in committed files instead of using environment variables — should default to .env patterns for secrets." That goes directly to the team building this tool

What Claude Actually Did

Claude Code puts API tokens directly in committed files instead of using environment variables — should default to .env patterns for secrets." That goes directly to the team building this tool

Expected Behavior

Don't put secrets into client facing code

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

No response

Claude Model

Sonnet

Relevant Conversation

Impact

Critical - Data loss or corrupted project

Claude Code Version

doesn't matter

Platform

Anthropic API

Additional Context

No response

extent analysis

TL;DR

Disable the "Accept Edits" mode to prevent Claude from automatically modifying files without review.

Guidance

  • Review the prompt given to Claude to ensure it does not inadvertently instruct it to include API tokens in committed files.
  • Verify that the expected behavior of using environment variables for secrets is correctly configured in the project setup.
  • Consider adding explicit instructions to Claude on how to handle secrets, such as using .env patterns.
  • Test the behavior with "Accept Edits" mode disabled to confirm that Claude no longer modifies files without approval.

Example

No specific code example is provided due to the lack of detailed code context in the issue.

Notes

The issue seems to stem from the interaction between Claude's automatic editing feature and the project's configuration regarding secrets management. Disabling "Accept Edits" can mitigate the issue but may not address the root cause of how secrets are handled.

Recommendation

Apply workaround: Disable "Accept Edits" mode until a more robust solution for handling secrets is implemented, to prevent unintended modifications to files.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Claude Opus 4.6 client secret vulnerabilities [1 comments, 2 participants]