> ## Documentation Index
> Fetch the complete documentation index at: https://cac.nextmind.space/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install cac and create your first isolated environment.

<Steps>
  <Step title="Install cac">
    <Tabs>
      <Tab title="npm">
        ```bash theme={null}
        npm install -g claude-cac
        ```
      </Tab>

      <Tab title="Script">
        ```bash theme={null}
        curl -fsSL https://raw.githubusercontent.com/nmhjklnm/cac/master/install.sh | bash
        ```
      </Tab>
    </Tabs>

    No `setup` command needed — cac auto-initializes on first use.

    <Warning>
      If you have **Clash, Shadowrocket, Surge, sing-box** or other proxy/VPN tools running locally, **turn them off before using cac**. TUN-mode proxy compatibility is still experimental and may cause connection conflicts. Even if a conflict occurs, cac will **fail-closed** (refuse to connect) rather than leak your real IP — your privacy is always protected.
    </Warning>
  </Step>

  <Step title="Install a Claude Code version">
    ```bash theme={null}
    cac claude install latest
    ```

    Downloads the latest Claude Code binary with SHA256 verification. You can also install a specific version:

    ```bash theme={null}
    cac claude install 2.1.81
    ```
  </Step>

  <Step title="Create an environment">
    Every environment gets an isolated identity (UUID, hostname, MAC), its own `.claude` config directory, and auto-downloads the latest Claude Code version.

    ```bash theme={null}
    # Minimal — just identity isolation
    cac env create personal

    # With proxy
    cac env create work -p 1.2.3.4:1080:user:pass

    # With proxy + pinned version
    cac env create work -p 1.2.3.4:1080:user:pass -c 2.1.81
    ```

    The environment is **automatically activated** after creation — no separate activate step needed.

    <Info>
      Proxy is optional. If you use an API key with a base URL, you don't need `-p` at all. See [API key users](/docs/guides/api-key-users).
    </Info>
  </Step>

  <Step title="Run Claude Code">
    ```bash theme={null}
    claude
    ```

    The first time, type `/login` in Claude Code to complete OAuth. After that, just `claude`.

    To switch environments later: `cac <name>` (e.g. `cac work`).
  </Step>
</Steps>

## What just happened?

When you activated `work` and ran `claude`, cac's wrapper:

1. Set `CLAUDE_CONFIG_DIR` to `~/.cac/envs/work/.claude/` (isolated config)
2. Resolved the pinned Claude Code binary from `~/.cac/versions/2.1.81/claude`
3. Injected device fingerprint shims (hostname, UUID, MAC)
4. Blocked telemetry endpoints via DNS guard + environment variables
5. Routed traffic through your proxy (if configured)
6. Launched the real Claude Code binary

All of this is invisible to Claude Code — it sees a normal environment.

## Tips

* **Verify your setup**: Run `cac env check` anytime to confirm your privacy protection is working. You can trust its results — if it says all green, you're protected.
* **Check which claude you're running**: `which claude` shows whether you're using the cac-managed wrapper (`~/.cac/bin/claude`) or the default system claude.
* **Automatic safety checks**: Every time you start a new Claude Code session, cac automatically runs a quick check. If your environment or privacy has any issue, the session is terminated before any data is sent.
* **Network resilience**: Proxy connections can be unstable. cac enforces strict proxy routing — if the proxy drops, traffic stops entirely rather than falling back to a direct connection. Your IP is never accidentally exposed.
* **Modify environments after creation**: Use `cac env set` to change proxy or version without recreating the environment.

## Next steps

<Columns cols={2}>
  <Card title="Proxy setup" icon="globe" href="/docs/guides/proxy-setup">
    Protocol auto-detection, SOCKS5, share links.
  </Card>

  <Card title="Docker mode" icon="docker" href="/docs/guides/docker-mode">
    Fully isolated container with TUN networking.
  </Card>
</Columns>
