> ## Documentation Index
> Fetch the complete documentation index at: https://continuum-three-olive.vercel.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Agent SDK and direct-PTY backends, the two-state Plan/Code permission model, multi-account subscriptions, rate-limit gauges and local usage analytics.

Claude runs on one of two backends, and which one you're on changes how sessions are spawned.

## Backends

Pick one under **Settings → Advanced → Claude runtime → Backend**. It applies to new sessions; existing ones keep the backend they started with.

| Backend           | What runs                                                                          | Notes                                                                                                          |
| ----------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| **SDK** (default) | The Claude Agent SDK's ACP adapter, on the same harness as Codex, Cursor, and Grok | Launched from an installed `claude-agent-acp`, or through `npx -y @agentclientprotocol/claude-agent-acp`       |
| **CLI**           | The `claude` binary in a real per-session PTY                                      | No proxy, no middleware — the session is a terminal connected to `claude`. The only direct-PTY path in the app |

A new session falls back to CLI automatically if the SDK adapter can't be found and `claude` can. The rest of this page describes the CLI backend's spawn behavior unless noted; the SDK adapter takes no model or effort launch arguments and does not support in-session model changes.

## Requirements

Either backend needs Claude Code installed and signed in. If it isn't installed, **Settings → Providers → Claude** offers an installer that runs `npm install -g @anthropic-ai/claude-code` in an embedded terminal.

Continuum reads Claude Code's own OAuth credential from the macOS Keychain item `Claude Code-credentials` and imports the access token into its own Keychain entry, which the rate-limit gauge then polls. You never paste a key into Continuum for your default account on Mac.

<Note>
  Claude Code's access tokens expire within hours, so the imported copy goes stale on its own. When a poll fails to authenticate, Continuum passively re-reads Claude Code's Keychain entry and re-imports the CLI's current token. "Passively" is load-bearing: the read is non-interactive, so a background poll can never pop a Keychain consent dialog. Continuum never performs a refresh grant — the rotating refresh token belongs to the CLI, and rotating it here would revoke the CLI's copy and break your `claude` login.
</Note>

## Plan and Code

The composer's permission pill is a **two-state Plan ↔ Code control**, and it means the same thing on every provider: Plan is read-only, Code is maximum permissions.

| Pole     | CLI-backend flag                 | Behavior                                                                       |
| -------- | -------------------------------- | ------------------------------------------------------------------------------ |
| **Plan** | `--permission-mode plan`         | Claude runs read-only and proposes a plan. Approve from Mac, iPhone, or Watch. |
| **Code** | `--dangerously-skip-permissions` | Approvals are skipped so the agent can work uninterrupted.                     |

On the SDK backend the same two poles are enforced through the harness rather than a flag, and file-system capability is advertised to the adapter only for Code sessions.

<Warning>
  Code always skips approvals. There is no per-repo trust gate on it any more — the trust list that used to gate the bypass flag was removed, because a model or effort change on a Code session would silently re-arm approvals and the pill would disagree with the runtime. Sends, swaps, and plan approvals are still audit-logged to `~/.clawdmeter/audit/` and rate-limited (1 send/second, 1 config swap/5 seconds per session). Plan never bypasses.
</Warning>

Switching pole mid-session re-spawns the runtime with the new posture in the session's current working directory. Sessions created before the two-state pill (which stored `ask` or `acceptEdits`) resolve to Code, so an old session never reverts to prompting under a pill that reads "Code".

<Note>
  The worktree mode (Local vs Worktree) is chosen when the session is created — a one-click **Worktree / Local** chip on the floating New Session box — not in the composer of a running session, which shows a read-only badge of the mode it started in. (⌥-clicking **+** skips the box entirely and quick-spawns on the repo's resolved defaults.) Per-repo worktree defaults live in **Settings → Workspaces**. See [Sessions](/docs/features/sessions).
</Note>

## Models

The bundled catalog ships Fable 5, Opus 5, Opus 4.8 (and its 1M-context variant), Opus 4.7 (and its 1M variant), Opus 4.6 (1M), Sonnet 5, Sonnet 4.6, and Haiku 4.5. Fable 5 is listed first and is the default a fresh session resolves to. The `opus` and `sonnet` CLI aliases point at Opus 5 and Sonnet 5 respectively; the older rows stay selectable but alias-free so those aliases stay unambiguous.

<Note>
  Continuum stores the 1M-context variants as `…-1m` but the CLI's `--model` flag only accepts the bracket form (`claude-opus-4-8[1m]`). Continuum rewrites the id at the spawn boundary. This matters because the CLI rejects the `-1m` spelling *silently* — the turn simply never starts.
</Note>

## Effort and Ultracode

The effort dial offers `low`, `medium`, `high`, `xhigh`, and `max`, passed to the CLI backend as `claude --effort <value>`. The dial's `minimal` rung is Codex-only; if a session carries it over from a provider swap it folds up to `low`, because the Claude CLI doesn't expose it.

Above Max sits **Ultracode** — xhigh effort plus standing dynamic-workflow orchestration. It is not an `--effort` value (the CLI rejects `--effort ultracode`); Continuum enables it by spawning `claude --settings '{"ultracode":true}'` and **omitting** `--effort`, because an explicit `--effort` wins over the settings key and would silently defeat it. `--settings` merges, so your other settings survive. Ultracode is Claude-only, and it folds to `xhigh` for any other provider you switch a session to.

Haiku 4.5 reports no effort support, so the dial is hidden when it's selected.

## Session resume

On the CLI backend, Continuum reads the Claude session id from the JSONL header and resumes with `claude --resume <id>`. A managed session stays pinned to its conversation: when you change model, effort, or pole mid-session, Continuum re-spawns `claude --resume <id>` so the chat history stays continuous.

Both backends write the same `~/.claude/projects/**/*.jsonl` transcripts, and SDK sessions prefer that JSONL over the adapter's own message stream when rendering assistant prose — the adapter re-emits the same text under a fresh id, which would otherwise render every reply twice about a second apart.

## Multi-account subscriptions

You can run more than one Claude subscription side by side. Go to **Settings → Providers**, pick Claude, and choose **Add account…**.

* A secondary signs in with `claude setup-token` in an embedded terminal. Continuum captures the printed `sk-ant-oat01-…` token from the terminal output and stores it in a **per-account Keychain partition**, so account A's token is invisible to account B. A paste-token field covers CLI output drift. `claude /login` is never used for secondaries, because Claude Code's Keychain item is per-OS-user and a second `/login` would clobber your default account.
* Each account gets its own config directory under `<Application Support>/Clawdmeter/Instances/claude/<name>/`, applied at spawn time as `CLAUDE_CONFIG_DIR`. This is **config-directory isolation, not a HOME swap** — `HOME` is left untouched so git, ssh, gh, and node keep working in worktrees.
* The spawn environment scrubs inherited `CLAUDE_*` / `ANTHROPIC_*` variables, then injects the per-account token *after* the scrub so `CLAUDE_CODE_OAUTH_TOKEN` survives. Resolution is **fail-closed**: a session pinned to an account with no stored token refuses to spawn with a re-authenticate error rather than silently billing your default subscription.
* Your default account's spawn environment is byte-identical to single-account behavior, and is registry-seeded in memory rather than written to disk — a corrupt account store can't take it away.

## Rate-limit gauge

The [Usage tab](/docs/surfaces/usage) shows live rolling quota gauges for Claude. Continuum polls Claude's own `/api/oauth/usage` endpoint — the non-generative one the CLI uses for its own rate-limit fetch — and reads utilization (0–100), the rate-limit type, and the reset time for both the 5-hour session window and the weekly window. No additional token or credential is needed on Mac.

Claude is the one provider with a **third** rail: Anthropic meters Fable separately from the all-models weekly cap, so Continuum renders a dedicated **Fable** meter beneath the weekly one — in the Usage card, in the menu-bar popover, and on iPhone. The row stays in place for Claude even before the upstream payload carries a Fable figure, showing an em-dash rather than vanishing and reappearing.

<Warning>
  The `/api/oauth/usage` endpoint is aggressively rate-limited per IP and can 429 even a healthy account. The gauge holds the last good reading between successful polls. Only while throttled does Continuum fall back to reading rate-limit headers off a minimal `max_tokens: 1` Haiku probe — roughly ten tokens, and never on an account the endpoint is answering normally.
</Warning>

A soft-red **weekly cap** projection appears (in the chat composer footer on Mac and the cost banner on iPhone) when current usage plus the active session would push weekly utilization past 95%. Other providers don't show this badge because Anthropic's weekly cap doesn't map to them.

## Usage analytics

Token events are parsed from `~/.claude/projects/**/*.jsonl`. Each record is deduplicated by message id plus request id, matching [ccusage](https://github.com/ryoppippi/ccusage). Newer Claude Code JSONL drops the request id, so Continuum folds an absent one to an empty qualifier — the same dedup outcome ccusage produces. Events are priced with the embedded pricing snapshot and rolled up by day and repo in the Usage tab.

When you add secondary accounts, their `projects` directories join the aggregate totals on the next refresh. Totals are aggregated across all accounts; there is no per-account breakdown yet.

`ccusage daily` is the parity benchmark. If Continuum's numbers diverge from ccusage, ccusage is treated as the ground truth.

## Slash-command skills

Typing `/` in the composer opens a palette. For Claude sessions, Continuum walks two locations for skill definitions:

* `~/.claude/skills/<name>/SKILL.md` — global skills
* `<repo>/.claude/skills/<name>/SKILL.md` — project-local skills

The walk runs on a background thread with a 30-second cache and directory-mtime invalidation, so the palette opens without blocking the UI.

## Auto-revive

Claude Code's 5-hour OAuth session window can expire mid-work. Continuum surfaces an **Auto-revive 5h timer** toggle under **Settings → Devices → Quota & sync**, and a per-provider card on the Usage tab.

<Note>
  The auto-revive mechanism ships **disabled**. Keeping the window warm meant posting a tiny throwaway model request, which created visible junk conversations and consumed quota. It stays off until a non-generative endpoint can do the job. The toggle is present for when that lands; today it is a no-op.
</Note>

## iPhone auth

On iPhone, the OAuth token mirrors from the Mac via iCloud Keychain — the phone reads the shared, iCloud-synced Keychain entry the Mac publishes. If iCloud Keychain sync is unavailable (for example a personal Apple Developer account without the paid entitlement), open iPhone **Settings** and paste a token manually as a fallback. The Watch first tries a token pushed from the iPhone over WCSession, then falls back to the same shared-Keychain entry.

## Broadcast

Claude can participate in the Chat surface's multi-provider [broadcast](/docs/features/broadcast) mode — one prompt to several providers, answers side by side.

<Note>
  The Chat tab is hidden by default across every client while the product is focused on Code, so broadcast is not reachable from the default UI. See [Chat](/docs/surfaces/chat).
</Note>
