# ZeroClaw

This quickstart sets ZeroClaw up as a [personal agent](/guides/personal-agents/) that runs third-party API calls through Swytchcode.

ZeroClaw grants MCP servers and skills to each agent through bundles, so Swytchcode doesn't change its config for you: `swy init` prints exactly what to add.

## Step 1: Install the Swytchcode CLI

**npm**

```bash
npm install -g swytchcode
```

**macOS / Linux**

```bash
curl -fsSL https://cli.swytchcode.com/install.sh | sh
```

**Windows**

```powershell
irm https://cli.swytchcode.com/install.ps1 | iex
```

## Step 2: Create the agent's project

```bash
swy init --operator --editor=zeroclaw --project ~/agent-swy
swy login
```

This creates the project in sandbox mode, adds the [baseline approval policy](/guides/personal-agents/#the-baseline-policy), and writes the Swytchcode skill to `~/agent-swy/agent-skill/swytchcode-operator/SKILL.md` (with `always: true`, so it stays in the agent's prompt).

## Step 3: Add the skill to a bundle

```bash
mkdir -p ~/.zeroclaw/shared/skills/swytchcode
cp -R ~/agent-swy/agent-skill/swytchcode-operator ~/.zeroclaw/shared/skills/swytchcode/
```

If you set `ZEROCLAW_CONFIG_DIR`, use that folder instead of `~/.zeroclaw`; `init` prints the right paths.

## Step 4: Add the MCP server

Add the block `init` printed to `~/.zeroclaw/config.toml`. It looks like this:

```toml
[[mcp.servers]]
name = "swytchcode"
command = "swytchcode"
args = ["mcp", "serve", "--profile", "operator", "--project", "/home/you/agent-swy"]

[mcp_bundles.swytchcode]
servers = ["swytchcode"]

[skill_bundles.swytchcode]
```

This only defines the server and bundles. No agent gets them until you grant them.

## Step 5: Grant it to your agent and restrict it

Give your agent the bundles and a risk profile:

```toml
[agents.assistant]
mcp_bundles = ["swytchcode"] # add to the existing list
skill_bundles = ["swytchcode"] # add to the existing list
risk_profile = "personal"
```

Then set up the risk profile. Setting a key replaces ZeroClaw's whole default list for it, so start from the defaults (`zeroclaw config get risk_profiles. . `) and add to them:

```toml
[risk_profiles.personal]
# ZeroClaw's defaults, plus the project and ~/.swytchcode
forbidden_paths = ["/etc", "/root", "/home", "~/.ssh", "~/.aws", "~/.config", "...", "/home/you/agent-swy", "~/.swytchcode"]
# no shells or interpreters; the default list has python, python3, node, git, npm and pip
allowed_commands = ["ls", "cat", "grep", "head", "tail", "wc", "date"]
# ZeroClaw's defaults, plus the 11 Swytchcode tools (init prints them)
auto_approve = ["file_read", "memory_recall", "...",
"swytchcode__swytchcode_list", "swytchcode__swytchcode_exec", "..."]
```

- `forbidden_paths` and `allowed_commands` keep the agent away from `policies.json` and your credentials. A command that runs code (`python3 -c`, `node -e`) can read any path, so leave those out.
- Without the Swytchcode tools in `auto_approve`, ZeroClaw asks *"[Y]es / [N]o / [A]lways"* in the chat before each one. Swytchcode already holds every call that changes something for your approval. `swytchcode__*` doesn't work; list each name.
- Leave `workspace_only` on (the default).

Then restart the agent's session.

## Step 6: Set the approval channel and check

Set the workspace's approval channel in [app.swytchcode.com](https://app.swytchcode.com) (Telegram or Slack, in a private chat with the Swytchcode bot). Then:

```bash
swy doctor --agent zeroclaw --project ~/agent-swy
```

It checks the server, the grant, the skill and the risk profile settings above. It asks ZeroClaw for the values in effect, defaults included.

## Step 7: Chat with it

From ZeroClaw's chat, ask for something that needs a third-party app:

```text
Send an invoice for $200 to Acme through Stripe.
```

ZeroClaw fetches and enables the Stripe method, sends you a connect link, and the invoice waits for your approval. See [What a conversation looks like](/guides/personal-agents/#what-a-conversation-looks-like).
