[BUG] 5th time I instructed Claude Cli to NOT display key while editing .env.local. Then it shows it!

Resolved 💬 4 comments Opened Jan 11, 2026 by Bladed3d Closed Jan 15, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I am setting up a database. After Claude told me to edit .env.local twice, it finally said I needed to edit a different file. So I asked Claude to edit the third file and specifically told it "Do not show the key in this terminal screen." And then it showed it! Why is not every Claude pre-programmed NOT to show API keys and why the hell does Claude NOT follow instructions????

What Should Happen?

Claude should default to NOT SHOW keys of any kind! And when instructed, it sure as hell should follow instructions to NOT SHOW KEYS!!!!

Error Messages/Logs

Steps to Reproduce

  1. Ask Claude how to add a key to the .env.local file.
  2. Create a different file that you put the key into
  3. Tell Claude that you don't understand or made a mistake and ask Claude to use the file you created to get the key and edit the .env.local file and instruct it "Do not display the key on this terminal screen. This can cause security problems, so just edit the file without display and confirm when completed."
  4. Cuss out Claude when it edits the file and fully displays the key on the terminal screen.

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.4 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗