🎯 Background & Motivation

As AI coding assistants like Claude Code become daily drivers in software development, power users frequently juggle multiple API environments:

  1. Multiple Endpoints & Proxies: Switching between Anthropic official endpoints, private gateways, and self-hosted routing proxies.
  2. Account & Token Rotation: Managing separate billing keys across enterprise, open-source, and personal projects.
  3. Friction of Manual Configs: Modifying ~/.zshrc or ~/.claude.json by hand is cumbersome and prone to typos.

CCSwitch for Mac was designed for AI-native engineering: Lives quietly in the macOS menu bar, enabling instant environment switching in a single click.


🚀 Key Features

  • ⚡ Instant Menu Bar Switching: Access all configured profiles anywhere on macOS via the system menu bar.
  • 🔒 Secure Local Storage: Keeps sensitive API tokens encrypted on-device with zero cloud telemetry.
  • 🛠️ Immediate Terminal Sync: Updates active environment variables and configuration files on-the-fly without terminal restarts.
  • 💻 Ultra-Lightweight Native App: Built in pure Swift + AppKit with memory footprint under 15MB.

🏗️ Menu Bar Implementation

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import AppKit

final class StatusBarController: NSObject {
    private var statusItem: NSStatusItem!
    private var menu: NSMenu!
    
    override init() {
        super.init()
        setupStatusBar()
    }
    
    private func setupStatusBar() {
        statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
        if let button = statusItem.button {
            button.image = NSImage(named: "MenuBarIcon")
            button.imagePosition = .imageOnly
        }
        buildMenu()
    }
    
    func switchEnvironment(to env: ClaudeEnvironment) {
        ClaudeConfigManager.shared.apply(env)
        updateActiveIndicator(for: env)
    }
}

📈 Deliverables & Integration