---
title: "Agents that keep working when I close the laptop"
description: "My NanoClaw agents shut down when idle, cold start when work arrives, park through plan limits and never hold a credential, so the fleet keeps running without me at the keyboard."
url: "https://michael.zazon.us/notes/agents-that-keep-working-when-i-close-the-laptop"
published: "2026-11-04T12:00:00-05:00"
kind: "build-log"
subject: "ai-agents"
tags: ["agents","docker","claude"]
series: "Coding agents"
part: 6
---
My NanoClaw agents can be triggered by laptop events, server events, webhooks, messages from other sessions, me in Slack, scheduled tasks, etc. (even though Claude Code can do a lot of this with routines, remote control and other features). It's hard to switch because I've spent a year heavily customizing the orchestrator/harness and tailoring my workflow to it. I just got access to Claude Duet, so I'm actively looking at moving some of this over there. For now though.. a peek at what I'm doing in NanoClaw..

My agents run in [my own fork of NanoClaw](https://github.com/mzazon/nanoclaw), which is built on the [upstream project](https://github.com/qwibitai/nanoclaw) (I contribute upstream too). There are two runtimes: the real Claude Code CLI (in Docker, under tmux) and the Agent SDK runtime (a Bun poll loop, also in Docker or just a host process). I have over 300 numbered local changes against upstream, each logged in my vault, and every change has to work on a test agent before it goes fleet-wide. (Why NanoClaw: [Why I dropped OpenClaw for a smaller agent runtime](https://michael.zazon.us/notes/why-i-dropped-openclaw-for-a-smaller-agent-runtime). How I split duties: [Running an agent fleet like a small team](https://michael.zazon.us/notes/running-an-agent-fleet-like-a-small-team)).

What does the agent do when it's not working? In the SDK runtime, nothing. The poll loop persists between messages, the sweep kills the process after 30 minutes of idle time, and the next message/scheduled task spins up a fresh process. No leaked processes, no daemon.. it just cold starts when there's actually something to do.

Claude Code containers store session files on the host and pass `--continue` in the entrypoint if they exist. I tested this by killing the container, respawning, and observing it remember the previous conversation. So restarting does preserve context.

[Diagram: An agent goes idle, stops, wakes on new work, or parks at a plan limit](https://michael.zazon.us/notes/agents-that-keep-working-when-i-close-the-laptop)

I built my own message bridge using Claude Code's channels feature and some observations from the community. I recently built my own agent communication on top of Claude Code's messaging: [my post on agents messaging my sessions](https://michael.zazon.us/notes/my-agents-can-message-my-coding-sessions-now-and-back), which gives me more flexibility in how the host and orchestrator communicate.

I used Anthropic's devcontainer for claude code and I also learned a lot from the community projects that run an always-on Claude Code session in containers. One of them documents three tmux deadlocks that it works around with hooks: the picker becomes invisible to remote watchers, a reply gets typed out as plain text instead of sent, and a rate-limit banner appears with no signal. NanoClaw's bridge avoids them, but I also block pickers with a [hook](https://code.claude.com/docs/en/hooks) denying `AskUserQuestion` and `ExitPlanMode`: a tmux-pane picker would wait forever while I answer on Slack.

When an agent hits its plan limit, it parks in place and continues after the reset.

Park in place uses Claude Code's own session continuation when a usage window resets. I chose the built-in auto resume for this, since long agentic sessions are exactly where it matters. I did some wonky screen scraping previously of the tmux pane, that proved to be unreliable so I'm glad Anthropic shipped session park and auto continuation.

Credentials don't need desk presence. Agents never hold them, they call APIs normally and a man-in-the-middle proxy injects the credential per request, just in time (agent never sees the secret). Because the proxy looks up the secret every request, rotating a key doesn't need a container restart. One rough edge: new agents started without credentials granted (the most common auth failure). Now grants attach at agent creation, so they work on first spawn. Host-side secrets are different, see [1Password CLI and Connect secrets without env files](https://michael.zazon.us/notes/1password-cli-and-connect-secrets-without-env-files).

Any risky action the fleet wants to take comes to me as an approval card in Slack DMs.. install a package, add an MCP server, send an iMessage, or click in a Mac app. This is separate from my own Claude Code sessions, where the `PermissionRequest` hook waits up to 300 seconds for me to answer from my phone. (Covered in [My whole dev setup fits in my pocket](https://michael.zazon.us/notes/my-whole-dev-setup-fits-in-my-pocket).)

The next piece I wanted was for subagents to be able to report back while they're working. I saw on Reddit that agent teams had been folded into plain subagents, so I checked with my probe subagent on Claude Code 2.1.181. A background subagent can message its parent while working, though a foreground one only returns text at the end.

Separately, I've started a new series on training my own small models, beginning with [an AI text detector tuned to my writing](https://michael.zazon.us/notes/training-my-own-ai-text-detector-with-claude-code).