@synth1s/cloak 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +81 -65
  2. package/package.json +7 -3
package/README.md CHANGED
@@ -4,17 +4,25 @@
4
4
  [![npm](https://img.shields.io/npm/v/@synth1s/cloak)](https://www.npmjs.com/package/@synth1s/cloak)
5
5
  [![license](https://img.shields.io/npm/l/@synth1s/cloak)](LICENSE)
6
6
 
7
- > Cloak your Claude. Switch identities in seconds.
7
+ **Stop logging out. Start switching.**
8
8
 
9
9
  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.
10
10
 
11
- ## The problem
11
+ Sessions, tokens, MCP servers, and settings fully preserved. Concurrent sessions across terminals. [181+ developers asked for this.](https://github.com/anthropics/claude-code/issues/18435)
12
12
 
13
- Claude Code stores your session in `~/.claude.json`. There's no built-in support for multiple accounts, so switching between personal and work means running `/logout` and `/login` every time — losing your session state in the process.
13
+ ## Before / After
14
14
 
15
- ## The solution
15
+ **Before Cloak:**
16
+ ```
17
+ claude → /logout → /login (lose session) → work on project
18
+ claude → /logout → /login (lose session) → personal use
19
+ ```
16
20
 
17
- Cloak gives each account its own isolated directory using Claude Code's official [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/en/env-vars) environment variable. Each identity stays separate. No file conflicts. No data loss. Full support for concurrent sessions.
21
+ **After Cloak:**
22
+ ```
23
+ claude -a work # instant. sessions preserved.
24
+ claude -a home # in another terminal. at the same time.
25
+ ```
18
26
 
19
27
  ## Install
20
28
 
@@ -22,21 +30,24 @@ Cloak gives each account its own isolated directory using Claude Code's official
22
30
  npm install -g @synth1s/cloak
23
31
  ```
24
32
 
25
- ## Quick start
33
+ ## 3 steps to get started
26
34
 
27
35
  ```bash
28
- # Save your current Claude session
36
+ # 1. Save your current Claude session
29
37
  cloak create work
30
38
 
31
- # Log out, log in with another account, then:
39
+ # 2. Log out, log in with another account in Claude, then:
32
40
  cloak create home
33
41
 
34
- # Set up shell integration (recommended)
35
- echo 'eval "$(cloak init)"' >> ~/.bashrc && source ~/.bashrc
42
+ # 3. Set up shell integration
43
+ cloak switch work # follows the guided setup on first run
44
+ ```
36
45
 
37
- # Throw on a cloak and go
38
- claude -a work
39
- claude -a home
46
+ That's it. From now on:
47
+
48
+ ```bash
49
+ claude -a work # switch and launch
50
+ claude -a home # in another terminal, at the same time
40
51
  ```
41
52
 
42
53
  ## Commands
@@ -44,109 +55,114 @@ claude -a home
44
55
  | Command | Description |
45
56
  |---------|-------------|
46
57
  | `cloak create [name]` | Save current session as a new cloak |
47
- | `cloak switch <name>` | Set `CLAUDE_CONFIG_DIR` for the current shell |
58
+ | `cloak switch <name>` | Wear a different cloak |
48
59
  | `cloak list` | See all cloaks in your wardrobe |
49
60
  | `cloak whoami` | Which cloak are you wearing? |
50
61
  | `cloak delete <name>` | Discard a cloak |
51
62
  | `cloak rename <old> <new>` | Rename a cloak |
52
- | `cloak init` | Output shell integration code |
53
-
54
- ## Shell integration (recommended)
55
-
56
- Add to your `.bashrc` or `.zshrc`:
57
-
58
- ```bash
59
- eval "$(cloak init)"
60
- ```
61
63
 
62
- This enables:
64
+ With shell integration (`eval "$(cloak init)"`):
63
65
 
64
66
  | Command | Description |
65
67
  |---------|-------------|
66
- | `claude -a <name>` | Throw on a cloak and launch Claude |
67
- | `claude -a <name> [args...]` | Throw on a cloak and launch with arguments |
68
- | `claude account create [name]` | Save current session as a new cloak |
69
- | `claude account switch <name>` | Wear a different cloak |
70
- | `claude account list` | See all cloaks in your wardrobe |
71
- | `claude account whoami` | Which cloak are you wearing? |
72
- | `claude account delete <name>` | Discard a cloak |
73
- | `claude account rename <old> <new>` | Rename a cloak |
68
+ | `claude -a <name>` | Switch and launch Claude |
69
+ | `claude account <cmd>` | All cloak commands via claude |
74
70
 
75
71
  ## Concurrent sessions
76
72
 
77
- Different terminal, different cloak. No conflicts.
73
+ Different terminal, different identity. No conflicts.
78
74
 
79
75
  ```bash
80
- # Terminal A — wearing the work cloak:
76
+ # Terminal A:
81
77
  claude -a work
82
78
 
83
- # Terminal B wearing the home cloak:
79
+ # Terminal B (at the same time):
84
80
  claude -a home
85
81
  ```
86
82
 
83
+ Each account is a completely isolated directory. No file overlap, no token conflicts.
84
+
85
+ ## Context bar
86
+
87
+ Every command shows which identity is active:
88
+
89
+ ```
90
+ cloak > list . work <filipe@company.com> ────────────────────────────
91
+
92
+ Your Cloaks
93
+
94
+ > work (active) — filipe@company.com
95
+ home — filipe@personal.com
96
+ ```
97
+
87
98
  ## How it works
88
99
 
89
- Each cloak is an isolated directory that acts as a [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/en/env-vars):
100
+ 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:
90
101
 
91
102
  ```
92
103
  ~/.cloak/
93
104
  └── profiles/
94
- ├── work/ # Work identity
105
+ ├── work/ # complete, isolated config
95
106
  │ ├── .claude.json
96
107
  │ ├── settings.json
97
108
  │ └── ...
98
- └── home/ # Personal identity
109
+ └── home/
99
110
  ├── .claude.json
100
111
  └── ...
101
112
  ```
102
113
 
103
- When you run `claude -a work`, Cloak sets `CLAUDE_CONFIG_DIR=~/.cloak/profiles/work` in your current shell and launches Claude Code. Each terminal gets its own environment, so you can wear different cloaks simultaneously.
114
+ Switching changes which directory Claude Code reads from. Nothing is copied, moved, or overwritten.
104
115
 
105
116
  ## FAQ
106
117
 
107
- ### Will switching accounts overwrite my settings or preferences?
108
-
109
- No. Each account is a completely isolated directory. Switching only changes which directory Claude Code reads from — it doesn't copy, move, or overwrite any files. Your settings, MCP servers, and preferences for each account stay exactly where they are.
110
-
111
- ### Can I lose data when running multiple accounts simultaneously?
118
+ <details>
119
+ <summary><strong>Will switching overwrite my settings?</strong></summary>
112
120
 
113
- No, as long as each terminal uses a **different** account. Each account has its own directory (`~/.cloak/profiles/<name>/`), so there's no file overlap. Terminal A writing to `work/` and Terminal B writing to `home/` never interfere.
121
+ 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.
122
+ </details>
114
123
 
115
- ### What about token renewals? Are they preserved when I switch?
124
+ <details>
125
+ <summary><strong>Are token renewals preserved?</strong></summary>
116
126
 
117
- Yes. When Claude Code renews your OAuth token during a session, it writes the new token to the active account's directory. When you switch away and back, the renewed token is still there — Cloak never touches those files.
127
+ 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.
128
+ </details>
118
129
 
119
- ### What happens if I create a new account? Does it affect existing ones?
130
+ <details>
131
+ <summary><strong>Can I lose data with multiple accounts running?</strong></summary>
120
132
 
121
- No. `cloak create` copies your current session into a **new** directory. Existing accounts are not modified. It's a snapshot, not a move.
133
+ No, as long as each terminal uses a different account. Each has its own directory no file overlap.
134
+ </details>
122
135
 
123
- ### What if I run the same account in two terminals at once?
136
+ <details>
137
+ <summary><strong>Is my auth token safe?</strong></summary>
124
138
 
125
- This is not recommended. Two Claude Code instances writing to the same directory (`~/.cloak/profiles/work/`) can cause token conflicts. This is a Claude Code limitation, not specific to Cloak the same issue exists without Cloak if you open two `claude` instances normally.
139
+ 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).
140
+ </details>
126
141
 
127
- ### What happens if I uninstall Cloak?
142
+ <details>
143
+ <summary><strong>What if I uninstall Cloak?</strong></summary>
128
144
 
129
- Your account directories remain in `~/.cloak/`. Claude Code continues to work normally with its default config. To use a saved account manually, set the environment variable:
145
+ Your account directories remain in `~/.cloak/`. Claude Code works normally with its default config. To clean up: `rm -rf ~/.cloak`
146
+ </details>
130
147
 
131
- ```bash
132
- export CLAUDE_CONFIG_DIR=~/.cloak/profiles/work
133
- claude
134
- ```
148
+ <details>
149
+ <summary><strong>Does it work with IDE extensions?</strong></summary>
135
150
 
136
- To clean up completely: `rm -rf ~/.cloak`
151
+ 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.
152
+ </details>
137
153
 
138
- ### Is my auth token safe?
154
+ ## Requirements
139
155
 
140
- Cloak never transmits, logs, or modifies your tokens. It only copies files during `cloak create` (from Claude Code's config to a profile directory) and changes an environment variable during `cloak switch`. All data stays local on your machine.
156
+ - Node.js >= 18
157
+ - bash or zsh (for shell integration)
141
158
 
142
- ### Does Cloak work with Claude Code IDE extensions (VSCode, JetBrains)?
159
+ ## Contributing
143
160
 
144
- 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 usage.
161
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
145
162
 
146
- ## Requirements
163
+ ## Security
147
164
 
148
- - Node.js >= 18
149
- - bash or zsh (for shell integration)
165
+ See [SECURITY.md](SECURITY.md).
150
166
 
151
167
  ## Documentation
152
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synth1s/cloak",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Cloak your Claude. Switch identities in seconds.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,12 +18,16 @@
18
18
  "cli",
19
19
  "switch",
20
20
  "multi-account",
21
- "cloak"
21
+ "cloak",
22
+ "switch-account",
23
+ "identity",
24
+ "multi-user",
25
+ "config"
22
26
  ],
23
27
  "author": "synth1s",
24
28
  "license": "MIT",
25
29
  "dependencies": {
26
- "commander": "^12.1.0",
30
+ "commander": "^14.0.3",
27
31
  "chalk": "^5.3.0",
28
32
  "inquirer": "^10.1.0"
29
33
  },