Using Claude Code in Your Workstation

In the previous tutorials you created a workstation, added tools, and learned how to manage its lifecycle. Now you'll install Claude Code - Anthropic's AI coding assistant - directly inside your workstation.

The highlight of this tutorial is something that might surprise you: when Claude needs you to log in, the browser opens on your Mac - even though Claude is running inside a VM.

Prerequisites

Step 1: Add a Label to Your Workstation

Open your my-first-workstation.yaml file and add claude: "true" to the labels:

apiVersion: werkr.dev/v1alpha1
kind: Workstation
metadata:
  name: my-first-workstation
  labels:
    team: tutorial
    claude: "true"
spec:
  os:
    id: ubuntu-24.04
  provider: lima
  resources:
    cpu: 4
    memory: 3
    diskSize: 50

Apply the updated manifest:

wer apply -f my-first-workstation.yaml

Step 2: Create a Claude Config

Create a new file called my-claude-config.yaml:

apiVersion: werkr.dev/v1alpha1
kind: WorkstationConfig
metadata:
  name: claude-tools
spec:
  selector:
    matchLabels:
      claude: "true"
  portForward:
    autoForward: true
  contents:
    devtools:
      - claude
      - www-browser-remote
    packages:
      - xdg-utils

The claude devtool installs Claude Code. The www-browser-remote devtool sets up browser forwarding so that when anything in the VM tries to open a URL, it opens on your Mac instead. The xdg-utils package provides the underlying URL-opening support. The portForward: autoForward: true setting automatically forwards ports from the VM to your Mac - this is needed so that the OAuth callback from your browser reaches the authentication server running inside the VM.

Apply it:

wer apply -f my-claude-config.yaml

Since your workstation has the label claude: "true", the config matches and the worker starts installing Claude in the background.

Step 3: Wait for Installation

Claude Code takes a minute to install. Check when it's ready:

wer get workstation

Wait until the status returns to Running.

Step 4: Shell In and Launch Claude

Connect to your workstation:

wer shell --name my-first-workstation

Then start Claude Code:

claude

Watch what happens: a browser window opens on your Mac for you to log in to your Claude account. Once you authenticate, Claude Code is running and ready to use - inside your VM.

What Just Happened?

When Claude tried to open a browser for authentication, werkr intercepted that request and forwarded it to your Mac over the SSH connection. This happens automatically whenever a process inside your workstation tries to open a URL - no configuration needed.

This means any tool that opens a browser for authentication - Claude, the Google Cloud CLI, GitHub - just works, even when you're connected to a VM running anywhere in the world.

Next Steps

You now have a fully configured local workstation with Claude Code installed and authenticated. From here you can explore: