TL;DR
TL;DR
If claude setup-token fails with command not found, your shell is usually hitting the wrong binary or a CLI version where that command no longer exists. Verify which -a claude, inspect claude --help, and switch to supported auth commands.
Extracted keywords: setup-token, command, that, claude
Symptoms
Typical terminal output
$ claude setup-token
zsh: command not found: setup-token
# or
Error: Unknown command "setup-token"You might also notice docs, blog posts, or team notes referencing old command names that your local CLI no longer supports.
Root causes
Outdated CLI version
Older builds can miss newer auth commands, while newer builds may remove setup-token entirely.
Wrong package/channel
A similarly named package or non-official channel can install a different CLI with different subcommands.
PATH mismatch
Multiple claude binaries are common; your shell may resolve an unintended executable first.
Deprecation or rename
setup-token may have been replaced by auth/login/token subcommands depending on release channel.
Auth model changed
Some setups now prioritize environment variables or interactive login over explicit setup-token flows.
Step-by-step fix
- Find every Claude binary and check which one is active.
- Inspect available subcommands in your installed version.
- Remove duplicate/wrong installs and keep one official channel.
- Use the supported auth flow exposed by that version.
1) Diagnose binary and command availability
which -a claude
claude --version
claude --help
claude --help | rg "setup-token|auth|login|token"2) Inspect global installs and remove wrong package/channel
npm ls -g --depth=0 | rg -i "claude|anthropic"
brew list | rg -i "claude|anthropic"
# Remove duplicates you do not want (examples):
npm uninstall -g <wrong-or-old-claude-package>
brew uninstall <wrong-or-old-claude-formula>3) Reinstall from one official channel and re-check help
# Use your team's approved official install command
<official-install-command>
hash -r
which -a claude
claude --version
claude --help | rg "auth|login|token|setup-token"Authentication fallback flows
Flow A: Environment variable auth (fastest unblock)
export ANTHROPIC_API_KEY="your_api_key_here"
printenv ANTHROPIC_API_KEY | wc -c
claude --versionFlow B: Version-discovered auth command
# Discover the valid command on your installed CLI:
claude --help | rg "auth|login|token"
# Then run the discovered command, for example:
claude auth loginFlow C: Project-level env loading
# .env.local (or your shell profile / secrets manager)
ANTHROPIC_API_KEY=your_api_key_here
# Reload shell and verify:
source ~/.zshrc
printenv ANTHROPIC_API_KEY | wc -cThe important point: don't block on setup-token. Use the auth method your current CLI advertises in --help.
Morph fallback for editing workflows
If your team is unblocked on auth but still getting brittle edit-apply behavior, you can route edits through Morph Fast Apply while keeping your existing model workflow.
Claude Code + Morph MCP
claude mcp add morph-fast-apply \
-e MORPH_API_KEY=your-key \
-e ALL_TOOLS=false \
-- npx @morphllm/morphmcpUse a reliable apply layer
Morph applies structural updates at 10,500+ tokens/sec with high first-pass success.
FAQ
Is this always a PATH issue?
No. PATH collisions are common, but command deprecation/renaming and wrong package installs are equally common.
How do I know whether setup-token was renamed?
Treat claude --help as source of truth for the installed binary. If auth/login/token commands exist but setup-token does not, the command likely changed in your version or channel.
Can I keep using old scripts that call setup-token?
Update automation to detect command availability first and branch to the currently supported auth command or environment-variable flow.