The best agent runs are the long ones: the overnight refactor, the migration that takes 40 minutes, the batch job you kick off before a meeting. And the long runs all hit the same wall — at some point the agent needs a human decision. Deploy or roll back? Variant A or B? Is this diff okay to commit?
If you're at the terminal, fine. If you're not, the run stalls until you get back.
People have built real machinery around this. The Cursor forum has a long-running thread on wiring up phone notifications for exactly this moment (thread 145847), and the common stack is a ntfy.sh or Telegram hook that fires when the agent stops. Which solves half the problem: you know the agent is waiting. You still can't answer — the notification is one-way, so you walk to a laptop, or you SSH from your phone and type into a terminal sized for ants.
A question is a URL too
pail's ask tool closes the loop. The agent asks a structured question, you get a push notification, and the answer flows back into the running session:
> before deploying, ask me with pail and wait for my answer
Under the hood the agent calls:
handle = ask_user(
question="Migration finished cleanly. Deploy to production?",
kind="bool",
context_md="Ran in 4m 12s. 0 errors. Staging looks good.",
notify="push",
)
decision = await_decision(handle["decision_id"], timeout_s=28800)
Your phone buzzes. The page shows the question, the context (Markdown, images, attached artifacts — the agent can embed the migration log or a screenshot right in the page), and two buttons. You tap one, optionally add a remark, and await_decision unblocks with your answer. The agent keeps going — or rolls back, with your remark as the reason.
kind="choose" gives multiple choice, kind="text" free-form input, and kind="todo" is the non-blocking variant: the agent leaves you a reminder ("smoke-test /checkout before the 3pm call") and moves on.
Diffs get a proper review page
For code changes, a yes/no button isn't enough — you want to see the patch. The review tool takes a unified diff and produces a phone-friendly review page: syntax-highlighted, line-commentable, with approve/reject buttons. The agent blocks until you decide, then commits or amends based on the outcome. It's the same loop as ask, with a diff viewer in the middle. See the review tool docs.
Make it the agent's habit
One block in AGENTS.md:
When you need a decision from me and I may not be at the terminal, use
pail ask with notify="push" and wait for my answer. For code changes,
send a pail review and wait for approval before committing. If a task
will take more than a few minutes, leave a status page URL.
The overnight-agent-approval recipe is the full copy-paste version, including sensible TTLs (a decision that expires at 8 AM is better than one that fires the deploy at noon).
Setup
Sign in at pail.thalos.ai, copy your API key, and run:
claude mcp add --transport http pail https://pail.thalos.ai/mcp \
--header "Authorization: Bearer $PAIL_API_KEY"
ask and review are on every plan, including the free tier (30 actions/day) — see pricing. The docs cover the other eight tools, including uploading a file and getting a URL from an MCP server, which is the simplest place to start.