← all repositories
severity1/claude-code-prompt-improver

Claude Code hook asks the questions you skipped

A Claude Code hook that evaluates every prompt for clarity, asks 1-6 grounded questions only when yours is genuinely vague, and injects context at tool and subagent boundaries so the first answer is more often the right one.

★2k stars Python Coding Assistants
claude-code-prompt-improver
Velocity · 7d
+0.9
★ / day
Trend
→steady
star history

What it does It’s a plugin that hooks into three Claude Code lifecycle moments — prompt submit, tool use, subagent start — and injects small pieces of context before Claude acts. The flagship nudge, improve, checks every prompt for clarity: clear ones pass straight through, vague ones trigger a research pass over your codebase followed by 1-6 grounded questions (“which error — the TypeError in Map.tsx, or the API timeout?”). Six supporting nudges cover plan mode, long-running commands, research subagents, multi-step workflows, non-trivial requests, and substantial deliverables.

The interesting bit The gating economics are the real design: a missed nudge costs a full correction round-trip, while a false fire costs a few tokens the model ignores — so every gate is tuned for recall, and each injected nudge opens with “if this is X… if not, ignore,” letting the model dismiss its own false positive. It’s glue code, honestly, but glue with unusually disciplined plumbing: nudges are declarative JSON rows rather than scripts, and the engine treats a bad rule as a skip, never a crash.

Key highlights

  • improve runs a ~189-token clarity check on every prompt; clear ones proceed with zero skill overhead, vague ones get research plus questions.
  • Six supporting nudges fire only when their condition matches — plan-mode entry, dev servers about to run, research subagents starting, and so on.
  • No eval, importlib, or path-based getattr: handlers and matchers are string-keyed allowlists, so an unknown name is a load-time skip, not an arbitrary import.
  • Injected context stays visible in the conversation — you can see exactly what the hook added.
  • Bypass prefixes (*, /, #) skip evaluation entirely when you want none.

Caveats

  • The v0.4.0 “31% token reduction” is the project’s own figure; the README doesn’t show how it was measured.
  • Documented limitation: the workflow nudge’s keyword filter biases toward recall, so “fix the CI workflow file” can inject guidance the model then has to ignore.
  • Claude Code 2.0.22+ only, and every prompt — clear or not — pays the small evaluation tax.

Verdict Worth installing if you live in Claude Code and your prompts are more vibes than specs; the ask-before-acting pattern genuinely saves round-trips. If you’re not on Claude Code, or you already write prompts like legal documents, it has nothing to offer you.

Frequently asked

What is severity1/claude-code-prompt-improver?
A Claude Code hook that evaluates every prompt for clarity, asks 1-6 grounded questions only when yours is genuinely vague, and injects context at tool and subagent boundaries so the first answer is more often the right one.
Is claude-code-prompt-improver open source?
Yes — severity1/claude-code-prompt-improver is open source, released under the MIT license.
What language is claude-code-prompt-improver written in?
severity1/claude-code-prompt-improver is primarily written in Python.
How popular is claude-code-prompt-improver?
severity1/claude-code-prompt-improver has 2k stars on GitHub and is currently holding steady.
Where can I find claude-code-prompt-improver?
severity1/claude-code-prompt-improver is on GitHub at https://github.com/severity1/claude-code-prompt-improver.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.