Agents running on the mini-PC
This is where the dedicated machine truly comes into its own: an always-on agent that runs in the background or on a schedule, in private, costing you nothing locally. Your little colleague that never sleeps.
In this guide
- 01The idea: an always-present machine = agents that run without you
- 02Agents in the background or on a schedule
- 03The winning combo: local agents + Ollama
- 04Reachable from anywhere
- 05Keeping a session alive with tmux
- 06The security of an autonomous agent
- 07Setting up a recurring agent: the checklist
- 08An honest word on long-running autonomy
- 09Frequently asked questions
Guide checked 3 months ago: some commands may have changed. Let us know if so.
In short
An always-on mini-PC can run agents without you: a cron or systemd timer launches the agent in non-interactive mode (claude -p, codex exec or opencode run) on a fixed task, the agent loops until it's done, writes a log and notifies you. For frequent or private tasks, a local model served by Ollama costs nothing to run; a top-tier online model (Claude, GPT) stays for the hard decisions. An unattended agent needs tight permissions, a confined folder, never sudo, logs and frequent commits.
Do this first: What is an AI agent?Essential system settings
Until now, you launched the agent by hand, watched it work, closed the terminal. That’s perfectly fine, but it’s also missing the real power of a dedicated machine. Your laptop, you close it, it sleeps, it goes to meetings with you. The mini-PC, on the other hand, stays on, silent, sipping next to no electricity, day and night. And that changes everything: it becomes the perfect host for agents that work without you.
This is exactly what a laptop can’t do. An agent that wakes up every morning at 7 a.m. while you sleep, that watches a feed all day long, that prepares a report for you over your weekend, it needs a machine that never turns off. You have one. Let’s see what to do with it.
The idea: an always-present machine = agents that run without you
An agent, as we saw in What is an agent, is a loop: goal, action, observation, repeat. Nothing forces this loop to unfold before your eyes. If you can trigger it on its own: on a schedule, on an event, in the background, then your mini-PC turns into a colleague that works while you live your life.
A few examples that become possible the day the machine stops sleeping:
- Every morning, an agent rereads the open pull requests and posts you a summary on Slack.
- An agent watches an RSS feed or an API and warns you when something moves.
- A recurring report (yesterday’s numbers, the state of a service) generated and sent without you lifting a finger.
- An agent that monitors a service and alerts you when it goes down.
The common thread: nobody is in front of the screen. And that’s where the dedicated mini-PC beats the laptop hands down.
Agents in the background or on a schedule
How do you go from “an agent I launch” to “an agent that launches itself”? With Linux’s two old scheduling tools: cron and systemd timers. You ran into them in System settings, they’re the ones that fire a command at a fixed time, over and over, without you.
The trick is that your agent knows how to run in non-interactive mode (“headless”): instead of opening a terminal and chatting, you hand it a task all at once, it executes it, returns its result, and stops. Plug this mode into a timer, and you have a recurring agent.
The real shape, without the syntax details:
# crontab -e, every morning at 7 a.m., we wake the agent on a fixed task
0 7 * * * cd ~/projects/watch && /path/to/agent "Review the open PRs and post a summary" >> ~/logs/watch.log 2>&1
The timer calls the agent with a task, the agent loops on its own until “it’s done”, writes to a log, and hands back control. Tomorrow morning, same again.
Claude Code can also schedule things itself, at other scales. /loop reruns a prompt at a regular interval as long as the session stays open (and recurring tasks expire after seven days). Routines (/schedule) run on a schedule, but in Anthropic’s cloud, so far from your files and your local models. For an agent that works on the mini-PC, cron and systemd remain the right plumbing.
The winning combo: local agents + Ollama
An agent that runs a hundred times a day, you don’t want to pay for a hundred times a day. And if it handles sensitive data, you don’t want it leaving for a third party on every loop. This is exactly the playground of the hybrid cloud + local, applied to autonomous work.
The idea: for high-frequency, private, or offline loops, you point the agent at a local model served by Ollama. Marginal cost: zero. Data leaving: none. A background agent that classifies, summarizes, or monitors a thousand times a day runs for free and in private on your machine. You save the cloud (Claude, GPT) for the rare moment when you really need top-tier reasoning.
To pick that model, Quelle IA keeps a ranking of models to run at home and a machine-by-machine page (for example for a Ryzen AI Max+ 395 with 128 GB), all in French. For an agent, cross-check with the Agents ranking: a model that chats well isn’t necessarily good at chaining actions on its own.
Reachable from anywhere
The mini-PC is on your private network. So you don’t need to be physically in front of it to hand it work or check where it’s at. From your phone on the subway, from your laptop at a client’s: you text a task to your machine, it works while you’re elsewhere, and you review the result later.
Claude Code does this natively with Remote Control: run claude --remote-control (or type /remote-control in an open session), and the session can be driven from claude.ai/code or the Claude phone app, while the code and files stay on the mini-PC. It takes a Pro, Max, Team or Enterprise subscription. On the Codex side, driving it from your phone goes through the Codex (or Remote) tab of the ChatGPT app, which connects to the ChatGPT desktop app on a Mac or a Windows PC; that desktop app can open a project on the mini-PC over SSH, as long as codex is installed and signed in there. And if you’d rather message your agent in Telegram or Discord, Claude Code’s Channels and gateways like Hermes or OpenClaw are covered in Hermes & OpenClaw.
For everything else, that’s the networking chapter coming up: Tailscale weaves the private link between your devices, and Working remotely shows how to reach the machine over SSH from anywhere. The mini-PC becomes a workshop you carry in your pocket without ever unplugging it.
Keeping a session alive with tmux
Not all agents are scheduled jobs. A long interactive session launched over SSH dies with your connection, unless you started it inside tmux: the session lives on the mini-PC, you detach, and you find it later right where you left it. The how-to is in Working remotely. The tmux + claude --remote-control pair works very well: tmux keeps the process alive, Remote Control puts it in your pocket.
The security of an autonomous agent
We come to the serious point. An agent that acts with no human in the loop is precisely where the rule of least privilege matters most. When you’re in front of the screen, you can say “no” before the blunder. In the background at 3 a.m., nobody will say no for you.
Setting up a recurring agent: the checklist
0 of 6 steps done Your ticks stay in this browser.
-
A well-bounded and idempotent task
Clear goal, verifiable result, and above all: running it twice must not break everything. A background agent must be able to run a hundred times without cumulative side effects.
-
Choose cloud or local based on frequency and sensitivity
Often, or private, or offline → local model via Ollama. Rare and reasoning-heavy → online model (Claude, GPT). That’s the trade-off from the hybrid.
-
Launch it via cron, a systemd timer, or tmux
Scheduled job for the quiet recurring stuff; tmux for a long session you want to be able to rejoin. The non-interactive commands are listed above.
-
Tight permissions + confined folder
Least privilege, closed working directory, zero
sudo. We’ve hammered it just above, it’s non-negotiable for anything unsupervised. -
Logs + notification of the result
Redirect the output to a log file, and get yourself pinged (Slack, email, notification) with the result. A silent agent working in the dark, you’ll never know if it goes off the rails.
-
Watch the first runs before trusting it
Watch it run for a few days before you really leave it alone. Trust is earned by watching it work.
All three agents can handle this background work. They don’t offer the same models: Quelle IA’s coding tools page (in French) lists the ones in Claude Code, Codex and OpenCode, with each one’s score. And for a resident assistant you reach by messaging, with built-in memory and scheduled tasks, see Hermes & OpenClaw.
Claude Code launches very well non-interactively on a fixed prompt, which makes it an excellent scheduled-job engine. Frame it with a CLAUDE.md (memory files) that reminds it of its limits, allowed tools, working folder, what it never touches. For an agent that runs often, have it delegate the volume to the local model and keep its intelligence for the final synthesis. Claude Code can also run entirely on a model served by Ollama (ollama launch claude), see Ollama & local models.
OpenCode shines for private background work: hooked up to your local model, a recurring agent pays nothing and lets no data leave. You explicitly choose the model per task, local for the frequent loops, cloud for the rare hard decisions.
Codex has its non-interactive mode, codex exec, and a sandbox that already does part of the confinement work: in workspace-write, it only writes inside the working folder, and network access stays off until you turn it on in the config. Frame it with an AGENTS.md (memory files) that reminds it of its limits. On a mini-PC with no browser, sign in to your ChatGPT account once with codex login --device-auth.
# crontab -e, every morning at 7 a.m.
0 7 * * * cd ~/projets/veille && ~/.local/bin/codex exec --sandbox workspace-write -o ~/logs/veille-resume.md "Read the open PRs and write a summary" >> ~/logs/veille.log 2>&1
For a frequent loop, Codex also runs on a model served by Ollama (codex exec --oss -m <model> "the task"), see Ollama & local models.
An honest word on long-running autonomy
Let’s be clear: unsupervised autonomy on long, open-ended tasks remains the frontier of the field. Local models, in particular, are far better as well-bounded background workers than as fully autonomous operators, we said it plainly in Choosing your local model. Let loose on a vague, distant goal, a local model will produce plausible-but-wrong output, confidently, in a loop.
The answer is simple and holds in two words: bound and verify. Break it into short, clean tasks, make them idempotent jobs, keep a human who reviews the result. A background agent that does one small thing well a thousand times is infinitely better than an ambitious agent that loses its way. It’s less spectacular, and far more useful.
All the commands in this guide
Frequently asked questions
Why won't my agent start from cron when it works in the terminal?
Cron doesn't load your usual PATH, so it may not find the agent's executable. Give the full path in the crontab, for example ~/.local/bin/claude or ~/.local/bin/codex if you used the official installers. Also redirect the output to a log file so you can see what happened.
What's the difference between /loop, Claude Code routines and a cron timer?
/loop reruns an instruction at a regular interval as long as the session stays open, and its recurring tasks expire after seven days. Routines, created with /schedule, run on a schedule in Anthropic's cloud, far from your files and your local models. For an agent that works on the mini-PC itself, cron and systemd timers are still the right plumbing.
How do I stop a permission prompt from blocking a scheduled agent?
With Claude Code, the --allowedTools option pre-approves specific tools so that no prompt blocks the job. Codex runs by default in a read-only sandbox: --sandbox workspace-write lets it write in the working folder, and network access stays off until you enable it in the config. Either way, only allow what the task actually needs.
Can I control the mini-PC's agent from my phone?
Yes. With Claude Code, run claude --remote-control or type /remote-control in an open session: you can then drive it from claude.ai/code or the Claude app, while the code and files stay on the mini-PC. It requires a Pro, Max, Team or Enterprise plan. Started inside tmux, the session also survives your SSH connection dropping.
Can a local model work on its own for hours?
That's its weak spot. Local models are far better as background workers on short, bounded tasks than as fully autonomous operators: set loose on a vague, distant goal, they produce plausible but wrong output, over and over. Break the work into small tasks that can be rerun safely, and keep a human reviewing the result.
Terms in this guide: AgentAPILinuxsystemdClaude CodePromptRemote ControlCodexSSHHermesOpenClawtmuxOpenCode
Spotted a mistake?
A command stopped working, a price changed?
Tools change every month. Tell me what is wrong in this chapter and I will fix it and update its date.