/reason:reasonfrom Reason
Hands off coding tasks to Reason cloud agents via MCP. Use for bug fixes, feature builds, PR reviews, CI fixes, refactoring, tests, codebase questions, or scheduled engineering work. Returns session link for live monitoring.
Ships in Reason. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Reason runs autonomous software-engineering agents in the cloud (or on the user's own connected computers). Each task is a Session: an agent with its own machine, a checkout of the repository, a shell, a browser and the user's connected tools. It plans, edits, runs tests, opens a pull request and reports back. You hand work to it with the Reason MCP tools and relay the outcome.
Use Reason whenever the request touches code or a repository, even if it sounds small. Typical asks:
Do the work through Reason instead of writing code in chat: Reason can run the code, see the real repository and deliver a pull request. Answer pure explanations that need no repository yourself.
Always give the user the session url as soon as you start a Session, and
again with the result. It is where they watch the agent work, steer it, and
review its changes.
reason__createSession); call whichever name the
client lists.sessionId, automationId,
owner, repo). JSON request bodies go under body.
Example: createSession({"body": {"prompt": "...", "repo": "acme/web"}}),
getSession({"sessionId": "..."}).status (the HTTP status) and data. On an error,
data.error and data.message say what went wrong; retry_after appears on
rate limits. Read them before retrying.getSelf confirms the connection: organization_name, user_name and
granted scopes. Starting work needs run; repositories need repos:read;
schedules need automations:write; running on a user's own computer needs
devices:use. If a scope is missing, tell the user to reconnect Reason and
grant it.Call listRepositories. Each item's full_name (owner/name) is what
createSession takes as repo; default_branch and private help you
choose.
full_name (case-insensitive; a bare
name like web is fine when only one owner has it). Confirm only if two
match.repo.To check a branch exists or read its head commit, use
getRepositoryBranchHead({"owner", "repo", "branch"}).
When the user refers to earlier work ("the billing fix", "my last session"),
find it with listSessions({"search": "billing"}) (searches titles) and
continue that Session instead of starting a new one.
createSession({"body": {...}}):
| Field | Use |
|---|---|
prompt (required) | The complete, self-contained task. See the template below. |
repo | owner/name from listRepositories. Omit for scratch work. |
pr_number | Work on an existing PR: check out its head branch and push commits to it (fix CI on a PR, address review comments). |
branch | Work on (or create) a named branch. |
ref + base_branch | Start a fresh branch from a commit, tag or branch and open a new PR against base_branch. |
target | Where it runs. Omit for Reason cloud. See "Where it runs". |
model, reasoning_effort | Only if the user asks. listAgentModels lists ids. |
idempotency_key | A fresh unique string per task, so a retried call never starts the work twice. |
tags | Optional labels such as ["grok", "bugfix"]. |
pr_number, branch and ref are mutually exclusive.
The response returns session_id, url and status immediately. The work
runs asynchronously. Send the user the url right away, with one line on
what Reason is doing.
getSession({"sessionId", "fields": "status,outcome,result,pr_url,url,title,error_message"})
is the cheap status read. Poll it about every 30-60 seconds, not in a tight loop.listSessionEvents({"sessionId", "after_seq", "wait_ms": 20000, "view": "conversation"})
long-polls live progress (assistant messages, tool calls). Pass the previous
next_seq as after_seq.listSessionConversation({"sessionId"}) returns the whole exchange in order:
the prompt, each follow-up, and one reply per finished turn.listSessionMessages({"sessionId"}) lists only the follow-ups sent after
creation and how each was delivered.Sessions usually take minutes, and large tasks can take much longer. If your
client can't wait, stop after sharing the link and tell the user to ask you to
"check my Reason session" later. Pick it up with getSession.
status | Meaning |
|---|---|
running | Still working. |
exit | The run finished. Check outcome. |
error | Execution failed. Read error_message / diagnostic_message. |
suspended | Cancelled or out of quota (suspended_reason). |
The task succeeded only if outcome is success. action_required means a
person must act: a question, missing access, or an approval. Relay exactly what
it needs. failure means it could not do the task; say why.
Report back with:
url;pr_url (and change_requests if there are several), if any;result (the agent's answer): what changed, how it was
verified, and anything left open.Never claim work is done, merged or deployed unless the Session says so.
sendSessionMessage({"sessionId", "body": {"message": "..."}}) continues the same
Session with its full context. Use it for "also handle X", review feedback, or
answering an action_required question.
delivery: "steer" hands the message to the
running agent; delivery: "queue" waits for the turn to end
(steerQueuedSessionMessage sends a queued one now;
withdrawQueuedSessionMessage drops it).delivery says what happened. Acceptance isn't completion:
poll getSession again (use continuation_session_id if one is returned).client_message_id (unique per message) so a retried call is not sent
twice.cancelSession({"sessionId", "body": {"mode": "graceful"}}) stops unwanted
work. hard stops at once.retrySession({"sessionId"}) reruns the last turn of a finished, failed or
stopped Session (409 not_terminal while it runs).forkSession({"sessionId", "body": {"message": "...", "title": "..."}}) tries
another approach in a new Session while the original stays intact.rewindSession({"sessionId", "body": {"message_id", "content"}}) edits an
earlier follow-up and reruns from there.archiveSession hides a Session but keeps its history.
deleteSession destroys data, so use it only on an explicit request.The agent can't see this chat. Put everything it needs in prompt:
<Goal in one sentence.>
Context:
- Repository: owner/name (branch / PR #N if relevant)
- What the user reported or wants, in their words; exact error text, stack
traces, URLs, screenshots described, steps to reproduce
- Constraints: files or areas to touch or avoid, style, deadlines
Done when:
- <observable acceptance criteria, e.g. "the failing test passes", "the page
renders the new button", "CI is green">
Deliver: <a pull request with the proof in its body / an answer only, no code
changes / push to PR #N>. Report what you verified and anything you could not.
Keep the user's wording for requirements. Don't add scope they didn't ask for.
Attach files (screenshots, logs) with attachments
([{"name": "error.png", "data_url": "data:image/png;base64,..."}]), at most 10.
Fix a bug. Prompt: the symptom, exact error, reproduction steps, expected behaviour. Ask it to reproduce the bug first, fix the root cause, add a regression test, and open a PR showing the failing-then-passing check.
Build a feature. Prompt: the user story, acceptance criteria, any design references, and where it should live. Ask for tests and, for UI, screenshots in the PR.
Review a pull request. createSession with repo and a prompt naming the
PR URL: "Review PR #N: correctness, security, tests, breaking changes. Post
findings as a review; don't push commits." Return the findings and the session
link. (triggerPrReview requests GitHub's automated review bot; the server
currently answers 409 pr_review_disabled. If it does, use a Session as above.
listPrReviews shows past automated reviews.)
Address review comments / push to an existing PR. createSession with
repo and pr_number, and a prompt listing the comments to address.
Fix CI. With a PR: pr_number, plus the failing job names and log
excerpts if the user gave them. On the default branch: no pr_number. Ask it
to read the failing checks, reproduce locally, fix, and push until checks are
green. Tell it not to disable or skip tests.
Refactor / migrate. State the target shape and invariants ("no behaviour change, all tests pass"). For large changes, ask for incremental commits and a draft PR early.
Write tests. Name the module or behaviour, the framework if known, and the coverage goal. Ask it to show the new tests running.
Answer a codebase question. createSession with repo and a prompt like
"Answer only, no code changes: how does X work? Cite files and lines." Relay
result with the link.
Spin up a new app. If the user has an (empty) repository, pass it as
repo. Otherwise omit repo and describe the app, stack and where it should
be delivered. The agent reports if it lacks access to create a repository.
Ask it to run the app and include a screenshot.
Ship and follow through a deploy. Only when the user explicitly asks to merge or deploy, say so in the prompt (or a follow-up): "merge when checks are green, then confirm production runs the merge commit and retest the change". Report merged, deployed, and verified-working separately.
Parallel work. Independent tasks get separate Sessions, each with its own link. Don't put unrelated tasks in one prompt.
Talk to the user's own Reason. If the user says "ask my Reason ...":
listReasons, then openReasonConversation({"reasonId"}) for its
session_id, then sendSessionMessage and read the reply with
listSessionConversation.
For "every day / every Monday / at 9am tomorrow":
listAutomations first, to avoid duplicates.createAutomation({"body": {"name", "instructions", "repo"}}). instructions
is the self-contained prompt each run gets.createAutomationTrigger({"automationId", "body": {...}}) with exactly one of
frequency (cron, e.g. "0 9 * * 1-5"), every_seconds, or
scheduled_at (one-time ISO time).next_run_at from the
response. Each run is billed, so confirm the cadence with the user if it is
ambiguous.Pause or change one with updateAutomation; remove a schedule with
deleteAutomationTrigger.
By default Sessions run on Reason cloud, which is right for nearly everything. Only choose a target when the user asks:
listDevices lists their devices; use one with
online: true. Mac: "target": {"kind": "mac", "device_id": "...", "cwd": "/Users/me/project"}.
CLI-connected computer: {"kind": "headless", "device_id": "..."}. Needs
devices:use. An offline device never falls back to cloud; say so.listMachines, then
{"kind": "machine", "name": "..."}.sendSessionMessage with body.target once
the current turn has finished. Only the conversation moves; unpushed files
stay behind.If a Session hasn't started, getQueueStatus shows running and queued work in
the workspace.
| Signal | What to do |
|---|---|
| 401 / auth required | Let the client re-run OAuth. |
| 403 / missing scope | Name the scope; ask the user to reconnect and grant it. |
| 404 on a repo | It isn't connected; see step 1. |
409 idempotency_key_conflict | Same key, different prompt: use a new key. |
409 not_terminal | The Session is still running; wait or send a follow-up. |
409 pr_review_disabled | Use a review Session instead. |
| 429 | Wait retry_after, then retry once. |
| Timeout on a write | Check (listSessions, getSession) whether it happened before retrying. |
createAttachment). Larger
files need the Reason app or REST API.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cloud-agents, autonomous-coding, mcp, task-delegation, pr-review
npx claudepluginhub reason-machines/reason-plugins --plugin reasonOther plugins' skills for the same job