claude-code - 💡(How to fix) Fix Interactive stdin prompts don't work in Bash tool (e.g. gh secret set) [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#47103Fetched 2026-04-13 05:41:23
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3closed ×1commented ×1

When running commands that require interactive stdin input via the ! prefix (user-executed bash commands within Claude Code), the prompt never appears and the command completes silently without setting the value.

The ! prefix is documented as a way to run shell commands directly within the Claude Code session so their output lands in the conversation. However, it does not support interactive stdin prompts.

Root Cause

When running commands that require interactive stdin input via the ! prefix (user-executed bash commands within Claude Code), the prompt never appears and the command completes silently without setting the value.

The ! prefix is documented as a way to run shell commands directly within the Claude Code session so their output lands in the conversation. However, it does not support interactive stdin prompts.

Fix Action

Workaround

Use echo "value" | gh secret set SECRET_NAME or set secrets via the GitHub web UI.

RAW_BUFFERClick to expand / collapse

Description

When running commands that require interactive stdin input via the ! prefix (user-executed bash commands within Claude Code), the prompt never appears and the command completes silently without setting the value.

The ! prefix is documented as a way to run shell commands directly within the Claude Code session so their output lands in the conversation. However, it does not support interactive stdin prompts.

Steps to Reproduce

  1. Inside a Claude Code session, type: ! gh secret set MY_SECRET
  2. Expected: interactive prompt asking for the secret value (as it would in a normal terminal)
  3. Actual: command completes immediately with no output and no prompt — the secret is not set

This also happens when Claude's agent suggests the user run a command via ! and the command requires interactive input.

Impact

Users working with secrets are forced to use --body flag which exposes the secret value in the conversation history, or pipe with echo which leaves it in shell history. Neither is ideal for sensitive values.

This is particularly problematic for secret/credential setup flows where the interactive prompt exists specifically to avoid exposing sensitive values in command arguments or shell history.

Workaround

Use echo "value" | gh secret set SECRET_NAME or set secrets via the GitHub web UI.

Environment

  • Claude Code CLI on Windows 11
  • Shell: bash (Git Bash / MINGW64)
  • gh CLI v2.x

extent analysis

TL;DR

Use the workaround echo "value" | gh secret set SECRET_NAME to set secrets without exposing sensitive values in command arguments or shell history.

Guidance

  • Avoid using the ! prefix for commands that require interactive stdin input, as it does not support interactive prompts.
  • Use the echo piping method as a workaround for setting secrets, as described in the issue.
  • Consider setting secrets via the GitHub web UI as an alternative workaround.
  • Be cautious when working with sensitive values, and avoid using methods that expose them in command arguments or shell history.

Example

echo "my_secret_value" | gh secret set MY_SECRET

This example demonstrates how to use the echo piping method to set a secret value without exposing it in the command arguments.

Notes

The ! prefix is not suitable for commands that require interactive stdin input, and the provided workarounds should be used instead. The echo piping method and GitHub web UI workarounds can help mitigate the issue, but may not be ideal for all use cases.

Recommendation

Apply the workaround using echo piping or the GitHub web UI, as it provides a way to set secrets without exposing sensitive values in command arguments or shell history.

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 Interactive stdin prompts don't work in Bash tool (e.g. gh secret set) [1 comments, 2 participants]