leog

Claude Code Config Dir Patcher VSCode — Development skill for Claude Code

Development community

This VS Code extension lets you run multiple Claude Code accounts by patching Anthropic's anthropic.claude-code extension so this setting affects both spawned Claude processes and the extension auth.

How to install Claude Code Config Dir Patcher VSCode

This entry records only its repository, not the path inside it, so there is no exact command to give. Open leog/claude-code-config-dir-patcher-vscode and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Code Config Dir Patcher VSCode does

This VS Code extension lets you run multiple Claude Code accounts by patching Anthropic's anthropic.claude-code extension so this setting affects both spawned Claude processes and the extension auth.

Alternatives in Development

  • Check 1: Cache Exists? — CLAUDE_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}" CACHE_EXISTS=$(ls -d "$CLAUDE_DIR/plugins/cache/claude-hud" 2 10.9k ★
  • Claude Coder — Kodu is an autonomous coding agent that lives in your IDE 5.2k ★
  • Hive — Browser-native hive-mind for CLI coding agents — Claude Code, Codex, Gemini, and OpenCode collaborate as real 473 ★

README

Claude Code Profiles

This VS Code extension lets you run multiple Claude Code accounts by patching Anthropic's `anthropic.claude-code` extension so this setting affects both spawned Claude processes and the extension auth/session layer:

"claudeCode.environmentVariables": [
  { "name": "CLAUDE_CONFIG_DIR", "value": "/Users/you/.claude-work" }
]

Why

Claude Code CLI supports `CLAUDE_CONFIG_DIR`, but Anthropic's VS Code extension currently has storage helpers that read `process.env.CLAUDE_CONFIG_DIR` directly while `claudeCode.environmentVariables` is only applied to launch environments. That means VS Code profile settings alone do not fully isolate accounts.

This patch makes the configured `CLAUDE_CONFIG_DIR` visible to the extension process and changes the hardcoded `~/.claude/ide` path to use the selected config dir.

Commands

  • Claude Code Profiles: Apply Patch
  • Claude Code Profiles: Verify Patch
  • Claude Code Profiles: Restore Backup

By default the patch is applied automatically on startup. A backup is written next to Anthropic's `extension.js` with this suffix:

.claude-config-dir-patcher.bak

Error analytics

This extension can send redacted error reports to Sentry when patching, verification, restore, or startup auto-patching fails. It also sends a one-time `extension.installed` event on first activation to estimate install counts and installed version distribution. Analytics are sent only when all of these are true:

  • VS Code telemetry is enabled.
  • claudeConfigDirPatcher.analytics.enabled is enabled.

The extension does not send default PII, request data, or file contents. Home directory paths in error messages and stack traces are replaced before sending.

Every report carries an **anonymous user id** so unique users can be counted instead of raw event counts. It is a SHA-256 hash of VS Code's built-in random telemetry id (`vscode.env.machineId`) prefixed with this extension's name. It contains no account, h