CLI silently ignores unknown flags instead of reporting an error
Bug Description
The Claude Code CLI silently ignores unrecognized command-line flags. Running claude --nonexistent-flag produces no error — it just exits silently. This makes it very difficult to debug issues when a flag is not registered (e.g., behind a feature gate) or misspelled.
Steps to Reproduce
- Run
claude --any-nonexistent-flag - Observe: no output, no "unknown option" error
$ claude --totally-fake-flag
$ echo $?
0
Expected Behavior
The CLI should report an error for unrecognized flags, e.g.:
error: unknown option '--totally-fake-flag'
This is the default behavior of most CLI frameworks (including Commander.js) unless explicitly disabled.
Actual Behavior
Silent exit with no output. This is especially problematic when a feature like --teleport is gated behind a feature flag — the user has no way to tell whether the flag is unrecognized vs. failing for another reason.
Environment
- Claude Code version: 2.1.87
- Platform: Linux (ARM aarch64, Tegra)
Impact
This directly contributed to a confusing debugging session where --teleport was silently ignored. The root cause (dirty git tree) was hidden behind a second issue (the flag appearing to not exist) because neither failure produced any output.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗