Agent runners
Create a task and an agent starts on it, on one of your own machines. No open ports, no third-party service.
A runner is the fxc CLI running on a machine of yours. When a task appears with the dispatch tag, FXCode offers it to your machines, one of them takes it and starts an agent (Claude Code, Codex, OpenCode…) in the task’s own git worktree. The agent reports its progress, opens a draft pull request and finishes the task.
Everything stays on your machines. The runner only opens an outgoing connection to FXCode: no ports are exposed and you don’t need a tunnel.
Connect a machine
Inside the repo of the project:
fxc agent register --project <projectId>
fxc agent serve
--project <id>=<path> adds other repos (repeatable). Paths stay on the machine: FXCode only learns which projects it serves.
One folder with all your repos
Instead of registering projects one by one, give it the folder where you clone your repos:
fxc agent register --root ~/projects --max-sessions 3
fxc agent serve
The runner looks for the git repos inside (up to two levels: ~/projects/repo and ~/projects/client/repo) and matches them with your projects by the project’s GitHub repo (Advanced → Branches and PR) against the origin remote or, when the project has no GitHub repo, by folder name equal to its title. It looks again every 5 minutes: a repo you clone there joins by itself. It only serves projects where you are on the team, and a --project <id>=<path> wins over what it discovers. fxc agent status shows what it found; --no-root goes back to the fixed ones only. --root is repeatable.
To keep it running after a restart:
fxc agent install # --dry-run shows what it would do
fxc agent uninstall
It runs with your user account, because it needs your agent login, your git keys and your repos: a systemd user service on Linux, a launchd agent on macOS and the log-on Run key on Windows. It doesn’t need admin rights, and only one runner can run per machine.
Send it work
Give a task the agente tag, from the web, the CLI or a chat with your assistant over MCP:
fxc tasks create -t "Add dark mode" --project-id <projectId> --tag agente
A task is offered when:
- it has the runner’s dispatch tag (
--tagchanges it) and belongs to one of its projects; - you created it (
--any-authoralso accepts tasks from the rest of the team); - it isn’t in progress, finished, in review or pending deploy;
- it isn’t blocked by another task or waiting for a person;
- no agent already went through it (
fxc agent retry <taskId>offers it again).
If the machine was off, it catches up when it comes back. In new-session mode, each task gets its own session, worktree and branch. To use an existing session, connect it as described below.
What the agent does
The agent gets the task and these rules: start it with fxc tasks start, follow the repo’s instructions, commit on its branch, push, open a draft pull request and call fxc tasks finish. If it needs someone (a decision, credentials, a production migration) it calls fxc tasks need-human and stops.
If the agent fails, or ends without finishing the task, the task is flagged as waiting for a person with the reason, so it isn’t launched again in a loop. Its output stays in ~/.fxcode/agent/runs/<runId>/output.log, on your machine.
Run options: no build, no tests…
By default the agent follows the repo instructions (CLAUDE.md, AGENTS.md), which usually ask it to build and run the tests. To have it just move the code forward without spending time or resources on those steps (especially with several sessions in parallel), set run options at three levels; the most specific wins: task > project > machine.
- Machine: Settings → Agent machines → Options, or
fxc agent options --no-build --no-testson the machine. - Project: Advanced → Branches and PR → Agent run options, or
fxc agent options --project <id> --no-tests. - Task: in the task form (it shows once the task has the
agentetag),fxc agent options --task <id> --no-build, or from MCP withrunOptions: { build: false, tests: false }increate_task/update_task.
Options: build, tests, lint, open a PR (yes, no or unset) and extra instructions. A step unset at every level follows the repo. The agent gets them in its brief and they are recorded on the run (fxc agent runs <task>, and on the task in the web app). --clear removes a level’s options.
Several machines
Register each machine with its own labels:
fxc agent register --project <id> --label raspberry
fxc agent register --project <id> --label gpu --max-sessions 3
- A task tag that some machine of yours declares only goes to machines declaring it:
agente+gpugoes to thegpumachine. Tags nobody declares, likefrontend, don’t route anything. - An agent’s name as a tag (
claude,codex,opencode) sends the task to a machine that has it installed, and that agent runs it. --max-sessionslimits how many agents run at the same time on a machine, so you don’t burn through your subscription limits. The rest wait in the queue.--max-per-project(default 1) limits how many of them work at once in the same project, so two agents never touch the same code: with--max-sessions 3, a task of one project and one of another run together, and a second one of the first waits.--min-free-mem <MB>and--max-load <load per core>(e.g.2048and0.8): with less free memory or more load, the machine starts no new agent until resources free up (0removes the limit). Running ones go on.- All of this can also be changed in Settings → Agent machines → Options or with
update_agent_runnerover MCP.fxc agent overviewand the status card show the queued tasks and why they wait: an agent is already on that project, machine full, low memory, CPU busy, machine offline or no machine serves the project. - Only one machine gets each task. Runners send a heartbeat every 30 seconds; after 3 minutes without one the task goes back to the queue. After 3 of those, it waits for a person.
Pick the machine that runs it
When you create a task with agente, FXCode checks which machines are active (connected and with the project’s folder):
- Several active: the form asks you to pick one, or “Any active machine”. Over MCP,
create_taskandqueue_tasktakerunnerId(id, name or hostname, orany); without it they don’t create or launch anything and returnactiveRunnersso your assistant asks you. - Only one: that one takes it.
- None: you’re told, and the task stays in the queue, unassigned, until one connects.
For new sessions, only active machines are offered; connected sessions are listed separately. The chosen one is stored as the machine:<id> tag, so only that machine takes it. The task and task_agent_runs (assignedMachine) show where it goes; GET /agent-runners/available?projectId= lists the active ones.
fxc agent list and Settings → Agent machines show your machines and what each one is doing; the task form shows which machine has the task, and lets you cancel it.
Live state: who is working and who is waiting for you
On every heartbeat (30 s) the machine reports what the agent of each run is doing: working, waiting (a question or a permission, with the line asking for it) or idle. With Herdr it is read from the pane; with claude -p the agent never asks and counts as working. Connected sessions use the state from their hook. If the machine stops sending heartbeats, its runs show as machine offline.
fxc agent overview [--project <id>] [--days N]: the overview in the terminal.- MCP
agents_overview: the same for your assistant, withsummary, one line ready to tell you, and the counts of the last days by project and by machine. - Web: Settings → Agent machines → “Agent status”.
- Notifications: when an agent is left waiting, or fails, you get a notification on the mobile app.
Machines on an older fxc don’t report the state: their runs show as working until you update (fxc update).
Machines map: where they are and where they were
Settings → Agent machines → Machines map shows each machine on a map (green = online, red = offline), the places it was in (grey, joined by a line) and the tasks it runs now; fxc agent map [--days N] and the MCP tool runners_map give the same. Useful to know which machine is still available when one goes down (a power cut, a laptop on a trip).
- The place is approximated from the public IP of the heartbeat: the API looks it up only when the IP changes and stores the city and coordinates rounded to ~1 km, never the IP itself (only its HMAC). Self-hosting:
GEOIP_URLpicks the lookup service ({ip}= the address, defaulthttps://ipapi.co/{ip}/json/),GEOIP_URL=offturns it off. - To set it yourself:
fxc agent register --location "Home" [--coords -12.05,-77.04](saved inagent.json; it wins over the IP).--no-locationgoes back to the IP. - Each machine keeps its last 100 places.
Ask a machine from a distance
Your assistant can find out the real state of a machine over MCP, even if you’re away from it. There are three levels, fastest first:
| Level | What it answers | How |
|---|---|---|
| Report | OS, fxc version, agents installed, repos and their branch |
machine_info · fxc agent info <machine>. Sent with the heartbeat, instant |
| Probe | Read-only checks, in seconds and without an agent | machine_probe · fxc agent probe <machine> <kind> [target] |
| Agent | Anything else: “I installed a new project and don’t know where it is” | machine_ask · fxc agent ask <machine> "<question>". An agent investigates and replies in a comment |
The probes are a closed list, with no free terminal:
cli_version <name>: is that command installed and which version, including CLIs FXCode doesn’t know. The name only allows letters, numbers and hyphens. System administration commands report where they are but aren’t run.git_status <project>: branch, ahead/behind, how many files changed and the last commit. Not their names.disk_usage: total and free space.service_status <name>: whether that service is running.
Only the owner of a machine can ask it anything. Each probe is logged, with what was asked and when (machine_probes · fxc agent probes <machine>), and kept for 30 days. The agent level is slower and uses your subscription limits; it’s told to investigate without changing anything or writing secrets, but an agent’s limits are its allowed tools, described below.
Fixed sessions: message Claude Code sessions that are already open
If you keep Claude Code sessions always on, each with its skill (“asistente”, “publicador”…), your assistant can give them orders over MCP: talk to Claude on your phone and it passes the order on. Each session has an inbox in FXCode. Nothing is opened on your machine: the runner’s outgoing connection hears about new messages at once.
Register each session from its own machine and folder:
fxc sessions add asistente --skill asistente --delivery herdr --target w4:p4
fxc sessions add redactor --skill redactar --delivery resume
--delivery says how messages reach it:
| Delivery | What happens |
|---|---|
hook (default) |
A Claude Code hook checks the inbox each time a turn ends. It never interrupts, but a session idling at its prompt only gets the message when its next turn ends |
herdr, tmux |
If the session is free, the runner types the message in its pane and presses Enter. If it’s busy, the hook delivers it when the turn ends. --target is the Herdr agent name or pane, or the tmux pane |
resume |
If the session isn’t open, the runner runs claude --resume in the background and what it prints is the answer. If it’s open, it waits for the hook. --resume-when-closed adds this to the other deliveries |
fxc sessions add also installs the hook in .claude/settings.local.json of the session’s folder, without touching the hooks you already have (--no-hook skips it; restart a session that’s already open). The hook also reports the session’s state and uploads its answer when a turn ends. It only uploads when a message was waiting for an answer: your other turns don’t leave the machine. Without the hook, the session is asked to run fxc inbox <name> --reply "…".
Several sessions can share a folder if each can be told apart: by its pane (herdr, or tmux with --target %N) or with --resume-id. A Claude Code you open by hand in that folder then won’t take their messages.
| From your assistant (MCP) | From the terminal | |
|---|---|---|
sessions_list |
fxc sessions list |
Machine, state (working, waiting, free, closed, unknown), what it’s waiting for and messages in its inbox |
session_send |
fxc sessions send <name> "<message>" |
Leaves a message and returns right away |
session_messages |
fxc sessions messages <name> |
The state and the log: how each message was delivered and what it answered |
Sessions are registered from the terminal only, not over MCP. Only their owner can see or message them, and a machine’s token only reaches its own sessions. A task’s agent can’t message them with its token. Every message sent and received is logged for 30 days, and a message not delivered within 24 hours expires, so an old order doesn’t run by itself when you turn the machine on. Limits: waiting stays until the turn ends, even after you approve the permission, and if a terminal is closed abruptly the session may show its last known state.
Send a task to a session that’s already open
A fixed session can also take agent tasks, instead of the runner opening a new session in a worktree. Connect it from inside the session, in its folder (or ask it with the fxc-attach skill):
fxc agent attach --name asistente
Register the machine with fxc agent register first. This is fxc sessions add plus taking tasks. By default it uses the projects whose paths match this repo in ~/.fxcode/agent.json; without a match, it accepts any of your projects. Repeat --project <id> to limit projects, or use --any-project to remove that limit. It creates no worktree: work happens in the session’s directory. When you create a task with the agente tag, the machine picker offers Session already open next to the machines; from your assistant, create_task or queue_task with session: "asistente". The task gets the session:asistente tag and no runner opens a new session for it.
The session gets the task in its inbox, so it’s delivered like any message and never interrupts a turn: when its turn ends (hook), in its free pane (herdr, tmux) or while it waits with fxc inbox asistente --wait. It takes one task at a time: the next one waits until it runs fxc tasks finish (or need-human) on the current one. If the session gives no sign for 2 hours, the task goes back to the queue.
Settings → Agent machines lists the connected sessions, their state and the task each one has. fxc agent detach stops taking tasks: a task it hasn’t received yet goes back to the queue, the one it’s on stays with it.
fxc agent attach --name asistente --project <projectId> --delivery hook
fxc inbox asistente --wait --timeout 540 --json
fxc inbox asistente --reply "Review finished"
fxc agent detach asistente
--delivery hook is the default; restart Claude Code if the hook was installed while the session was open. herdr and tmux need fxc agent serve running; tmux requires --target. Without --wait, inbox takes pending messages immediately. With --wait, it marks the session free and waits for the first batch or the timeout (540 seconds by default); it is not a permanent process: call it again to keep waiting. --reply answers the inbox but does not finish the task: use fxc tasks finish or need-human to free the session.
In MCP, session accepts a name or id; do not combine it with runnerId. session: "new" returns a queued task to new-session mode. In the CLI, create it with --tag agente --tag session:asistente (use the configured dispatch tag if it differs from agente).
In Settings → Agent machines, you can enable or disable task intake for a registered session and see its machine, delivery, state and current task. This neither closes the terminal nor removes its inbox. The task picker includes busy sessions and sessions whose machine is offline: the task waits without automatically opening another session.
Launchers
--launcher picks how the agent starts:
| Launcher | What it does |
|---|---|
claude |
claude -p with no interface, for servers or a Raspberry Pi (default) |
codex |
codex exec with no interface |
opencode |
opencode run with no interface |
herdr |
Opens a Herdr pane per task: it shows up in the sidebar with its state and you can step in. It keeps working if the runner restarts. --herdr-kind picks the agent |
Add your own in ~/.fxcode/agent.json, as a command or as a module:
{
"launcher": "aider",
"launchers": {
"aider": { "command": "aider", "args": ["--yes", "--message", "{prompt}"] },
"mine": { "module": "/home/me/my-launcher.mjs" }
}
}
{prompt} becomes an instruction to read .fxc-task.md, a file in the worktree with the whole assignment that git ignores. With "stdin": true the assignment goes through standard input instead. A module exports by default a function that takes the config and returns { name, harness, unavailable(), start(ctx) }; start returns { wait(), cancel() }.
Permissions and security
An agent runs code on your machine, so the defaults are conservative:
- The runner’s token (
fxa_…) only works for the runner’s own endpoints, is limited to the projects you chose, can be revoked and is stored hashed.fxc agent rotate-tokenreplaces it;fxc agent revokeor the web cuts the machine off and returns its tasks to the queue. - Each agent gets a token for its task: it can only use
fxcon that project’s tasks and read that project. It doesn’t work on the MCP or the public API, can’t be renewed, can’t create tasks that dispatch more agents, and dies when the run ends. The agent never uses your session. - Only your own tasks by default. A task’s description is an instruction for an agent with access to your machine: with
--any-author, anyone in the team can have code run on it. Use it on a dedicated machine. - Allowed tools:
git,gh,fxc, the package managers andnode, plus reading and editing files.--allow-tool "Bash(make:*)"adds others. In a Herdr pane anything else waits for you; in a headless run it’s denied. --skip-permissionsremoves those limits. A task can then run anything, so use it only on a dedicated machine.- Claude Code asks whether you trust each new folder, and every task is a new worktree. In Herdr the agent waits in its pane for you to confirm, unless you register with
--auto-trust. - Agents that make no progress (Herdr): with no sign of life in about 60 s, or after 20 minutes with no progress or waiting for a permission (
stallMinutesinagent.json), the run fails with the last lines of the pane, tokens masked, and the task waits for a person. Check those lines before sharing them: they can include other data from your session. - Cleanup: when a run fails or is cancelled, its worktree and branch are removed, unless they have uncommitted changes or unpushed commits.
Hosting FXCode yourself? Runners work the same: fxc agent register uses the API your CLI points to.