anthropics / anthropics/claude-code

[Feature Request] Add automatic .env file protection to prevent accidental secret exposure in tool execution

Open
#92,487 0 comments 0 reactions 0 assignees View on GitHub
area:sandbox area:security enhancement platform:macos
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

**Bug Description**
The problem is that .env files are very commonly used in each projects and claude comes with setup that allows to read all secret keys form it. The security is put on user shoulders which creates huge human factor in terms of lack of security. There is PreToolUse hook that could be used to block but it have to be done by user manually leavig room of unsecurity for secrets huge

**Environment Info**
- Platform: darwin
- Terminal: WarpTerminal
- Version: 2.1.263
- Feedback ID: 7437f4f9-e7c8-4bad-a403-7620841ab465

**Errors**
```json
[]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the existing PreToolUse hook and the tool-execution path that can read project files; the issue names no specific file or test. Define the protection behavior for .env files and its validation cases before implementing, then verify that tool execution cannot expose their contents by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.