claude-code - 💡(How to fix) Fix Feature request: automatically obscure credentials and secrets in terminal output

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…

Claude Code should automatically detect and obscure credentials, tokens, API keys, and other secrets in terminal output — rather than displaying them in full.

Root Cause

This is especially important because Claude Code has the ability to retrieve secrets on the user's behalf, making it a natural point to enforce this protection.

RAW_BUFFERClick to expand / collapse

Summary

Claude Code should automatically detect and obscure credentials, tokens, API keys, and other secrets in terminal output — rather than displaying them in full.

Current behavior

When Claude Code runs commands that involve secrets (e.g. retrieving a value from AWS Secrets Manager, printing an auth token, echoing an environment variable), the raw secret value can appear in full in the terminal output.

Desired behavior

Any value that looks like a credential or secret should be automatically obscured in the display. Two acceptable formats:

  • Blank/redacted: replace the value entirely with [REDACTED]
  • Partial obscure (preferred): show a few characters at the start and end with ...OBSCURED... in the middle, e.g. EWhD7h...OBSCURED...z320Y

This would apply to:

  • AWS credentials and session tokens
  • API keys and bearer tokens
  • Passwords and private keys
  • Any value retrieved from secrets managers (AWS Secrets Manager, HashiCorp Vault, etc.)
  • Environment variables with names matching common secret patterns (*_TOKEN, *_SECRET, *_KEY, *_PASSWORD, etc.)

Use case

Users run Claude Code in shared terminal sessions, screen recordings, pair programming, and demo environments. A secret that appears in tool output can be inadvertently captured in a screenshot, recording, or over-the-shoulder view. Baking automatic obscuring into the UI — rather than relying on users or the model to remember — provides a meaningful security guardrail.

This is especially important because Claude Code has the ability to retrieve secrets on the user's behalf, making it a natural point to enforce this protection.

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