css

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 5 Imported by: 0

README

css — Claude Subscription Switcher

Instantly switch between multiple Claude Code CLI accounts without re-authenticating.

Go version

If you use Claude Code with more than one subscription — say a personal account and a work account — you have to log out and log back in every time you switch. css eliminates that friction by snapshotting each account's local state and restoring it on demand, in under a second.

Session context, project history, and settings are preserved per-profile, so you pick up exactly where you left off on each account.


How it works

Claude Code CLI stores its credentials and session data in the home directory:

Path Contents
~/.claude/ Credentials, settings, project history, todos, shell snapshots, MCP config, …
~/.claude.json Global config (user ID, telemetry, onboarding state, …)

When you run css save <name>, those files are copied into ~/.css/profiles/<name>/payload/ verbatim.

When you switch profiles, css:

  1. Writes back the current state into the previously active profile (so nothing is lost — sessions stay continuous per account).
  2. Removes the Claude files from your home directory.
  3. Restores the chosen profile's payload into your home directory.
  4. Updates ~/.css/state.json to track the new active profile.

The entire swap is a local file operation — no network, no auth prompts.


Installation

Via go install (requires Go 1.24+):

go install github.com/Savalinn/css@latest

From source:

git clone https://github.com/Savalinn/css
cd css
go build -o css .
# Move the binary somewhere on your PATH, e.g.:
mv css /usr/local/bin/

Quick start

# 1. Log in to your personal Claude account first, then snapshot it:
css save personal

# 2. Log in to your work account (css save will switch context automatically):
css save work

# 3. From now on, switch interactively:
css

The interactive picker looks like this:

Select a Claude profile

▸ ● personal
  work

↑/↓ navigate • Enter activate • Esc cancel

marks the currently active profile. The cursor starts on it.


Commands

Command Description
css Open the interactive profile picker
css save <name> Snapshot current Claude state as <name>
css use <name> Switch to <name> (no interactive picker)
css list List all saved profiles (* = active)
css current Print the active profile name
css delete <name> Permanently delete a saved profile
css version Print version
css help Show help
Picker keyboard shortcuts
Key Action
/ k Move up
/ j Move down
Home / g Jump to top
End / G Jump to bottom
Enter Activate selected profile
Esc / q Cancel without switching

Profile storage layout

~/.css/
├── state.json              # active profile name
└── profiles/
    ├── personal/
    │   ├── profile.json    # metadata (name, created_at, updated_at)
    │   └── payload/
    │       ├── .claude/    # mirror of ~/.claude/
    │       ├── .claude.json
    │       └── .claude.json.backup
    └── work/
        ├── profile.json
        └── payload/
            └── …

Security notice

Profile payloads contain your Claude authentication tokens exactly as Claude Code stores them — they are plain files, not encrypted.

  • Do not commit ~/.css/ to version control.
  • Do not share ~/.css/profiles/ with others.
  • Consider storing ~/.css/ on an encrypted volume or inside an encrypted container if you work on a shared machine.

File permissions are set to 0600/0700 by css to limit access to your user only, but this is no substitute for full-disk or volume encryption.


Contributing

Bug reports and pull requests are welcome. Please open an issue before submitting a large change so we can discuss the approach first.

License

MIT

Documentation

Overview

css is the CLI entry point for Claude Subscription Switcher.

Usage:

css                  interactive profile picker
css save <name>      snapshot current subscription
css use <name>       switch without the interactive picker
css list             list saved profiles
css current          print the active profile name
css delete <name>    delete a saved profile
css help             show help
css version          print version

Directories

Path Synopsis
internal
claude
Package claude knows the location of the configuration and auth files that Claude Code CLI stores in the user home directory.
Package claude knows the location of the configuration and auth files that Claude Code CLI stores in the user home directory.
fsutil
Package fsutil provides small filesystem helpers used by the profile layer.
Package fsutil provides small filesystem helpers used by the profile layer.
profile
Package profile manages css profiles: saving, restoring, listing, deleting, and tracking the active profile.
Package profile manages css profiles: saving, restoring, listing, deleting, and tracking the active profile.
ui
Package ui provides a minimal arrow-key navigable profile picker.
Package ui provides a minimal arrow-key navigable profile picker.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL