{"id":50748990,"url":"https://github.com/grammeaway/claudectx","last_synced_at":"2026-06-10T23:32:07.500Z","repository":{"id":354841339,"uuid":"1192688195","full_name":"grammeaway/claudectx","owner":"grammeaway","description":"CLI tool for easily managing and switching between Claude Code accounts in your local environment.","archived":false,"fork":false,"pushed_at":"2026-04-30T11:14:16.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-30T13:12:36.617Z","etag":null,"topics":["claude","claude-code","cli","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grammeaway.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-26T13:15:54.000Z","updated_at":"2026-04-30T11:14:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/grammeaway/claudectx","commit_stats":null,"previous_names":["grammeaway/claudectx"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/grammeaway/claudectx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grammeaway%2Fclaudectx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grammeaway%2Fclaudectx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grammeaway%2Fclaudectx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grammeaway%2Fclaudectx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grammeaway","download_url":"https://codeload.github.com/grammeaway/claudectx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grammeaway%2Fclaudectx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34175887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude","claude-code","cli","rust"],"created_at":"2026-06-10T23:32:04.089Z","updated_at":"2026-06-10T23:32:07.493Z","avatar_url":"https://github.com/grammeaway.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# claudectx \n\nEasily switch between multiple Claude Code contexts.\n\nUse an account for work, but another for personal use? No problem. With claudectx, you can quickly switch between different Claude Code contexts, all from the comfort of your terminal.\n\nInspired by `kubectx`.\n\n```\n$ claudectx list\n✓ work\n  personal\n  client-acme\n\n$ claudectx personal\n✓ Switched to context personal (~/.claude.json, ~/.claude/settings.json)\n  Restart Claude Code for changes to take effect.\n```\n\n## Table of Contents\n- [Why?](#why)\n- [Installation](#installation)\n- [Usage](#usage)\n- [How it works](#how-it-works)\n- [Tips](#tips)\n- [Security](#security)\n- [AI usage disclaimer](#ai-usage-disclaimer)\n\n## Why?\n\nClaude Code stores your identity, OAuth session, MCP servers, and settings in two files:\n\n| File | Contains |\n|------|----------|\n| `~/.claude.json` | OAuth session, account, MCP server configs, preferences (theme, editor mode) |\n| `~/.claude/settings.json` | Model selection, tool permissions, env vars, hooks |\n\nIf you use Claude Code with a work account **and** a personal account (or multiple API keys / subscriptions), swapping between them means manually editing those files each time. `claudectx` automates that.\n\n## Installation\n\n### Install from source (requires Rust / cargo)\nPressuming you have Rust installed, and the repository cloned:\n\n```bash\ncd claudectx\ncargo install --path .\n```\n\n### Build from source (requires Rust / cargo)\nPressuming you have Rust installed, and the repository cloned:\n\n```bash\ncd claudectx\ncargo build --release\n# copy binary somewhere on your PATH\ncp target/release/claudectx /usr/local/bin/\n```\n\n### Pre-built binary\n\nDownload from the releases page and place on your `$PATH`.\n\n## Usage\n\n```\nclaudectx [CONTEXT] [COMMAND]\n```\n\n### Quick switch (kubectx style)\n\n```bash\nclaudectx work        # switch to the \"work\" context\nclaudectx personal    # switch to the \"personal\" context\n```\n\n### Commands\n\n| Command | Alias | Description |\n|---------|-------|-------------|\n| `claudectx` | | List all contexts (default when no args) |\n| `claudectx list` | `ls` | List all contexts |\n| `claudectx save \u003cname\u003e` | | Snapshot current config as a named context |\n| `claudectx use \u003cname\u003e` | | Restore a saved context (same as bare `claudectx \u003cname\u003e`) |\n| `claudectx current` | | Print the active context name |\n| `claudectx delete \u003cname\u003e` | `rm` | Delete a saved context |\n| `claudectx rename \u003cold\u003e \u003cnew\u003e` | | Rename a context |\n| `claudectx copy \u003csrc\u003e \u003cdst\u003e` | | Duplicate a context |\n| `claudectx inspect \u003cname\u003e` | | Show files + top-level JSON keys stored in a context |\n| `claudectx version` | | Print the version (also available as `--version`) |\n\n### Typical workflow\n\n```bash\n# 1. Log into your work account in Claude Code, configure it how you like\nclaudectx save work\n\n# 2. Log into your personal account, set it up\nclaudectx save personal\n\n# 3. From now on, switching is instant\nclaudectx work\nclaudectx personal\n```\n\n### Shell prompt integration\n\nShow the active context in your prompt (bash/zsh):\n\n```bash\n# Add to ~/.bashrc or ~/.zshrc\nclaudectx_prompt() {\n  local ctx\n  ctx=$(claudectx current 2\u003e/dev/null)\n  [[ -n \"$ctx\" ]] \u0026\u0026 echo \"(%ctx%)\" | sed \"s/%ctx%/$ctx/\"\n}\nPS1='$(claudectx_prompt) \\$ '\n```\n\n## How it works\n\nContexts are stored in `~/.claudectx/`:\n\n```\n~/.claudectx/\n├── current              ← name of active context\n└── contexts/\n    ├── work/\n    │   ├── claude.json       ← snapshot of ~/.claude.json\n    │   └── settings.json     ← snapshot of ~/.claude/settings.json\n    └── personal/\n        ├── claude.json\n        └── settings.json\n```\n\nWhen you **save** a context, both files are copied in. When you **use** a context, they are copied back out (the previous live files are backed up as `.bak` first, just in case).\n\n## Tips\n\n- **Partial contexts are fine.** If you only have `~/.claude.json` and no `settings.json`, that's saved and restored correctly.\n- **MCP servers per-account.** Since `~/.claude.json` stores user-scoped MCP servers, switching context also switches which MCP servers are active.\n- **Backups.** Before overwriting your live files, the previous versions are saved as `~/.claude.json.bak` and `~/.claude/settings.json.bak`.\n- **Restart Claude Code** after switching — it reads config at startup.\n\n## Security\n\nContext files are stored unencrypted in `~/.claudectx/`. On macOS, OAuth tokens inside `~/.claude.json` may actually be references to Keychain entries, not raw secrets. On Linux/Windows, they may be stored in plaintext — keep `~/.claudectx/` permissions tight:\n\n```bash\nchmod 700 ~/.claudectx\n```\n\nNever commit your `~/.claudectx/` directory to version control.\n\n## AI usage disclaimer\nThis tool was built using Claude Code, and may contain inaccuracies or bugs. Use with caution and verify critical actions manually. Feedback and contributions are welcome to improve the tool!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrammeaway%2Fclaudectx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrammeaway%2Fclaudectx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrammeaway%2Fclaudectx/lists"}