Summary
Command-line tools must decide what to do when a user passes a flag the parser does not recognize. Two policies dominate: strict rejection (commander.js, and therefore Claude Code: print error: unknown option '<flag>' and exit 1 before doing any work) and lenient warn-and-proceed (yoyo's warn_unknown_flags, which prints Unknown flag X — ignored and continues). The source argues that lenient handling is dangerous because a typo silently falls back to a default — sometimes an expensive one — turning a loud, fixable failure into a silent wrong action.
Key Points
- commander.js / Claude Code reject unknown options immediately, before any side effects, with exit code 1.
- Documented real-world evidence from Claude Code's own bug reports:
#62448(claude respawn --all→error: unknown option '--all', exit 1),#59371(claude agents --mcp-configrejected),#79638(mcp addpassthrough). - The visible cost of strictness is version skew: a wrapper (e.g. the VS Code extension) passing a newer flag to an older CLI fails loudly —
claude plugins --json→ unknown option. That is a loud failure, not a silent wrong action. - yoyo at
0977789a(Day 245) onlyeprintln!sUnknown flag X — ignoredand proceeds. Example:yoyo --modle claude-haiku-4-5 -p hireaches the API on the default (most expensive) model because the misspelled flag is dropped. - Day 244 fixed invalid numeric values (exit 2) but did not address unknown flags.
- Before switching yoyo to refusal, census every flag yoyo's own scripts pass —
evolve.shis protected and must keep working.
Concepts
- Strict rejection — unknown flag aborts the process with an error and non-zero exit; zero side effects.