This SDK provides the Claude Code CLI for AI-assisted coding within a workshop. The agent is sandboxed in the workshop container. Credentials are persisted between workshop updates.
A minimal workshop:
# workshop.yaml
name: claude-code
base: [email protected]
sdks:
- name: claude-code
channel: latest/stable
actions:
claude-yolo: claude --dangerously-skip-permissions "$@"
claude-yolo-prompt: claude --dangerously-skip-permissions -p "$@"This creates a basic Claude Code environment. The agent is sandboxed by the workshop, so interactive and non-interactive actions can use the YOLO mode.
- No prerequisite SDKs are required.
- Place your project files in your project directory. No special layout is required; Claude Code works with any codebase.
- On launch, the SDK puts a
claudewrapper onPATHand adds a system prompt hint about the workshop environment. The SDK pins the Claude Code version, so the wrapper setsDISABLE_AUTOUPDATER=1unless you set it yourself.
Once the workshop is ready:
workshop shell
claudeThis opens an interactive Claude Code session inside the workshop. You can ask Claude to read files, write code, run commands, and navigate your project.
Claude Code accepts a Claude subscription token created with claude setup-token
(CLAUDE_CODE_OAUTH_TOKEN), an Anthropic Console API key (ANTHROPIC_API_KEY),
or a bearer token for an LLM gateway (ANTHROPIC_AUTH_TOKEN).
To make your credentials available inside the workshop, you have these alternatives:
-
Set one of these environment variables inside the workshop. You can pass it using the
--envoption withworkshop runorworkshop exec, or by other means such as direnv. -
Connect a secret to the
oauth-tokenorapi-keyplug, or both; see the plug descriptions below. If both are available, Claude Code's own authentication precedence decides which one it uses; disconnect a plug to stop using its secret. -
Otherwise, Claude Code will prompt for an Anthropic API key or offer browser-based login on first interactive use. The mount plug persists these credentials between workshop updates.
-
On the host, create a long-lived token for your Claude subscription:
claude setup-token
-
Store the token in the host keyring;
secret-toolprompts for it, so paste the token there:secret-tool store --label="claude code" --collection=default service claude-codeTo check that it's stored, run
secret-tool lookup service claude-code. -
Expose the keyring item through a
secretslot on the system SDK in your workshop definition:sdks: - name: system slots: claude-oauth: interface: secret collection: default attributes: service: claude-code - name: claude-code channel: latest/stable
-
Once the workshop is launched, connect the slot to the
oauth-tokenplug:workshop connect <workshop-name>/claude-code:oauth-token :claude-oauth
The connection persists across
workshop refresh; repeat it afterworkshop restoreor after removing and launching the workshop again. To disconnect, useworkshop disconnectwith the same plug. To use an Anthropic Console API key instead, store it with a different attribute value, add a second slot for it, and connect that slot toclaude-code:api-key.
-
Interface:
mount -
Workshop target:
/home/workshop/.claude -
Purpose: Preserves Claude's credentials and settings between workshop updates. You can also use
workshop remountto control its contents on the host. To mount your existing~/.claudesettings into the workshop, stop the workshop first, remount, then start it again:workshop stop <workshop-name> workshop remount <workshop-name>/claude-code:claude-config ~/.claude workshop start <workshop-name>
- Interface:
secret - Purpose: Provides a Claude subscription token, created with
claude setup-token, from the host's secret service. Theclaudewrapper reads it withworkshopctl get-secret claude-code.oauth-tokenand exports it asCLAUDE_CODE_OAUTH_TOKENfor the Claude Code process, unless that variable is already set in the workshop environment. Because interactive onboarding would otherwise ask for a browser login, the wrapper also setshasCompletedOnboardingin~/.claude/.claude.jsonwheneverCLAUDE_CODE_OAUTH_TOKENis set. Commands Claude Code runs inherit this variable unless you setCLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1.
- Interface:
secret - Purpose: Provides an Anthropic Console API key from the host's secret service.
When the secret is readable and
ANTHROPIC_API_KEYisn't set, theclaudewrapper configuresapiKeyHelperto runworkshopctl get-secret claude-code.api-key, so Claude Code fetches the key on demand and it never enters the environment of commands Claude Code runs. The wrapper passes this as the first--settingsoption; if you pass your own--settings, it replaces the wrapper's, and the API key secret isn't used.
This SDK doesn't define any slots.
- Anthropic community: Anthropic Discord
- Workshop forum: Discourse
- Please review our Code of Conduct before participating.
All contributions, including code, documentation updates, and issue reports, are welcome!
- See
CONTRIBUTING.mdfor guidelines. - Open issues or pull requests on the official repository.
Copyright 2026 Canonical Ltd.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 (LGPLv2.1) as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Claude Code is licensed under the Anthropic Commercial Terms.