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

# Claude Code (CLI) provider

> Bridge provider claude — Anthropic Claude Code CLI on the Bridge host

Provider id: **`claude`** · CtrlNode agent type: **`ClaudeCode`**

Runs tasks through the **Claude Code** CLI (`claude` command) with stream-json output. The Bridge writes `CLAUDE.md` into each task folder with role, instructions, and completion tags.

## When to use it

* You use an Anthropic **Claude Code subscription** on the Bridge machine
* You prefer the official CLI over the programmatic Agent SDK
* You want `--resume` session continuity on follow-up dispatches for the same task

<Note>
  For API-key-based programmatic agents, use [Claude Agent SDK](/bridge/providers/claude-sdk) (`claude-sdk`) instead.
</Note>

## Prerequisites

Install Claude Code globally:

```bash theme={null}
npm install -g @anthropic-ai/claude-code
claude --version
```

Authenticate once:

```bash theme={null}
claude login
```

## Environment variables

| Variable                  | Default           | Description                                 |
| ------------------------- | ----------------- | ------------------------------------------- |
| `CLAUDE_TOOLS`            | `Read,Write,Edit` | Allowed tools                               |
| `CLAUDE_MAX_TURNS`        | `20`              | Max agentic turns                           |
| `CLAUDE_TIMEOUT_MINUTES`  | `10`              | Task timeout                                |
| `CLAUDE_SKIP_PERMISSIONS` | `true`            | Avoid permission prompts in unattended runs |
| `BASE_PATH`               | Home              | Workspace root                              |

No `ANTHROPIC_API_KEY` is required when using CLI login.

## CtrlNode setup

1. Create a project with agent type **Claude (CLI)** / `ClaudeCode`
2. Register agents in **Team**
3. Ensure `claude` is on `PATH` for the user running `ctrlnode`

## Example `.env`

```env theme={null}
PAIRING_TOKEN=...
PROVIDERS=claude
BASE_PATH=/home/you
```

## How dispatch works

1. Bridge creates the task folder under `{BASE_PATH}/.ctrlnode/tasks/...`
2. Writes `CLAUDE.md` with instructions and required output paths
3. Spawns `claude` with the task prompt; streams events to CtrlNode
4. Parses terminal tags (`TASK_COMPLETED`, `TASK_FAILED`, `TASK_BLOCKED`) from the reply

## Troubleshooting

| Issue                   | Fix                                                   |
| ----------------------- | ----------------------------------------------------- |
| Permission prompts hang | Set `CLAUDE_SKIP_PERMISSIONS=true` (default)          |
| `claude` not found      | Install CLI; fix PATH for service account             |
| Task failed immediately | Run `claude login` on the Bridge host                 |
| Wrong provider ran task | Agent type must be `ClaudeCode`, not `ClaudeAgentSdk` |

[← All providers](/bridge/providers)
