The Prompt That Typed Itself
I didn't type that.
What Happened
I was mid-session with Claude Code, editing the landing page of this site. Claude finished a response, and the prompt came back with text already in it:
"can we cut the topic lanes, they're not adding much"
I hadn't typed a word. The text was context-aware — it knew what we'd been working on and offered a reasonable next step. A few minutes later, after a git push, it happened again:
"check the deploy"
This time I screenshotted it. The first time I'd assumed it was a shell autocomplete glitch. The second time I knew it wasn't.
The Problem
Claude Code v2.1.126 has a prompt suggestion feature. On a fresh launch, it shows harmless placeholder text — greyed-out hints like try "create a util logging.py that...". Pressing Enter on these does nothing. They're visual-only.
But mid-session, the behaviour changes. The suggestions populate the actual input buffer. They're not ghost text — they're real, editable, submittable characters sitting in your prompt. Press Enter and they execute as if you typed them yourself.
The distinction matters. A placeholder hint is a UI flourish. A pre-filled input buffer is an action waiting to happen.
How Bad Is It?
I filed this as #56142 on the Claude Code repo. The bot immediately flagged three existing issues:
-
#25787 — A thorough write-up explaining that Enter simultaneously accepts and executes suggestions, violating every CLI convention. Fish, Zsh, Bash, and GitHub Copilot CLI all require Tab or Arrow to accept a suggestion before Enter can execute. Claude Code is the outlier. This issue itself referenced two earlier reports (#14500, #16166) that were also auto-closed.
-
#18106 — Ghost text gets submitted when pasting images or file paths. Same root cause: the suggestion lives in the actual input buffer.
-
#20439 — Someone had the autocomplete suggestion "merge it" submitted when they pasted a screenshot. It merged a PR without their intent. Real damage from a phantom prompt.
All three issues were closed by the auto-close bot. Not fixed. Not addressed. Just swept away by a 30-day inactivity timer.
The Investigation
When I first noticed the ghost text, I didn't immediately realise it was a Claude Code feature. I investigated:
-
PSReadLine — PowerShell's predictive text. Checked
Get-PSReadLineOption | Select PredictionSource. Blank. Not the source. -
CLAW — My custom Claude Code launcher. It's a dumb wrapper — doesn't touch stdin, doesn't store input state. Ruled out.
-
Shell history — The suggestions were too contextually specific. Shell history doesn't know what you're working on in a Claude Code session.
-
Claude Code settings — Checked
C:\Users\gavin\.claude\settings.json. Nothing enabled. This is default behaviour.
The smoking gun was the fresh-launch placeholder. When I opened a new Claude Code session, there it was: try "create a util logging.py that..." in greyed-out text. The feature exists. The mid-session version just isn't properly sandboxed.
The Fix
One environment variable:
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false
Add it to your Claude Code settings:
{
"env": {
"CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION": "false"
}
}
That file lives in your user .claude directory under settings.json. Restart Claude Code and the suggestions are gone — startup placeholders and mid-session ghost text alike.
What Should Happen
The best proposal is simple: decouple acceptance from execution.
- Tab or Right Arrow accepts the suggestion into the input buffer where you can review and edit it
- Enter only executes after explicit acceptance
- Enter without acceptance does nothing — or sends a blank line
This is how every other CLI tool handles inline suggestions. It's the established convention for a reason. The current behaviour — where a single Enter both accepts and executes unreviewed text — is an outlier that creates real risk.
What I Learned
-
Context-aware prompt suggestions that populate the input buffer are not autocomplete — they're unsolicited actions. The distinction between "suggestion you can see" and "text you can submit" is the entire safety margin.
-
The issue has been reported independently by multiple users since January 2026. It keeps getting auto-closed by a bot. The fact that a real PR was merged by accident (#20439) and the issue was still closed for inactivity is concerning.
-
The investigation process matters. I ruled out PSReadLine, CLAW, shell history, and user settings before landing on the actual cause. Without that process, I'd have been guessing.
-
Disable it. If you're using Claude Code and you haven't explicitly opted into prompt suggestions, set
CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false. The feature is useful in theory but dangerous in practice until the acceptance model is fixed.
Caught, filed, disabled. Built with Claude Code. Published at indigo-nx.com.