
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
@leynier/ccst
Advanced tools
Fast and predictable way to manage Claude Code contexts (
~/.claude/settings.json)
ccst (Claude Code Switch Tools) is inspired by cctx, which is itself inspired by kubectx, and ports the cctx experience to TypeScript with additional capabilities. Switch between permission sets, environments, and settings with a single command.
ccst -Install globally with npm (default):
npm install -g @leynier/ccst
Alternative package managers:
# bun
bun add -g @leynier/ccst
# pnpm
pnpm add -g @leynier/ccst
# yarn
yarn global add @leynier/ccst
# 1. Create your first context from current settings
ccst -n personal
# 2. Create a restricted work context
ccst -n work
# 3. Switch between contexts
ccst work # Switch to work
ccst personal # Switch to personal
ccst - # Switch back to previous
# List all contexts
ccst
# Switch to a context
ccst work
# Switch to previous context
ccst -
# Show current context
ccst -c
ccst respects Claude Code's settings hierarchy with explicit flags:
# Default: always uses user-level contexts
ccst # Manages ~/.claude/settings.json
# Explicit flags for project/local contexts
ccst --in-project # Manages ./.claude/settings.json
ccst --local # Manages ./.claude/settings.local.json
# All commands work with any level
ccst --in-project work # Switch to 'work' in project contexts
ccst --local staging # Switch to 'staging' in local contexts
# Create new context from current settings
ccst -n project-alpha
# Delete a context
ccst -d old-project
# Rename a context (prompts for new name)
ccst -r old-name
# Edit context with $EDITOR
ccst -e work
# Show context content (JSON)
ccst -s production
# Unset current context
ccst -u
# Export context to file
ccst --export production > prod-settings.json
# Import context from file
ccst --import staging < staging-settings.json
# Share contexts between machines
ccst --export work | ssh remote-host 'ccst --import work'
Merge permissions from other contexts or files to build complex configurations:
# Merge user settings into current context
ccst --merge-from user
# Merge from another context
ccst --merge-from personal work
# Merge from a specific file
ccst --merge-from /path/to/permissions.json staging
# Remove previously merged permissions
ccst --unmerge user
# View merge history
ccst --merge-history
# Merge into a specific context (default is current)
ccst --merge-from user production
Merge features:
Enable tab completion for faster workflow:
# Bash
ccst --completions bash > ~/.local/share/bash-completion/completions/ccst
# Zsh
ccst --completions zsh > /usr/local/share/zsh/site-functions/_ccst
# Fish
ccst --completions fish > ~/.config/fish/completions/ccst.fish
# PowerShell
ccst --completions powershell > ccst.ps1
ccst includes importer commands to migrate existing profiles:
# Import from CCS profiles (~/.ccs/*.settings.json)
ccst import ccs
# Import from configs directory (default: ~/.ccst)
ccst import configs
# Use a custom configs directory
ccst import configs -d /path/to/configs
Contexts are stored as individual JSON files at different levels:
User level (~/.claude/):
~/.claude/
├── settings.json # Active user context
└── settings/
├── work.json # Work context
├── personal.json # Personal context
└── .cctx-state.json # State tracking
Project level (./.claude/):
./.claude/
├── settings.json # Shared project context
├── settings.local.json # Local project context (gitignored)
└── settings/
├── staging.json # Staging context
├── production.json # Production context
├── .cctx-state.json # Project state
└── .cctx-state.local.json # Local state
When no arguments are provided, ccst can enter interactive mode:
# Interactive context selection
CCTX_INTERACTIVE=1 ccst
# Create restricted work context for safer collaboration
ccst -n work
ccst -e work # Edit to add restrictions
# Create project-specific contexts
ccst -n client-alpha
ccst -n side-project
ccst -n experiments
# Switch based on current work
ccst client-alpha
ccst experiments
# Morning: start with work context
ccst work
# Need full access for personal project
ccst personal
# Quick switch back to work
ccst -
# Check current context anytime
ccst -c
ccst - List contexts (defaults to user-level)ccst <name> - Switch to contextccst - - Switch to previous contextccst -c - Show current context nameccst -q - Quiet mode (only show current context)ccst -n <name> - Create new context from current settingsccst -d <name> - Delete context (interactive if no name)ccst -r <name> - Rename context (prompts for new name)ccst -e [name] - Edit context with $EDITORccst -s [name] - Show context content (JSON)ccst -u - Unset current context (removes settings file)ccst --export [name] - Export context to stdoutccst --import <name> - Import context from stdinccst import ccs - Import from CCS settings (~/.ccs)ccst import configs - Import from configs directory (default: ~/.ccst)ccst import configs -d <dir> - Import from a custom configs directoryccst import ccs -d <dir> - Use custom configs directory for default.jsonccst --merge-from <source> [target] - Merge permissions from source into target (default: current)
user, another context name, or file pathccst --merge-from <source> --merge-full [target] - Merge ALL settings (not just permissions)ccst --unmerge <source> [target] - Remove previously merged permissionsccst --unmerge <source> --merge-full [target] - Remove ALL previously merged settingsccst --merge-history [name] - Show merge history for contextccst - User-level contexts (default: ~/.claude/settings.json)ccst --in-project - Project-level contexts (./.claude/settings.json)ccst --local - Local project contexts (./.claude/settings.local.json)ccst --completions <shell> - Generate shell completionsccst --help - Show help informationccst is a TypeScript port of cctx with some differences. Behavior and output are intentionally close to cctx, but there may be small UX or implementation differences.
FAQs
Claude Code Switch Tools for managing contexts
The npm package @leynier/ccst receives a total of 20 weekly downloads. As such, @leynier/ccst popularity was classified as not popular.
We found that @leynier/ccst demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.