# Routines

| Command | Purpose |
|---|---|
| `vatio routines list [--json]` | The workspace's routines, their numbers and whether they are on |
| `vatio routines create NAME --url URL --phone NUMBER [--phone NUMBER]... [--env NAME]` | Connect a routine; asks for its API token |
| `vatio routines update ID [--name NAME] [--url URL] [--phone NUMBER]... [--new-token]` | Change it; `--phone` replaces the list |
| `vatio routines test ID` | Start it with a `ping`, and show how the trigger answered |
| `vatio routines runs ID [--json]` | The last 50 runs, with each Claude session's link |
| `vatio routines enable ID` | Turn back on a routine Vatio switched off after 10 failed runs |
| `vatio routines rm ID` | Remove it |

A routine does nothing until the agent has it as a tool: `tools/NAME.yml`
with `routine: NAME`, and `NAME` in `agent.tools`. See
[Claude Code routines](https://vatio.ai/docs/integrations/claude-routines) for the tool file, what
the routine receives and how it reads the conversation.

## Create

```sh
vatio routines create encargos \
  --url https://api.anthropic.com/v1/claude_code/routines/trig_…/fire \
  --phone +56912345678
```

- **`NAME`**: lowercase letters, digits, `-` and `_`. The tool file names it
  with `routine:`, and the routine receives it as `routine`.
- **`--url`**: the URL claude.ai shows for the routine's API trigger. Vatio
  only calls `api.anthropic.com`.
- **The token** is asked for rather than passed as a flag, so it stays out of
  your shell history; pipe it in to script it:
  `op read "op://Vault/Routine/token" | vatio routines create …`. Vatio
  refuses anything that is not a `sk-ant-oat01-…` token, keeps it encrypted
  and never shows it again.
- **`--phone`**: a number in international format, once per number, up to 20.
  Only WhatsApp conversations with these numbers get the tool.
- **`--env`**: `live` by default; a preview routine serves your test phones on
  Vatio's test number.
