UserToolX Help
usertoolx.com
Help › For AI agents

Text me when Claude Code is done or waiting

Start a long Claude Code task, walk away, and get a text when it's done or waiting for you: a permission prompt, a question, a finished run.

On this page

1. Put your API key in your shell profile

In ~/.bashrc or ~/.zshrc (not in a project file, so it never ends up in a repo):

export UX_KEY="YOUR_API_KEY"

Open a new terminal before starting Claude Code.

Claude Code runs hooks on events. The Notification event fires when it's waiting for you. Add this to ~/.claude/settings.json:

{
  "hooks": {
    "Notification": [
      { "matcher": "idle_prompt",
        "hooks": [ { "type": "command",
          "command": "curl -s -X POST https://useralertx.com/cgi-bin/itmessages.cgi -H \"X-Api-Key: $UX_KEY\" --data-urlencode \"body=Claude Code is waiting for you\" >/dev/null" } ] },
      { "matcher": "permission_prompt",
        "hooks": [ { "type": "command",
          "command": "curl -s -X POST https://useralertx.com/cgi-bin/itmessages.cgi -H \"X-Api-Key: $UX_KEY\" --data-urlencode \"body=Claude Code needs your permission\" >/dev/null" } ] }
    ]
  }
}
NoteDon't use the Stop hook: it fires after every reply and would text you constantly.

3. Or let Claude Code text you itself

claude mcp add --transport http useralertx https://useralertx.com/mcp --header "Authorization: Bearer $UX_KEY"

Then tell it, in a prompt or your CLAUDE.md: "When you finish a long task, text me a one-line summary via UserAlertX."

Full page: https://useralertx.com/claudecode.html

All help topics · Still stuck? Email [email protected] or use the support form.