https://github.com/synth1s/cloak
Cloak your Claude. Switch identities in seconds.
https://github.com/synth1s/cloak
anthropic claude claude-code cli cloak multi-account
Last synced: 3 months ago
JSON representation
Cloak your Claude. Switch identities in seconds.
- Host: GitHub
- URL: https://github.com/synth1s/cloak
- Owner: synth1s
- License: mit
- Created: 2026-03-16T20:28:04.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2026-03-26T04:50:40.000Z (3 months ago)
- Last Synced: 2026-03-27T01:10:26.042Z (3 months ago)
- Topics: anthropic, claude, claude-code, cli, cloak, multi-account
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@synth1s/cloak
- Size: 223 KB
- Stars: 8
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# @synth1s/cloak
[](https://github.com/synth1s/cloak/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/@synth1s/cloak)
[](https://www.npmjs.com/package/@synth1s/cloak)
[](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.](https://github.com/anthropics/claude-code/issues/18435)

## 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
```bash
npm install -g @synth1s/cloak
```
## 3 steps to get started
```bash
# 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:
```bash
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 ` | Wear a different cloak |
| `cloak list` | See all cloaks in your wardrobe |
| `cloak whoami` | Which cloak are you wearing? |
| `cloak delete ` | Discard a cloak |
| `cloak rename ` | Rename a cloak |
| `cloak bind ` | Bind this directory to a cloak |
| `cloak unbind` | Remove directory binding |
With shell integration (`eval "$(cloak init)"`):
| Command | Description |
|---------|-------------|
| `claude -a ` | Switch and launch Claude |
| `claude account ` | All cloak commands via claude |
## Concurrent sessions
Different terminal, different identity. No conflicts.
```bash
# 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.
```bash
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 ────────────────────────────
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 command** — `claude -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`](https://code.claude.com/docs/en/env-vars) 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](https://github.com/anthropics/claude-code/issues/4739)). Cloak is designed for terminal-based Claude Code.
## Requirements
- Node.js >= 18
- bash or zsh (for shell integration)
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md).
## Security
See [SECURITY.md](SECURITY.md).
## Documentation
- [Requirements & use cases](docs/requirements.md)
- [Technical specification](docs/technical-spec.md)
## License
MIT