[FEATURE] Per-keystroke hook for prompt input (readline-level event)

Resolved 💬 2 comments Opened Mar 29, 2026 by carylewis Closed May 1, 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

Claude Code hooks fire at coarse-grained events: session start/stop, tool calls,
prompt submit. There is no way to inspect or react to prompt text as it is being
typed.

Prompts are increasingly persistent artifacts — they inform memory files,
CLAUDE.md, commit messages, and documented workflows. A typo in a prompt can
propagate into these artifacts and degrade their quality over time. More
importantly, real-time feedback is the only form of correction that reinforces
correct spelling — seeing a word flagged as you type teaches you the correct
spelling. Post-hoc correction fixes the artifact but provides no learning benefit.

Proposed Solution

Expose a per-keystroke or "prompt-changed" hook that fires as the user types,
giving plugins and skills access to the current prompt text in real time. The
hook would receive the current prompt string and cursor position, and could
return annotations (ranges + messages) displayed inline — similar to how LSP
diagnostics work in an editor.

This is infrastructure, not a single feature. It would unlock a class of
capabilities that currently cannot be built:

  • Spell checking — highlight misspelled words inline as the user types
  • Prompt linting — warn when a prompt is ambiguous or missing context
  • Live token counting — show a running token estimate as the prompt grows
  • Autocomplete / snippet expansion — trigger completions from partial input
  • Sensitive data detection — warn before a secret or PII is submitted

A small debounce (e.g. 200ms after last keystroke) would be sufficient for most
use cases. Read-only observation with no prompt modification would be a safe
first step.

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

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