Skip to content
Draft, pre-release documentation

A workspace can start a coding agent inside the session for the person using it. They give it tasks and answer its questions in the sidebar, and its work stays in the session. You decide whether the workspace offers one, which agent it is, and whose credentials it uses. This page assumes the runtime is already enabled (Enable the runtime on a workspace).

The agent needs a model, and it uses its own provider’s: Claude Code, Codex and OpenCode each sign in to their own service. The runtime needs no model for this.

The runtime starts the agent in a terminal pane inside the session, using the Herdr terminal host. The image has to carry the agent’s program, Herdr, and one inventory record per agent that says it is available. Kasm nix images supply these for the agents they publish.

The stock-image layer adds none of them, so a stock workspace is driven from outside or by scenarios. To offer an agent on your own image, see Inventory records.

Set these in the workspace’s environment map, the same place as the session token.

Variable Value Effect
KASM_RUNTIME_AGENT local The workspace offers a managed agent
remote Only outside callers use the session. This is the default when a session token is set
none No agent consumer. The default with no token
KASM_RUNTIME_HARNESS claude, codex or opencode Start exactly this agent
auto, or unset Use the one agent the image carries. With several, the person chooses in the workspace launch settings

KASM_RUNTIME_HARNESS applies only when KASM_RUNTIME_AGENT is local.

On nix images the workspace launch form can offer the same choice, and the person picks the agent when they launch.

An agent you name is never replaced by another one. If it is unavailable in the image, the sidebar says why and offers nothing else.

The agent runs as the session user and uses the credentials the session gives it. Two ways to give them:

  • Put a key in the workspace’s environment map. Every session of the workspace then uses that account, and its usage is billed there. Anything running as the session user can read the key.
  • Leave it out. The person signs in themselves, in the agent’s own terminal, the first time.
Agent Credentials from the workspace Otherwise
Claude Code ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, an apiKeyHelper in Claude’s settings, or a sign-in already saved in the profile The person signs in to Claude in the terminal
Codex OPENAI_API_KEY, saved as Codex’s sign-in before launch The person signs in to Codex in the terminal
OpenCode None needed to start. OpenCode answers with its own free models before any sign-in The person connects a provider with /connect in the terminal

When Claude Code already has credentials, the runtime finishes Claude’s first-run setup before launch, so no theme picker or “use this API key?” question appears. A profile directory set with CLAUDE_CONFIG_DIR is left alone. Without credentials Claude’s own setup and sign-in open in the terminal.

The runtime checks only that credentials exist locally. It does not ask the provider, so an expired credential still shows as signed in until a turn fails.

Sign-ins live in the session user’s profile. A Kasm persistent profile keeps them between sessions, and without one each session starts signed out.

With no vision endpoint set, a signed-in Claude Code agent answers screen.judge, screen.ground and screen.ask with a small Claude model on the same account. That sends desktop frames to Claude’s provider. Codex and OpenCode do not answer them. Set KASM_RUNTIME_HARNESS_VISION=off to turn this off, or set KASM_RUNTIME_VISION_ENDPOINT to answer with a model you run (Vision models).

The sidebar’s Workspace tab shows the agent’s card.

Card When What the person does
“Your agent is ready to start” with Start Claude Code (or the agent’s name) The agent is selected and installed Click it. The agent opens in a terminal window in the session
“Sign in to Claude Code” with Open sign-in terminal No saved credentials Follow the steps in the terminal and browser. The terminal closes when sign-in completes
“Choose an agent for this workspace” Several agents are available and none is named Pick one in the workspace launch settings
“Agent setup needs attention” The named agent is missing or has no launcher Ask you. Details shows the agent setup state

After that the person sends tasks from Messaging. Choosing an agent lists what each agent supports.

For your own image, the runtime reads one JSON file per agent from $XDG_RUNTIME_DIR/kasm-session-runtime/harnesses/<id>.json. It never starts anything to find out what is there.

{
"schema": 1,
"id": "claude",
"name": "Claude Code",
"launcher": "/usr/local/bin/kasm-harness-claude",
"executable": "/usr/local/bin/claude",
"available": true,
"terminal_host": "herdr",
"default_model": "",
"capabilities": ["interactive", "caller_session_id", "native_resume"]
}
Field Meaning
id claude, codex or opencode. Must match the file name
name The name the sidebar shows
available true only when the executable exists. When false, set reason (for example no-executable)
launcher, executable Absolute paths. Required when available
terminal_host herdr
capabilities The agent is used only if it lists interactive

A record that fails these checks is skipped.

  1. Start a session of the workspace.
  2. In the Workspace tab, the agent’s card appears. Details shows the agent setup state.
  3. Click Start, sign in if asked, then send a short message from Messaging. The reply appears there.