[FEATURE] Add secret keys to .env through Claude Code without AI touching it.

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 29, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The current workflow requires me to manually exit Claude Code or open a separate terminal tab whenever I need to add sensitive environment variables to a .env file.Because Claude Code is an AI agent, I cannot securely ask it to "add this secret key to my .env file." Doing so exposes raw production credentials directly into the LLM context, prompt history, and remote API logs. This creates a severe security risk and breaks the fluid terminal workflow.

Proposed Solution

I would like a secure, native terminal command built into the Claude Code CLI wrapper that intercepts the workflow to handle secrets locally, completely bypassing the AI.When I run a command like /env and specify the destination file, Claude Code should start a strict, step-by-step interactive CLI wizard:It prompts for the Key Name.It prompts for the Secret Value (with hidden/masked input).It prompts for the Next Key or lets me finish.The local CLI tool would take these inputs and inject them directly into the specified local file. The underlying LLM is never aware of the values typed during these steps, ensuring zero credential leakage into the context window.

Alternative Solutions

Current workaround: I currently work around this by pausing my session or splitting my terminal to manually run bash commands like echo "KEY=value" >> .env.Other tools: Standard CLI builders use hidden password prompts (like Node's readline or inquirer) to capture data strictly on the local machine without broadcasting it to external APIs.

Priority

High - Significant impact on productivity

Feature Category

File operations

Use Case Example

I am configuring a project and need to add four different API secrets to my .env file.I type /env inside the Claude Code interface.The local CLI wrapper takes over the terminal and prompts me for Key 1. I type the name, then paste the secret (which remains hidden).The CLI loops through keys 2, 3, and 4 one at a time.Once finished, the local tool writes them directly to the .env file. The AI session resumes, completely unaware of the sensitive data that was just written locally.

Additional Context

Technical constraint: The secret inputs must be intercepted at the local terminal architecture level so that the keystrokes are never bundled into the prompt payload sent to Anthropic's servers.

View original on GitHub ↗