← Projects

claude-shim

Automatic Claude Code profile manager

claude-shim

claude-shim is a per-project profile manager for Claude Code. It swaps CLAUDE_CONFIG_DIR based on the directory you’re in, and shows the active profile right in your shell prompt.

Why

Claude Code keeps auth, history, and settings under a single ~/.claude directory. Running more than one - personal vs work, or separate accounts - means exporting CLAUDE_CONFIG_DIR by hand and tracking which one is live. claude-shim picks the profile from the project directory and surfaces it in your prompt, so the right config is always active and always visible.

Features

  • Per-project profiles - swaps CLAUDE_CONFIG_DIR automatically from the project directory, no manual exports.
  • Effort level - pins an effort level per profile or project, even max, which settings.json silently drops.
  • Prompt indicator - shows the active profile right in your shell prompt.
  • statusLine indicator - shows the active profile in Claude Code’s in-session status bar.

Install

Install the prebuilt binary with mise:

mise use -g github:petr-korobeinikov/claude-shim@latest

Or build from source:

cargo build --release

Wire up the shell hook - add to ~/.zshrc and re-source it or restart your shell:

eval "$(claude-shim init zsh)"

Usage

Create profiles and point a project at one:

claude-shim profile new personal --default  # create a profile, make it the default
claude-shim profile new work                # create another
cd ~/Workspace/acme
claude-shim profile use work                # this directory now runs under `work`
claude-shim current                         # print the active profile

Tech stack

  • Rust (edition 2024), clap-based CLI
  • Per-tag prebuilt binaries and a published crate on crates.io
  • Install via mise or cargo, Gitflow branch lifecycle, CalVer releases
  • CI on GitHub Actions with codecov coverage