Skip to content

synth1s/cloak

Repository files navigation

@synth1s/cloak

CI npm downloads license

Stop logging out. Start switching.

Every developer wears a different cloak. One for work, one for personal projects, one for that freelance gig. Cloak lets you dress your Claude Code in the right identity — and switch between them without breaking a sweat.

No file swapping. No token juggling. Each account is a fully isolated directory — safe for concurrent sessions across terminals. 195+ developers asked for this.

demo

Before / After

Before Cloak:

claude → /logout → /login (lose session) → work on project
claude → /logout → /login (lose session) → personal use

After Cloak:

claude -a work     # instant. sessions preserved.
claude -a home     # in another terminal. at the same time.

Install

npm install -g @synth1s/cloak

3 steps to get started

# 1. Save your current Claude session
cloak create work

# 2. Log out, log in with another account in Claude, then:
cloak create home

# 3. Set up shell integration
cloak switch work    # follows the guided setup on first run

That's it. From now on:

claude -a work       # switch and launch
claude -a home       # in another terminal, at the same time

Commands

Command Description
cloak create [name] Save current session as a new cloak
cloak switch <name> Wear a different cloak
cloak list See all cloaks in your wardrobe
cloak whoami Which cloak are you wearing?
cloak delete <name> Discard a cloak
cloak rename <old> <new> Rename a cloak
cloak bind <name> Bind this directory to a cloak
cloak unbind Remove directory binding

With shell integration (eval "$(cloak init)"):

Command Description
claude -a <name> Switch and launch Claude
claude account <cmd> All cloak commands via claude

Concurrent sessions

Different terminal, different identity. No conflicts.

# Terminal A:
claude -a work

# Terminal B (at the same time):
claude -a home

Each account is a completely isolated directory. No file overlap, no token conflicts.

Auto-switch by directory

Bind a cloak to a project directory. Claude automatically uses the right account.

cd ~/projects/company
cloak bind work

cd ~/projects/personal
cloak bind home

From now on, claude in those directories uses the bound account — no manual switch needed.

Context bar

Every command shows which identity is active:

cloak > list . work <filipe@company.com> ────────────────────────────

Your Cloaks

  > work (active) — filipe@company.com
    home — filipe@personal.com

Why Cloak

  • No file swapping — each account is its own directory, not a copy of shared files
  • Concurrent sessions — different terminals, different accounts, at the same time
  • Auto-switch by directory — bind a project to a cloak, forget about it
  • One commandclaude -a work switches and launches in one step
  • Nothing is lost — tokens, MCP servers, settings, all preserved per account
  • Secure — credentials stored with restrictive permissions (0o600), never transmitted

How it works

Cloak uses Claude Code's official CLAUDE_CONFIG_DIR environment variable. Each account gets its own directory:

~/.cloak/
└── profiles/
    ├── work/                # complete, isolated config
    │   ├── .claude.json
    │   ├── settings.json
    │   └── ...
    └── home/
        ├── .claude.json
        └── ...

Switching changes which directory Claude Code reads from. Nothing is copied, moved, or overwritten.

FAQ

Will switching overwrite my settings?

No. Each account is a completely isolated directory. Switching only changes which directory Claude Code reads from. Your settings, MCP servers, and preferences for each account stay exactly where they are.

Are token renewals preserved?

Yes. When Claude Code renews your OAuth token during a session, it writes to the active account's directory. When you switch away and back, the renewed token is still there.

Can I lose data with multiple accounts running?

No, as long as each terminal uses a different account. Each has its own directory — no file overlap.

Is my auth token safe?

Cloak never transmits, logs, or modifies your tokens. It only copies files during cloak create and changes an environment variable during cloak switch. All data stays local. Credential files are created with restrictive permissions (0o600).

What if I uninstall Cloak?

Your account directories remain in ~/.cloak/. Claude Code works normally with its default config. To clean up: rm -rf ~/.cloak

Does it work with IDE extensions?

IDE extensions may not respect CLAUDE_CONFIG_DIR (known limitation). Cloak is designed for terminal-based Claude Code.

Requirements

  • Node.js >= 18
  • bash or zsh (for shell integration)

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

Documentation

License

MIT