
Security News
npm v12 Ships With Install Scripts Off by Default, Begins Deprecating 2FA-Bypass Tokens
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.
@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
ccst can manage the CCS (Claude Code Server) daemon for background processing:
# Install CCS CLI tool (interactive package manager selection)
ccst ccs install
# Run initial setup
ccst ccs setup
# Force setup even if already configured
ccst ccs setup -f
# Start daemon
ccst ccs start
# Start with specific dashboard port
ccst ccs start -p 3001
# Force restart if already running
ccst ccs start -f
# Keep existing logs (append instead of truncate)
ccst ccs start --keep-logs
# Stop daemon
ccst ccs stop
# Force kill daemon
ccst ccs stop -f
# Check daemon status
ccst ccs status
# View logs (last 50 lines by default)
ccst ccs logs
# View more lines
ccst ccs logs -n 100
# Follow logs in real-time
ccst ccs logs -f
Backup and restore all CCS configuration:
# Export configuration to ZIP file
ccst config dump
# Export to custom path
ccst config dump my-backup.zip
# Import configuration from ZIP
ccst config load
# Import from custom path
ccst config load my-backup.zip
# Replace all existing files during import
ccst config load -r
# Skip confirmation prompt
ccst config load -y
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
CCS daemon files (~/.ccs/):
~/.ccs/
├── .daemon.pid # Daemon process ID
├── .daemon.log # Daemon log file
└── .daemon.ports # Dashboard port tracking
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 ccs install - Install CCS CLI tool (interactive package manager selection)ccst ccs setup - Run CCS initial setupccst ccs setup -f - Force setup even if already configuredccst ccs start - Start CCS daemonccst ccs start -f - Force restart if already runningccst ccs start -p <port> - Start with specific dashboard portccst ccs start --keep-logs - Keep existing logs (append instead of truncate)ccst ccs stop - Stop CCS daemonccst ccs stop -f - Force kill daemon (SIGKILL)ccst ccs status - Show daemon status, PID, and log infoccst ccs logs - View daemon logs (last 50 lines)ccst ccs logs -n <lines> - View specified number of linesccst ccs logs -f - Follow log output in real-timeccst config dump [output] - Export CCS config to ZIP (default: ccs-config.zip)ccst config load [input] - Import CCS config from ZIP (default: ccs-config.zip)ccst config load -r - Replace all existing files during importccst config load -y - Skip confirmation promptccst --completions <shell> - Generate shell completionsccst --help - Show help informationccst --version - Show versionccst 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 24 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.

Security News
npm v12 is generally available, turning install scripts off by default and beginning the deprecation of 2FA-bypass publishing tokens.

Research
/Security News
Socket tracks the activity as Operation “Muck and Load”: a threat actor uses commit-farming workflows, public dead drops, and protected archives to stage Windows RAT and infostealer malware.

Security News
pnpm 11.10 hardens registry auth to block token redirection, tightens pack-app and deploy, and makes the Rust port (v12) installable.