# Your agent can text you

SelfPing texts your own phone when your AI agent finishes a task or needs a decision. Set it up once, in about a minute.

## 1. Get your key

Sign up with your phone number at https://www.selfping.com/login and copy your API key from https://www.selfping.com/dashboard. A key can only ever text the number that created it.

## 2. Connect your agent

Replace sp_your_api_key with your key.

Claude Code:

```bash
claude mcp add --transport http selfping https://www.selfping.com/api/mcp \
  --header "Authorization: Bearer sp_your_api_key"
```

Restart Claude Code, then run /mcp to check SelfPing is listed.

Other MCP agents (any agent that supports remote MCP servers):

```json
{
  "mcpServers": {
    "selfping": {
      "type": "http",
      "url": "https://www.selfping.com/api/mcp",
      "headers": {
        "Authorization": "Bearer sp_your_api_key"
      }
    }
  }
}
```

No MCP (any agent that can run a command):

```bash
curl -X POST https://www.selfping.com/api/sms \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sp_your_api_key" \
  -d '{"message": "Task finished"}'
```

## 3. Tell it when to text you

Add this to any task you walk away from:

I'm stepping away. Text me with SelfPing when you finish or need a decision. Keep it short: what happened, and whether you need me.

To check it works right now, ask: "Send me a test text with SelfPing."

The user can answer a text by replying to it. Agents read replies with the MCP tool get_replies, or GET https://www.selfping.com/api/replies with the same key; reading never costs a credit.

## More options

Make it the default: add this to CLAUDE.md or your agent's rules file.

## Notifications

When I say I am stepping away or ask for a notification, use SelfPing
(`send_ping`) when the task finishes or needs a decision from me.

Keep it under 160 characters. Lead with the outcome and say what needs me.
For a decision, tell me to return to this agent session to answer.
Send once per outcome. Do not send routine progress updates, repeat an
unanswered alert, or text while I am actively following the session.

Text automatically with hooks. Export SELFPING_API_KEY before starting your agent.

Claude Code, merged into .claude/settings.json (texts you when it needs permission or is waiting on you; restart, then check /hooks):

```json
{
  "hooks": {
    "Notification": [
      {
        "matcher": "permission_prompt|idle_prompt",
        "hooks": [
          {
            "type": "http",
            "url": "https://www.selfping.com/api/hooks/claude-code",
            "headers": {
              "Authorization": "Bearer ${SELFPING_API_KEY}"
            },
            "allowedEnvVars": ["SELFPING_API_KEY"]
          }
        ]
      }
    ]
  }
}
```

Cursor or Codex, run from the hook (swap cursor for codex; add ?label=my-project to tell projects apart):

```bash
curl -sS -X POST https://www.selfping.com/api/hooks/cursor \
  -H "Authorization: Bearer $SELFPING_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @-
```

## Limits

One credit per text. 10 free a month, refilled on the 1st. Paid plans from $5 a month.
