ClaudeX is a companion CLI for Claude Code that finds every Claude account on the machine and configures them identically, writes an AGENTS.md and skills layout into a project, and launches a session under the account you pick.
It exists for juggling several Claude subscriptions, and everything except the account picker works the same with one. It does not replace claude, which launch execs.
| Category | Commands | Description |
|---|---|---|
| Accounts | configure, status, switch, oauth-token |
Provision every account, read its usage, move a project between accounts |
| Sessions | launch |
Pick the account and the session, then exec claude |
| Project layout | apply, apply-preset, clean-cwd |
Write and remove the AGENTS.md and skills layout |
| Presets | create-preset, pull-preset |
Scaffold your own bundle of skills and rules, or pull one from a repository |
# Linux/macOS
curl -sL https://github.com/tanq16/claudex/releases/latest/download/claudex-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') -o claudex
chmod +x claudex
sudo mv claudex /usr/local/bin/Each release carries claudex-linux-amd64, claudex-linux-arm64, claudex-darwin-amd64, and claudex-darwin-arm64.
Needs Go 1.27.
git clone https://github.com/tanq16/claudex.git
cd claudex
make buildmake build-all produces all four platform binaries instead.
--debug is on every command and swaps the styled output for zerolog: a timestamped console line in a terminal, and JSON when stdout is not one. Color and cursor redraws drop automatically off a terminal too, so piping any command gives plain text with no flag. -A/--account takes an account config directory path, and on launch and switch it also matches on just the directory name. Global state lives under ~/.config/claudex/, holding the plugin in global/ and presets in presets/.
Provisions every discovered account, then lays down the global defaults once.
Per account it writes statusline.sh into the account directory and points settings.json at it. The statusline shows the account label, the model, the working directory, the git branch, context used, and the 5h and 7d rate-limit percentages. It also merges these keys into the existing settings.json, leaving every other key alone:
| Key | Value |
|---|---|
attribution.commit |
"" |
effortLevel |
xhigh |
tui |
fullscreen |
autoMemoryEnabled |
false |
skipDangerousModePermissionPrompt |
true |
outputStyle |
Concise |
env.DISABLE_AUTOUPDATER |
1 |
env.ENABLE_CLAUDEAI_MCP_SERVERS |
false |
An account whose settings.json is not valid JSON is skipped rather than overwritten.
The global defaults are a Claude Code plugin at ~/.config/claudex/global/, carrying an .lsp.json that wires gopls, pyright-langserver, and typescript-language-server, plus the built-in presets extracted into ~/.config/claudex/presets/.
-A configures one account instead of all of them. -l/--label overrides the account label in the statusline and requires -A; without it the label comes from the directory name, where .claude is first, .claude2 is second, .claude3 is third, and anything else uses the numeric suffix.
Writes the layout into the current directory:
AGENTS.md base instruction block, between <!-- claudex:base --> markers
CLAUDE.md -> AGENTS.md
.agents/skills/ agents-md, session-summary, skill-creator, write-document
.claude/skills -> ../.agents/skills
AGENTS.md and .agents/skills/ are the real files, following the Agent Skills layout that Cursor and Codex read on their own, and the two symlinks exist because Claude Code looks for the other names.
An existing AGENTS.md keeps everything outside the markers: the base block is inserted or replaced in place. The same four paths also go into .git/info/exclude, which is local to your clone, so the layout never appears in git status and never gets pushed.
Nothing is written when any of those paths already holds something ClaudeX did not put there. Every conflict is reported at once so you can clear them in one pass rather than one run per path.
A preset is a directory holding a preset.yaml, an optional AGENTS.partial.md, and an optional skills/ directory. Local presets sit under ~/.config/claudex/presets/, and presets pulled from a repository sit under ~/.config/claudex/remote-presets/<owner>-<repo>/. Applying one symlinks its skills into .agents/skills/ and writes its partial as its own marked section of AGENTS.md, so re-applying replaces that section instead of appending a second copy. It also removes any skill link whose target no longer exists, which is what a skill dropped from a preset leaves behind. It needs claudex apply to have run first.
A preset is addressed by its directory name, and a pulled one is qualified with the repository slug so two repositories can ship the same name.
claudex apply-preset # multi-select picker
claudex apply-preset private # local, by name; several apply in order
claudex apply-preset tanq16-presets/go-strict # pulled, by <slug>/<name>--skills links only the skills and leaves AGENTS.md alone. --agents writes only the section and links no skills. Neither flag applies the whole preset; passing one narrows the run to that half.
One preset ships in the binary. private carries 30 skills covering Go and Node conventions, containers, release workflows, and testing, plus the author's development, pull request, and operating rules as an AGENTS.md section.
The manifest keys:
| Key | Default | Description |
|---|---|---|
name |
the directory name | The directory a pulled preset installs into |
description |
empty | One line shown beside the name in the picker |
skills |
every directory under skills/ holding a SKILL.md |
Which skills to link |
Scaffolds ~/.config/claudex/presets/<name>/ with a preset.yaml, an empty AGENTS.partial.md, and an empty skills/. Names take lowercase letters, digits, and single hyphens.
Clones a repository at depth 1 into a temporary directory and installs the presets it holds under ~/.config/claudex/remote-presets/<owner>-<repo>/. Nothing tracks the clone afterwards, so pulling again is how you update.
claudex pull-preset tanq16/presets # every preset in the repo
claudex pull-preset https://github.com/tanq16/presets.git # a full URL works too
claudex pull-preset tanq16/monorepo --path tools/go-strict # one, by repo-relative pathWithout --path, a preset is the repository root when it holds a preset.yaml, and otherwise every directory one level under the root that holds one. The whole slug directory is replaced, so a preset deleted upstream disappears on the next pull. With --path, only that one preset is replaced and the rest of the slug is left alone.
Cloning runs git, so a private repository works with whatever credentials you already have. A path on this machine is rejected rather than cloned, because a preset already here belongs in the presets directory. Removing a pulled repository means deleting its slug directory.
Removes what apply and apply-preset wrote: .agents/, both symlinks, the ClaudeX sections of AGENTS.md, and the .git/info/exclude block.
Prompts for new or resume, for the account, and for MCP mode, then execs claude with --dangerously-skip-permissions, a --plugin-dir pointing at the global plugin, and CLAUDE_CONFIG_DIR set to the account you picked. Any inherited CLAUDE_CONFIG_DIR is stripped first so it cannot override that choice. The plugin is rebuilt on every launch, so language servers work without running configure.
The new-or-resume prompt only appears when this project has sessions, and the account prompt only when there is more than one account. Resume lists this project's 10 most recent sessions across every account, and picking one launches under the account that holds it.
| Flag | Effect |
|---|---|
-A/--account |
Skip the account picker |
--new |
Start a new session |
--resume |
Resume: the latest session, or a list when there is more than one |
--session <id> |
Resume that session by id |
--mcp mcps|connectors|none |
Skip the MCP picker |
--new, --resume, and --session are mutually exclusive. The MCP modes are mcps for MCP servers on, connectors to add Claude.ai connectors on top, and none for --strict-mcp-config. Launch hands the session to claude, so it errors without an interactive terminal.
Per account, the 5h session window and the 7d windows as bars with their reset times. It reads the account's OAuth token from the macOS Keychain or from .credentials.json and queries Anthropic's usage endpoint, so an expired token shows as a prompt to open Claude Code on that account. --json prints the raw numbers, -A limits it to one account.
Moves the current project's session files and history entries out of the account holding them and into another. It needs at least two accounts, and -A/--account is required without an interactive terminal.
The picker lists this project's sessions from every account, under a row that takes all the ones in the account holding the newest. Picking a single session moves only that session, out of whichever account holds it. --session <id> names one directly and skips the picker, and without a terminal there is no picker, so it moves the whole account unless --session narrows it.
Runs the OAuth PKCE flow in a browser and prints an access token to stdout. -p/--port pins the local callback port, which defaults to one the OS picks, and -e/--expires-in sets the requested expiry in seconds, which the server may override. --manual prints the authorize URL instead of opening a browser and takes the code pasted back, for a machine with no browser to hand off to. Status lines and the URL are printed only on a terminal or under --debug, so TOKEN=$(claudex oauth-token) still captures the token alone.
- Account discovery.
~/.claudeand every~/.claudeNdirectory whose suffix is digits, such as~/.claude2. Nothing else in your home directory counts as an account. - Preset skills are symlinks. They point back into
~/.config/claudex/presets/, so editing a preset changes every project that applied it. The four base skills fromapplyare real copies extracted from the binary, so re-runningapplyis what updates them. - Built-in presets are refreshed from the binary.
~/.config/claudex/presets/private/is rewritten whenever a preset command runs, so edits to it do not survive. Presets you create yourself are never touched. - Language server binaries are yours to install. ClaudeX writes the
.lsp.json, and a server whose binary is missing is skipped while the rest still start. Install commands and thetypescript@5pin are in docs/language-servers.md. - Another repo's agent files.
.git/info/excludeonly reaches untracked files, so aGEMINI.mdor.cursor/that the repository itself tracks stays in your working tree. docs/foreign-agent-files.md covers the sparse-checkout that removes them.