> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getdial.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getdial.ai/_mcp/server.

# Claude Code

> Use Dial from Claude Code by dropping the Dial skill into your Claude config.

Drop the Dial skill into your Claude Code config so the agent learns how to drive the `dial` CLI on demand. Once installed, Claude Code can send messages, place calls, and wait for events without you re-explaining the surface.

## Install

Two ways to give Claude Code access to Dial: drop in the **CLI skill** (Option 1), which teaches the agent to drive the `dial` CLI, or connect Dial's **MCP server** (Option 2), which exposes Dial's tools to the agent natively. Pick either — they work the same once installed.

### Option 1 — CLI skill (Recommended)

First, get the `dial` CLI on your PATH:

```bash title="Shell install"
curl -fsSL https://getdial.ai/install | bash
```

```text title="Agent prompt"
Follow https://getdial.ai/skills.md to install and onboard the dial CLI.
```

Then drop the Claude Code-specific Dial skill into your config:

```bash
dial auth verify-otp --code <code> --agent claude-code
```

`auth verify-otp` verifies your code first, then copies the Dial skill into Claude Code's standard config directory. Re-run the command anytime (after a CLI upgrade, for example) to overwrite the skill in place — the verification step is a no-op once you're signed in.

What gets installed is a single markdown skill describing the `dial` CLI — its commands, flags, and conventions, mirroring the [CLI reference](/documentation/cli/commands). Claude Code loads the skill when a Dial-related task comes up; nothing else is touched.

### Option 2 — MCP server

Connect Dial's [MCP server](/integrations/tools/mcp) instead, and Claude Code calls Dial's tools directly. The local transport runs `npx -y @getdial/cli mcp` over stdio and reuses your saved CLI key; the remote transport is an HTTP URL with browser-based OAuth.

```bash title="Claude Code CLI"
# Local (stdio) — reuses the saved CLI key, current project only (default scope)
claude mcp add dial -- npx -y @getdial/cli mcp

# Global — same command, available across all your projects
claude mcp add --scope user dial -- npx -y @getdial/cli mcp

# Remote (Streamable HTTP, OAuth in browser) — run /mcp afterwards to sign in
claude mcp add --transport http dial https://getdial.ai/mcp
```

```json title="Config file"
# default (local) and --scope user (global) both live in ~/.claude.json
# --scope project writes a shared .mcp.json in the project root
{
  "mcpServers": {
    "dial": {
      "command": "npx",
      "args": ["-y", "@getdial/cli", "mcp"]
    }
  }
}
```

See the [MCP page](/integrations/tools/mcp) for the full tool list and the remote OAuth flow, and Claude Code's [MCP docs](https://code.claude.com/docs/en/mcp) for scopes and config-file details.

## Use it

Both install paths work the same way — just ask in plain language:

> Send an SMS to +14155550123 with the body "running late, ETA 10 min".

With the MCP server, Claude Code calls Dial's tools directly (no CLI shell-out); with the skill, it picks the right `dial` command and runs it. Either way you describe the task and the agent handles the rest. See [Using Dial from an agent](/documentation/get-started/using-dial-from-an-agent) for more examples.

## Inbound event handling (Suggestion)

You can also wake Claude Code automatically when a Dial event arrives by wiring a [CLI command target](/integrations/methods/cli-command-target): for each inbound event, the listen daemon spawns a handler that delivers a fresh prompt to Claude Code.

First install the listen daemon:

```bash
dial listen install
```

### 1. Write a handler

```bash
#!/usr/bin/env bash
# /usr/local/bin/handle-dial-event-claude
event="$1"

type=$(jq -r '.type'        <<<"$event")
from=$(jq -r '.from // ""'  <<<"$event")
body=$(jq -r '.body // ""'  <<<"$event")

prompt=$(cat <<EOF
A Dial event just arrived. Decide what to do and act on it.

  type: $type
  from: $from
  body: $body

raw event JSON:
$event
EOF
)

# Detach a fresh Claude Code session and return right away.
nohup claude -p "$prompt" </dev/null >>~/.dial/claude-code.log 2>&1 &
disown
exit 0
```

### 2. Register

```bash
chmod +x /usr/local/bin/handle-dial-event-claude
dial local-target add cmd /usr/local/bin/handle-dial-event-claude
```

The `nohup … & disown` pattern keeps Claude Code running after the handler exits, so a multi-minute agent run never collides with the daemon's per-attempt `--timeout`. See [CLI command target](/integrations/methods/cli-command-target) for the full reference, delivery semantics, and the once-retry behavior.