⌨️claude setup-token Command
Also known as claude setup-token, CLAUDE_CODE_OAUTH_TOKEN, Long-lived OAuth token
It makes a sign-in token for CI and scripts. It lasts one year.
Think of it like
It is like a pass for the bus that lasts a year.
Example
Lucy wants her GitHub job to run Claude Code on her plan. She runs claude setup-token and copies the token. Then she saves it as a secret with the name CLAUDE_CODE_OAUTH_TOKEN.
Why it matters
A job that runs at night cannot click a sign-in page. A token lets it sign in on its own.
Definition
Example code
bash
claude setup-tokenCommon mistake
Key takeaways
- 1Lasts one year. Then make a new one.
- 2Printed once. Not saved.
- 3Set the variable. CLAUDE_CODE_OAUTH_TOKEN.