plannotator
plannotator copied to clipboard
cli: clarify no-arg plannotator usage without breaking hook mode
Summary
Running plannotator with no arguments is confusing for direct terminal users.
Today, bare plannotator is the Claude Code hook entrypoint: it reads hook JSON from stdin and starts plan review. That behavior is correct and must stay compatible. The problem is that if a human runs plannotator directly in a terminal, there is no clear explanation of what it expects.
Current behavior
- Bare
plannotatoris the default Claude Code hook path (apps/hook/server/index.ts,apps/hook/hooks/hooks.json) - It waits for stdin, then parses hook JSON and exits if the input is invalid or missing plan content
- The CLI also has explicit user-facing subcommands such as
review,annotate,last/annotate-last,archive, andsessions
Proposed behavior
A narrow UX improvement only:
plannotator --helpshows a short top-level usage messageplannotatorwith stdin attached to a terminal prints a short clarification message and exits successfullyplannotatorwith stdin provided via pipe or redirection keeps the current hook behavior unchanged
Example clarification output:
plannotator (without arguments) is intended for hook integration.
It expects hook JSON on stdin.
For interactive use, try:
plannotator review
plannotator annotate <file.md>
plannotator last
plannotator archive
plannotator sessions
Compatibility constraints
This must remain compatible with:
- Claude Code hook integration using bare
plannotator - manual Claude hook configuration with
"command": "plannotator" - any wrapper, script, or test that feeds hook JSON on stdin (pipe or redirection)
- existing explicit subcommands
Why this is intentionally narrow
This is only about making interactive no-arg usage less confusing.
It is not:
- a redesign of the CLI
- a change to the Claude Code hook contract
- a change to existing subcommand behavior
Acceptance criteria
- [ ]
plannotator --helpshows a short top-level usage message - [ ] bare
plannotatorin an interactive terminal explains that no-arg mode expects hook JSON on stdin - [ ] stdin-fed invocation (pipe or redirection) still behaves as it does today
- [ ] existing subcommands continue to behave the same way