---
title: "Long Refactor on Your Dev Box, Approved by Phone | AgentRQ Tutorials"
url: https://agentrq.com/tutorials/start-a-long-refactor-on-your-dev-box-and-approve-the-ai-agent-from-your-phone
description: "Run an hours-long code migration on your dev box with an AI agent, batch by batch from a Pano plan, and answer its permission prompts from your phone."
---

![](https://agentrq.com/assets/guideline-icons/hard-drive.svg) Tested November 30, 2026 | [All Tutorials](https://agentrq.com/tutorials/)

# Long Refactor on Your Dev Box, Approved by Phone

A big migration is mostly waiting. Moving 186 files from one payments client to another is hours of agent time: read a file, change the calls, build, test, commit, next file. The work itself is fine to hand over. What keeps you at the desk is the permission prompt that appears at minute 40, then again at minute 95, and the agent sitting idle in between because nobody pressed Enter.

This tutorial moves the job to a machine that can run all afternoon and moves the prompts to your phone. The agent runs on a dev box, a home server or a cloud VM, enrolled with agentrqd. The plan is a Pano doc with one checklist item per batch, and each item is a task for the agent. Build and test commands run without asking. The commands that change something outside the dev box, like git push and opening the pull request, wait for you as a card you answer from your phone. A progress card shows where each batch stands, a reply steers the agent mid-batch, and the trajectory shows everything it asked to run while you were away.

The screenshots come from the AgentRQ app on November 30, 2026: two machines enrolled with agentrqd, a Pano plan with six batches, and every approval, card and checklist tick made through the app's own API, with the agent's side played by a script that speaks the same MCP protocol as Claude Code.

![The flow: once, you enrol the dev box with agentrqd enroll --name devbox, make a shop workspace whose agent runs there, write a Pano plan with six batches each assigned to shop, and turn on push on your phone. Every batch, one at a time: the next batch is handed over when the agent is idle, the agent migrates it and keeps one progress card up to date, go build and go test run because a rule allows them, and git push waits as Authorization Required and reaches your phone. Allow Once runs the push, the task completes, its Pano item ticks itself and the next batch starts on a cleared context. Deny means the command does not run. While it runs, you can reply in the task with 10 seconds to cancel, the agent changes course mid-batch, and the trajectory shows every command it asked to run](https://agentrq.com/assets/tutorials/refactor-00-flow.svg)

## What You Build

| Piece | Setting | What it does |
| --- | --- | --- |
| devbox machine | agentrqd, enrolled with --name devbox | The computer the agent runs on, all afternoon, with your laptop closed |
| shop workspace | Working directory: the clone on devbox. YOLO mode off | The agent that does the migration, one batch at a time |
| Pano plan | A checklist of six batches, each assigned to shop | The plan, the rules for every batch, and the progress, in one doc |
| Two allow rules | go and gofmt, saved with Always Allow | Builds, tests and formatting run without a prompt |
| Push on your phone | Notifications, Enable Push, in a phone browser | Every question the agent asks reaches your pocket |
| Message send delay | 10 seconds | A reply sent from a phone can be cancelled before the agent reads it |

Four ideas make it work:

- → **The agent runs where the work is.** [Machines](https://agentrq.com/features/machines) are computers running agentrqd, the AgentRQ daemon. Enrol a dev box once, then start the agent for any [workspace](https://agentrq.com/features/workspace) on it from the web app, from anywhere.
- → **The plan is a doc, and the doc tracks itself.** In [Pano](https://agentrq.com/features/pano), a checklist item can be assigned to a workspace: it becomes a task for that workspace's agent, and the box ticks itself when the task completes.
- → **Only the risky commands ask.** Rules let the safe commands through. Every other command waits for you as an Authorization Required card, and [real-time notifications](https://agentrq.com/features/real-time-notifications) bring it to your phone.
- → **You can see and steer it from anywhere.** The agent keeps one progress card up to date, a reply in the task reaches it mid-batch, and the trajectory lists every command it asked to run.

## Before You Start

- → An AgentRQ account, and a computer that can run for hours: a home server, a cloud VM or a GPU box. Linux, macOS and Windows all work.
- → A clone of the repository on that computer for the agent alone, /home/dev/code/shop here, on its own branch. Your editor never shares it.
- → Claude Code on that computer, signed in. Codex, Gemini CLI and others work too, through the ACP Gateway: see the [connect agents guidelines](https://agentrq.com/guidelines/connect-agents/).
- → git and the GitHub CLI on that computer, signed in with push access to the branch, so the agent can push and open the pull request.
- → A phone with a browser. On an iPhone, web push needs AgentRQ on the Home Screen: Share, then Add to Home Screen.

## Step 1: Enrol the Dev Box

Open AgentRQ in any browser and go to **Machines**. The commands it gives you run in a terminal on the dev box. **1. Click Add machine.** **2. Read the warning first:** enrolling lets anyone who can sign in to your AgentRQ account run commands on that machine, as the user who starts the daemon. Start agentrqd as a user that can reach the clone and nothing you would not hand to the agent. **3. Install agentrqd** with the command for your platform. **4. Enrol it** with the second command, and add --name devbox so the machine has a name you will recognize on a small screen. The code is single-use and expires shortly. **5. devbox is online**, with its CPU and memory.

![Step 1: the Machines page with the Add a machine panel open: the warning that enrolling lets anyone who can sign in run commands on the machine, the install command curl -fsSL https://agentrq.com/install-agentrqd.sh | sh, the enrol command with its one-time code, and the devbox card below, online, linux/arm64, agentrqd 0.19.21, with CPU and memory tiles, with arrows at each](https://agentrq.com/assets/tutorials/refactor-01-enrol-the-dev-box.png)

agentrqd enroll starts the daemon in the background by itself. Do not start a second one with agentrqd serve: two daemons with one token keep connecting and disconnecting each other. To keep it running after a reboot, see [the daemon guide](https://agentrq.com/docs/daemon).

## Step 2: Make the Workspace and Start Its Agent on the Dev Box

Create a workspace named **shop**. Its mission says what the job is and what the agent must never do:

text

```text
You work in acme/shop, a Go service, on the dev box.
The current job is the pay/v1 to pay/v2 migration, one batch per task, on the branch migrate/pay-v2.
For every batch: migrate only the packages the task names, run go build ./... and go test on them,
commit with the message "pay/v2: <batch>", then push.
Post a progress card when you start and update it after each package.
Never force-push, never touch main, never run a database migration.
```

In its settings, set the **Working Directory** to the clone on the dev box, /home/dev/code/shop, and leave [YOLO mode](https://agentrq.com/features/yolo-mode) off. Then open the workspace and click **Start Claude Code**. With more than one machine online, the button opens the form. **1. The clone on the dev box** is where the agent runs. **2. Pick devbox**, not the laptop you are on. **3. Claude Code**, or the ACP Gateway for another agent. **4. A model and effort** for a long job. **5. Start it.**

![Step 2: the shop workspace's Start an agent form: Runs in /home/dev/code/shop, the Machine picker with laptop and devbox and devbox selected, Claude Code under What to run, Opus as the model and High as the effort, and the Start an agent button, with arrows at each](https://agentrq.com/assets/tutorials/refactor-02-launch-on-the-dev-box.png)

agentrqd starts Claude Code on devbox, in that folder, connected to the shop workspace. You can close the laptop now: the agent and its terminal live on the dev box, and the tasks, cards and prompts are in the web app wherever you open it.

## Step 3: Write the Plan in Pano and Assign Each Batch

Open **Pano** and write the plan as a doc: what the migration is, the rules for every batch, and the batches as a checklist. Size the batches so each one builds and tests on its own, here by package:

markdown

```markdown
Move acme/shop from pay/v1 to pay/v2: 212 call sites in 186 files, on the branch migrate/pay-v2 in the devbox clone.

## Rules for every batch

- pay/v2 takes int64 cents, v1 took float64 dollars. Convert at the call site.
- Replace matching on err.Error() strings with errors.As and pay.CardError.
- go build ./... and go test on the batch's packages pass before the commit.
- One commit and one push per batch. Touch only the packages it names.

## Batches

- [ ] Batch 1: checkout and cart (internal/checkout, internal/cart), 34 files
- [ ] Batch 2: billing and invoices (internal/billing, internal/invoice), 41 files
- [ ] Batch 3: refunds and disputes (internal/refund, internal/dispute), 27 files
- [ ] Batch 4: subscriptions (internal/subscription), 46 files
- [ ] Batch 5: webhooks and jobs (internal/webhook, cmd/worker), 38 files
- [ ] Batch 6: delete internal/pay/v1, go mod tidy, full test run, open the pull request
```

Hover a checklist item and open its menu. **4. Click ⋮, then Assign to: shop.** The item becomes a task in shop, and its text is the task's title. **3. The item shows the task's status**, Not started for now. **2. Every assigned item is listed under Related tasks.** **1. The counter** counts the ticked items.

![Step 3: the Pano doc pay/v1 to pay/v2 migration with its rules and six batches, five already assigned with an @shop Not started chip, the item menu open on batch 6 with Assign to and shop, the 0 of 6 done counter and the Related tasks list, with arrows at each](https://agentrq.com/assets/tutorials/refactor-03-assign-batches-from-pano.png)

Each task's description ends with a line that names the doc and asks the agent to read it with the pano tool. So the rules travel with every batch without being copied into six tasks, and when you change a rule in the doc, the next batch reads the new one. The clipboard icon at the top of the doc, **Make it a task**, does something else: it makes the whole doc one task.

## Step 4: Turn On Push on Your Phone

Open AgentRQ in your phone's browser, sign in, and open the shop workspace's **Settings**, then **Notifications**. **1. Tap Enable Push** and allow notifications. Push is set per workspace and per browser, so do it on the phone, for shop. **2. Email Delivery** is the other channel, and **3. its event triggers** decide what is emailed: turn on **New Message** to get the agent's questions by email too.

![Step 4: the shop workspace's Notifications settings on a 390 by 844 phone screen: Event Triggers with Task Created, Status Update and New Message, Delivery Channels with Email Delivery ticked and Setup Slack, and the Enable Push button, with arrows at Enable Push, Email Delivery and the New Message toggle](https://agentrq.com/assets/tutorials/refactor-04-push-notifications-on-phone.png)

A push goes out for every reply the agent sends, and a permission request is one: it arrives as "Reply on:" and the task's title, and tapping it opens the task. On an iPhone, the button appears only once AgentRQ is on the Home Screen and opened from there. The desktop app raises its own notifications instead.

## Step 5: Let the Safe Commands Through

The agent picks up batch 1 and starts asking. The first go build ./... arrives as an Authorization Required card. Click **Always Allow** on it, and on the first gofmt. Always Allow saves a rule on the command's first word, so from now on the agent runs any go or gofmt command in this workspace without asking.

Open **Settings**, then **Automations**, to see them. **1. Every go command:** go build, go test, go vet and go mod tidy. **2. Every gofmt command.** **3. The trash icon** deletes a rule, and the agent asks again. **4. YOLO mode stays off**, so everything else still asks. **5. [Clear context](https://agentrq.com/features/clear-context) before each task** is on for new workspaces: before each batch, AgentRQ sends /clear to the agent's terminal, so batch 4 does not carry batch 1 in its context.

![Step 5: the shop workspace's Automations tab with two rules in the Auto-Allow List, Bash go * and Bash gofmt *, the YOLO Mode toggle off, and Clear context before each task on, with arrows at both rules, a delete icon, the YOLO toggle and the clear context toggle](https://agentrq.com/assets/tutorials/refactor-05-allow-rules.png)

Do not click Always Allow on git commit. The rule it saves is for git, and git covers git push too, which is the one command you want to see. Allow the narrow git commands in Claude Code's own settings instead, in the clone's .claude/settings.json:

json

```json
{
  "permissions": {
    "allow": ["Bash(git add:*)", "Bash(git commit:*)", "Bash(git status:*)", "Bash(git diff:*)"]
  }
}
```

Claude Code runs those without asking anyone, and git push, git rm and gh pr create still reach AgentRQ and your phone.

## Step 6: Approve the Push from Your Phone

Batch 1's 34 files build and pass their tests, the agent commits, and asks to push. The task turns yellow, Needs input, and your phone buzzes. Tap the notification. **1. Waiting on you:** the timeline counts the seconds. **2. Why it asks**, in the agent's words. **3. The exact command**, git push origin migrate/pay-v2, with nothing hidden. **4. Allow Once** runs it, this one time. **5. Deny** means the command does not run. The agent is told so, and you can reply with what to do instead.

![Step 6: a 390 by 844 phone screen with the batch 1 task: the timeline at Needs input, the agent's line Push batch 1 (commit 4f1c2ab) to origin, and the Authorization Required card for Bash with the command git push origin migrate/pay-v2 and the buttons Allow Once, Always Allow and Deny, with arrows at each](https://agentrq.com/assets/tutorials/refactor-06-approve-push-from-phone.png)

Use **Allow Once** for pushes. Always Allow here would save the git rule from Step 5's warning. Answering takes one tap from wherever you are, and the agent carries on the moment you tap.

## Step 7: Follow It on the Progress Card

The agent keeps one card per batch, the way the mission asks, and updates it in place rather than posting a new message for each step. **1. The Pano plan** is linked from the task. **2. The bar** moves as files are done. **3. Each package**: done, running or queued, with what happened. **4. The test results** so far. **5. The commands it ran**, here two that a rule allowed.

![Step 7: the batch 2 task with the agent's card Batch 2: billing and invoices, pay/v1 to pay/v2 on migrate/pay-v2 on devbox, Files moved to pay/v2 at 78 percent, internal/billing done with 25 files and 94 tests passing, internal/invoice running at 7 of 16 files, commit and push queued, and Tests: 94 passed, with the Agent is working list showing go build and go test, with arrows at each](https://agentrq.com/assets/tutorials/refactor-07-live-progress-card.png)

An updated card does not notify you, so a long batch does not buzz your phone every minute. The questions do. The reply under the card carries the same numbers in plain text, which is what a push notification or an email shows. More on cards: [agent cards](https://agentrq.com/blog/agent-cards-charts-buttons-forms-and-live-updating-status-in-agentrq-task-threads).

## Step 8: Steer It Mid-Batch

Halfway through batch 2, you remember that finance re-prints old invoices, and those totals must not change. Reply in the task, from your phone or anywhere. With [message send delay](https://agentrq.com/features/message-send-delay) at 10 seconds, set in **Settings**, **General**, your reply waits before it goes. **1. The countdown.** **2. Your words**, still editable. **3. Cancel, or send now.** A message typed on a phone in a hurry is one you might want back.

![Step 8: the batch 2 task with a pending reply: Sending in 8s, the text Heads up for internal/invoice: invoices issued before 2026-01-01 keep v1's rounding (half up, on dollars). Finance re-prints old invoices and their totals must not change, and the Cancel and Send Now buttons, with arrows at the countdown, the text and the buttons](https://agentrq.com/assets/tutorials/refactor-08-steer-with-send-delay.png)

The reply reaches the agent while it works on the task. In this run it answered that it would keep v1's rounding for invoices issued before 2026-01-01, with a test for it, and that it would redo the two invoice files it had already moved. Its card gained a line for it, and batch 2 finished with 151 tests passing.

## Step 9: See What It Ran While You Were Away

Open the task's **Trajectory** tab. It lists what happened on the task in order: your input, the agent's replies, and every command it asked to run. **1. 7 s waiting on you:** the timeline shows each wait for an answer. **2. Tools** filters to the commands. **3. Your reply**, in its place among them. **4. The push.** **5. Its status:** Allowed, by you. The go build and go test rows say Auto-allowed, by a rule.

![Step 9: the batch 2 task's Trajectory tab: the timeline Not started, Ongoing, Needs input 7s, Ongoing, Completed, the filters All, Input, Agent, Thinking, Tools and Notices, the list with the agent's card, go build, go test, your Heads up reply, the agent's Got it reply, go test, git push and Batch 2 is done, and the git push row's summary with Status Allowed, with arrows at each](https://agentrq.com/assets/tutorials/refactor-09-trajectory.png)

The trajectory, the [tool call history](https://agentrq.com/features/tool-call-history), shows what went through AgentRQ: commands allowed by your rules, by you, or denied. A command Claude Code's own settings allow, like the git commit from Step 5, never asks, so it is not there. git log shows those.

## Step 10: Watch the Plan Fill In

The Pano doc is the overview. Open it on any screen. **1. 3 of 6, counted for you.** **2. Ticked by itself:** when a task completes, its item ticks, and nobody edits the doc. **3. Running now.** **4. Done before 3 and 4:** batch 5 finished before batches 3 and 4 started. **5. The same tasks, live**, under Related tasks.

![Step 10: the Pano doc at 3 of 6 done: batches 1, 2 and 5 ticked with @shop Completed chips, batch 3 with @shop Ongoing, batches 4 and 6 Not started, and the Related tasks list with three green checks, with arrows at the counter, the chips and the list](https://agentrq.com/assets/tutorials/refactor-10-plan-in-progress.png)

The agent works on one task at a time, and the oldest waiting one is offered first. But a task the agent does not take at once is passed over, and the next one is offered a minute later. Here, batch 5 went before batches 3 and 4. Make every batch stand alone, as these do, and keep the one that needs all the others last: see Traps.

## Step 11: The Last Batch Opens the Pull Request

Batch 6 deletes the old client, tidies go.mod, runs every test and opens the pull request. **1. Three asks:** git rm, git push and gh pr create, each a Needs input on the timeline, each a tap on the phone. **2. Every step, done.** **3. The pull request**, with one commit per batch. **4. Its link**, in the agent's last reply.

![Step 11: the batch 6 task: a timeline with three Needs input stops, the card Batch 6: delete pay/v1, open the pull request with five steps ticked, Batches 1 to 5, Delete internal/pay/v1, go mod tidy, Full test run with 724 passed, and Pull request acme/shop#312 opened, the line Pull request: acme/shop#312, 6 commits, 200 files changed, and the agent's reply with the pull request's link, with arrows at each](https://agentrq.com/assets/tutorials/refactor-11-pull-request-opened.png)

## Step 12: Six Ticks and a Pull Request

**1. 6 of 6 done.** **2. Every box ticked itself**, each when its task completed. **3. All six tasks completed.** What is left is the review of acme/shop#312, which is yours.

![Step 12: the Pano doc at 6 of 6 done with every batch ticked and an @shop Completed chip on each, and all six related tasks with green checks, with arrows at the counter, the ticked boxes and the list](https://agentrq.com/assets/tutorials/refactor-12-plan-done.png)

## Traps to Avoid

- → **Always Allow on git allows git push.** A rule is saved for the command's first word, so one Always Allow on git commit lets every git command run without asking. Allow the narrow ones in Claude Code's settings and keep git push asking.
- → **Workspace YOLO is not per fork.** A fork takes its settings from its parent, and turning YOLO on in the parent turns it on in every fork, which cannot change it. To skip prompts for one piece of work only, use the YOLO button on that task, not the workspace setting.
- → **Batches are not guaranteed to run in order.** The queue offers the oldest first but moves on when one is not taken. Make each batch independent, and assign the last one, which needs all the others, only after they are ticked.
- → **Unticking a completed item by hand sticks.** AgentRQ takes it as your call and does not tick it again. Use the item menu's Tick by hand when you want to set the box yourself.
- → **Push on an iPhone needs the Home Screen.** Safari has no web push for a site in a tab. Share, Add to Home Screen, then open AgentRQ from the icon and tap Enable Push there.
- → **Push is per browser and per workspace.** Enabling it on your laptop does nothing for your phone, and enabling it for shop does nothing for another workspace.
- → **A second agentrqd serve fights the first.** agentrqd enroll already starts the daemon. Two with the same token keep kicking each other off.
- → **A command your Claude Code settings allow is not in the trajectory.** Only what asks AgentRQ is recorded. Keep the commands you want a record of out of the local allow list.
- → **The agent's clone is not yours.** Point the workspace at a clone that nobody edits, so a batch never switches a branch under someone's editor.

## Make It Yours

- → **Run it in a fork, with YOLO on the task.** Fork shop, move the batch tasks into the fork, and start its agent: agentrqd makes a git worktree of its own for the fork. Turn on the YOLO button on one task only, for a purely mechanical batch, and keep the push behind a token that cannot touch main.
- → **Ask before each batch.** Add a rule to the doc: "Before you start a batch, reply with the files you will change and wait for my OK." The question reaches your phone like a permission prompt.
- → **Batches by owner.** Assign batches to different workspaces, one per team's repository, from the same doc. Each item follows its own task.
- → **Bigger boxes, more agents.** A machine runs several agents at once. Give each independent package group its own workspace on the same dev box and assign batches to all of them.
- → **Night runs.** With [task scheduling](https://agentrq.com/features/task-scheduling), start a batch after hours and read its progress card with your coffee.

## FAQ

**Do I need to keep my laptop open?** No. The agent runs on the dev box. The web app, on any computer or phone, only shows the tasks and sends your answers.

**What happens if I don't answer a prompt?** The agent waits, and the task stays at Needs input. Nothing runs until you answer. The next batch is not offered while this one is ongoing.

**What if the dev box restarts?** The agent stops with it. Start it again from the workspace once agentrqd is back. The batch it was on is still ongoing in AgentRQ, so tell the agent in the task to pick it up again.

**Can someone else approve when I'm away?** Yes, a teammate who can open the workspace can answer its prompts. See [teams](https://agentrq.com/features/teams).

**Does the agent see the whole plan?** Each batch's task names the Pano doc and asks the agent to read it, so it reads the rules and the other batches' state before it starts.

**How do I know it is still alive after hours on one batch?** Every hour that a task stays ongoing, AgentRQ asks the agent for a status update in the task, and the progress card shows the last thing it did.

**Which agents can do this?** Any that agentrqd can start: Claude Code, or Codex, Gemini CLI and others through the ACP Gateway.
