AI summary

clauder is a small tool I wrote that starts Claude Code as another account while your own login stays as it is. Two accounts can run side by side.

  • clauder keeps Claude Code tokens under names you choose and starts Claude Code with the account you pick, from a menu or by name.
  • It hands the token only to the claude process it starts, through the CLAUDE_CODE_OAUTH_TOKEN environment variable, so your own login is never touched.
  • Each account gets its own bypass switch, and the whole tool is one Node.js file with no dependencies.

clauder starts Claude Code as a different account without logging you out of your own. I wrote it for people with more than one Claude account, say a work Team plan next to a personal Pro.

Claude Code keeps one login per machine. The usual way to switch is /logout, then a new browser login, and you can’t have both accounts open at the same time. With clauder, you pick the account when you start claude. One terminal can run as your work account while another runs as your own.

clauder list output: a table with the accounts me, alice and bob, each showing its type, a green login check, the bypass setting and a note

Installing and using it

You need Node.js 18 or newer. clauder is one file with no dependencies, so npm link downloads nothing. It runs on Windows, macOS and Linux.

bash
git clone https://github.com/fatih255/clauder
cd clauder
npm link

Then add an account under a name and start claude with it:

bash
clauder add work        # paste the token, add an optional note
clauder work            # start claude as "work"
clauder work -c         # anything after the name goes to claude
clauder me              # your own login, no token
clauder                 # arrow-key menu of all accounts
clauder list            # accounts and whether each one is logged in

The token comes from the account itself. Whoever owns the second account runs this and signs in with that account in the browser:

bash
claude setup-token

It prints a token that starts with sk-ant-oat01-. The token is valid for one year and works with a Pro, Max, Ultra, Team or Enterprise plan. setup-token doesn’t save it anywhere, so paste it into clauder add right away.

How it keeps your login untouched

Claude Code accepts a token from the CLAUDE_CODE_OAUTH_TOKEN environment variable, and that token wins over the saved login. clauder sets the variable only for the claude process it starts. Nothing is written to Claude Code’s own files, so every other terminal keeps your login.

You can check this with claude auth status --json. Its authMethod field is claude.ai for the saved login and oauth_token for a token from the variable. I ran it on my machine with a made-up token:

One machine, two loginsReal output from Claude Code 2.1.332. The token in the last two commands is made up on purpose.
  1. claude auth status --json | grep authMethod "authMethod": "claude.ai",

    My saved login.

  2. CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-fake claude auth status --json | grep -E 'loggedIn|authMethod' "loggedIn": true, "authMethod": "oauth_token",

    This one process uses the token.

  3. claude auth status --json | grep authMethod "authMethod": "claude.ai",

    The next command is back on my login. Nothing was overwritten.

  4. CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-fake claude -p "hi"Failed to authenticate. API Error: 401 OAuth access token is invalid.

    The first real request is where a bad token fails.

The second command says loggedIn: true even though the token is fake, because auth status doesn’t ask the server. That’s why clauder doesn’t check tokens either. An expired or revoked one shows up as a login error when claude starts, and running clauder add work again replaces it.

Other account switchers, such as claude-swap, swap the saved login that Claude Code sees. clauder never moves or replaces it.

Bypass permissions per account

Each account has its own bypass switch, off by default. When it’s on, clauder starts claude with --dangerously-skip-permissions, so Claude Code runs tools and edits files without asking first. The menu marks those accounts with a yellow ⚠ bypass tag.

bash
clauder bypass             # checkbox list of all accounts
clauder bypass work on
clauder bypass me off      # works for your own login too

If you pass a permission mode yourself, for example clauder work --permission-mode plan, clauder leaves the flag off for that run.

What to know before you use it

A setup-token token can only make model requests, so features that need your claude.ai account, such as Remote Control and claude.ai connectors, don’t work with it. MCP servers you set up locally do.

The tokens sit in plain text in ~/.clauder/accounts.json. On macOS and Linux only you can read that file. A token gives full use of its owner’s subscription, so keep it to your own accounts, or ones you’re allowed to use.

References

  1. clauder on GitHub
  2. Claude Code: Authentication
  3. Claude Code: CLI reference
  4. Claude Code: Environment variables

Written by:

Full Stack Software EngineerSamsun, Türkiye

Full Stack Software Engineer. I started with client sites at an agency in 2019, then worked on embeds, a dashboard and analytics at a startup called Popupsmart.