LilCaddie – keep agent state outside the harness LilCaddie, a new npm-published tool, keeps coding-agent memory, context and loop state in a single SQLite file outside the harness so work survives across sessions and across Claude Code, Codex, OpenCode, Gemini CLI and GitHub Copilot CLI. The tool enforces deterministic exit gates — a phase ends only when checks such as a command's exit code or a required file pass — and records every action in a hash-chained ledger; `lilcaddie approve` refuses to run inside an agent's session. The author states only a model in Claude Code, including one session steered from a phone via Remote Control, has driven LilCaddie so far, and that the other three harnesses and two harnesses on one goal have not been tried yet. Leave your coding agents working. Come back to work that passes. LilCaddie is the caddie for your coding agents. It carries what they forget, keeps the scorecard, and does not let them call the job finished until the checks pass. It plugs into Claude Code, Codex, OpenCode, Gemini CLI and GitHub Copilot CLI, and keeps memory, context and the state of the work in one SQLite file outside the harness, so the work survives a session and continues in another tool. Early. On npm as lilcaddie . What is built and what is not status . evidence:done passed bash $ lilcaddie start example --goal "Try lilcaddie" Started r mx0kibdq60f5e8 example . $ lilcaddie advance retry: Gates failed attempt 1 of 4 . ✗ evidence:done — Found 0 "done" evidence record s in this phase; 1 required. Do the work, then record what you observed with the evidence add tool kind "done" , including the actual output. exit 2 $ lilcaddie evidence add done "Ran the example by hand" Recorded "done" evidence 1. $ lilcaddie advance completed: All exit gates of the final phase passed. The example loop from lilcaddie init , with the output the real CLI prints, shortened. More work, less hand-holding, wherever you are Start a piece of work from your phone, through a harness with a remote mode such as Claude Code's Remote Control. On your machine, more than one harness can take part in it, each on its own subscription. They share one record of what was learned and done, so they work as one, and you are asked only for what is yours to decide. - Leave it workingAn agent on its own says it is done when it is not, or goes round until the usage is spent. lilcaddie checks the work itself at every gate, and every loop has a budget. When something needs you, the run stops and waits. - Use every subscription you haveClaude Code, Codex, Gemini CLI, OpenCode and Copilot CLI read the same memory and the same place in the work, through the same tools. Hit a limit in one and carry on in another, with nothing left behind. - Several agents, one goalA queue gives each piece of a large task to one taker, in a checkout of its own, so agents do not repeat or overwrite each other. What each learns is there for the next, and what they say to each other is recorded. - Know what happened while you were awayEvery action goes into a hash-chained record built to show an edit. A change to a file you protect fails the phase, or is refused by the hooks. lilcaddie approve is run at a terminal on your machine and refuses to run inside an agent's session, so work started from a phone waits there for you. This is the direction lilcaddie is built toward. A model has driven it in Claude Code, and one such session was steered from a phone through Remote Control. The other three harnesses, and two harnesses on one goal, have not been tried yet. Three things your harness does not keep for you lilcaddie is the control plane for coding agents, built as an extension of the agent harness. The harness still runs the model. lilcaddie keeps three things in one SQLite file outside it, so the work survives a session and continues in another tool. - MemoryLessons, decisions and the full history of every run, in a hash-chained ledger any harness can read. - ContextWhere the work stands, what the application is, and where the names in the task are defined, given to the agent before it reads a file. A person approves the notes that say what the application is for. - Loop-engineeringAn agent harness runs a loop: prompt, act, stop. lilcaddie decides what happens around it: what the agent is told on entry, what must be true before it may stop, what happens when it is not, and what comes next. The loop is data, and lilcaddie enforces it - GatesA phase ends only when deterministic checks pass: a command's exit code, a file, recorded evidence, protected paths left untouched. A failing gate tells the agent what to do, and the agent is sent back. - Bounded autonomyA pure policy decides: advance, retry, go back, escalate. Reversible decisions proceed; irreversible ones wait for a human. Every loop has budgets, so nothing runs forever. - An orchestrator that only routesBetween loops it reads recorded outputs, artifacts and gate results and picks the next loop. It never asks a model what to do next. - Deterministic artifactsReports rendered from the ledger: the same records give the same bytes, and an edited report fails its gate. How the pieces fit Your work isn't tied to one harness or one subscription A harness that keeps an agent's memory keeps it in its own place and its own format. Change tools, run out of usage or let a subscription lapse, and what the agent learned stays behind. lilcaddie takes memory out of the harness so that it belongs to your repository instead. - Memory lives with the repositoryLessons, decisions and the history of every run are in .lilcaddie/state/lilcaddie.db , a SQLite file in your working copy. It needs no account and no service, and no provider holds it. - Any provider can pick it upEvery harness reaches the same store through the same MCP tools. A new session calls loop status first and is told the current phase, its gates and what earlier sessions learned, whichever model is behind it. - Carry the work where you want to goStart in one harness and continue in another when you hit a limit, prefer a different model for a phase, or change subscriptions. The gates judge the work the same way wherever it was done. So far a model has driven a loop through these tools in Claude Code only. Codex, Gemini CLI, OpenCode and Copilot CLI are expected to work from the protocol and have not been tried. Watch what a run reached for lilcaddie's hooks record every tool call an agent makes during a run. The dashboard draws them on a run's page as a network laid over the map of your code: the agent in the middle, its tools around it, and beyond them every file lilcaddie has indexed, gathered by where it is in the repository and joined by its imports. Each call travels as a pulse from the agent, through the tool, to what it reached, and on, more faintly, along that file's imports. - See it liveWhile a run is working, each new call is played as it is recorded. You can see where the agent is spending its calls, and which parts of the repository it has not opened. - Play it backA finished run replays from its first call, in half a minute at most however long it took. A call that failed travels in red, so the test that failed before the fix is there to see. - A record, not a mindIt shows what an agent asked its tools for, never what a model computed. Of a command only the program and its subcommand are named, and nothing outside the repository is named at all. A harness with no hooks installed records none of its own tools, so only lilcaddie's are drawn. A code map of more than 600 files is not drawn whole: only the files the run touched are there, with what they import and what imports them. What it adds to your harness lilcaddie plugs into the harness you already use through MCP, hooks, skills and commands. The harness still runs the model. These are the things lilcaddie adds around it. Flows: a ready-made way of working A flow is a loop, the gates that judge each phase, one skill per phase telling the agent exactly what to do, the commands that start it, and a report template. lilcaddie ships nine. lilcaddie init installs feature and onboard ; install the others when you want them. | Flow | For | |---|---| | feature | Building something new, from an idea | | bug | Fixing something broken | | incident | An outage, or a failure nobody can explain yet, from triage to a postmortem | | migration | Moving to another library, framework or version, behaviour unchanged | | tech-debt | Restructuring code, behaviour unchanged | | product-idea | Deciding whether an idea is worth building | | security | Assessing a codebase by OWASP standards | | onboard | Recording what the application is, for every later session | | teach | Making a cheaper model follow an instruction file as well as a stronger one | | tune | Making a loop's instructions or a skill better, one measured change at a time | | perf | Making one algorithm faster, verified against a reference and timed against the original | | spike | Finding out whether new work can be done, and what it would cost, before building it | | testing | Making a test suite worth trusting: flaky tests fixed, the pyramid, real-world scenarios and an adversarial review | | pr-sync | A pull request with review comments and conflicts: synced with its base, each comment investigated and answered | | quick | A small change: at most ten files, and no dependency, migration, deployment or secret | lilcaddie flow list lilcaddie flow install bug --set test command="pnpm test" lilcaddie start bug --goal "Login fails for emails with a plus sign" Agents that talk to each other A session sends a message to another agent, in any harness, with the agent send tool; you send one with lilcaddie hub send . Every message goes through the hub: one process per project that records the message in the ledger, then hands it at once to everyone listening as the name it is for. lilcaddie a2a serves the same agents over the Agent2Agent protocol v1.0 , so an agent that is not lilcaddie's can reach them. lilcaddie hub the hub, until stopped lilcaddie hub send codex "Check line 88" a message, from you lilcaddie hub listen print messages as they are sent lilcaddie a2a --caller reviewer the same agents, over Agent2Agent Know before you rely on it: the hub is tested on Windows only. Handing a message to a session through its hooks is tested with documented payloads and has not run in any harness, and a session that is idle is not reached. No outside agent has called the Agent2Agent server yet; it refuses v0.3 callers and keeps its tasks in memory. Every Agent2Agent token is one named caller's, and a caller sees only the tasks it sent. The sender's name is a guardrail, not a security boundary. Every repository and worktree on one page lilcaddie view opens a local page you can read at three widths. Applications lists every repository you have added, with the work under way in each. Work shows one repository checkout by checkout: the branch each git worktree is on, the bug or feature running in it, and how many files are changed and not committed. A click on any item opens the run , told from start to finish in plain words. With Worktrunk https://worktrunk.dev installed, each checkout also shows its pull request, its checks and its marker. lilcaddie view this repository lilcaddie view --add ../another-repository put another one on your list git worktree add ../blog.fix-feed -b fix/feed or: wt switch --create fix/feed The Applications and Work pages have been seen with a demonstration repository, in headless Chrome on Windows. Worktrunk's part is read from the output its documentation describes and has not been tried with Worktrunk itself. Teaching a cheaper model The teach flow takes an instruction file a prompt, a skill, an agent definition and rewrites it until a cheaper model does the work as well as a stronger one. The stronger model is the teacher, and its score on a benchmark is the bar. The cheaper one is the student. It has been driven end to end in tests with stand-in models; there has been no run with real models yet. A sandbox for lilcaddie's tools and its record A Docker container that holds lilcaddie and this repository, and nothing else of yours. Your harness runs on your machine, logged in as it always is. What moves into the container is lilcaddie's MCP server and the database it writes to: every tool call the agent makes is served there, and the loop state, evidence, ledger and memory are kept in a Docker volume, not in a file in the repository. The repository does not choose the image that runs, and lilcaddie's own containers are given your repository read-only, but for where its reports go. It is a guardrail, not a wall: an agent that can run docker on your machine can reach the volume. These measures are made with best effort and none is a guarantee: nothing is perfect, and lilcaddie does not promise that an agent is prevented from doing anything, or that your code, keys or machine are secure. lilcaddie sandbox build once: the image lilcaddie setup --sandbox keep this repository's record in the sandbox The harness in the sandbox too An agent on your machine runs as you: it can read your signing key, watch your terminal and change any program you run. lilcaddie sandbox run starts the harness itself in the container, which is meant to keep it away from that. It lowers the risk and does not remove it. | The run gets | What that is meant to keep from it | |---|---| | A copy of the repository | Your repository and its .git are not mounted. What the run commits comes back as a new branch, and lilcaddie names the files on it your machine would run once merged. --in-place mounts the repository itself, with those files read-only | | A home of its own | Nothing of your home directory: not your signing keys, your harness logins or your SSH keys. Keys are passed in only if you have set them | | A network of its own, or a list of hosts | The network is set up so that one container does not reach another. --network allow lets the run reach only the hosts its harness calls and those you add, through a proxy that is its one way out; --network none cuts it off | | A read-only image | The image's files are read-only. It is built at versions lilcaddie names, from Debian's dated archive, on a base image named by its digest, and is started from the identity recorded at the build. lilcaddie sandbox scan runs Trivy over it | | Limits, and an end | No Linux capabilities, not root, 4 GB of memory, 512 processes, 2 processors. A run idle for 60 minutes is stopped, and what it printed is kept | lilcaddie sandbox scan known vulnerabilities in the image lilcaddie sandbox run -- claude log in once, with /login lilcaddie sandbox run --network allow -- claude reach the model's hosts and nothing else lilcaddie run --loop change --goal "Fix the flaky retry test" --network allow lilcaddie run is the driver: it starts the harness round after round on a copy, and lilcaddie judges the gates after each. Only a person starts it, it works only in the sandbox, and a driven round approves nothing: a run that needs you waits. It can take its work from the queue, one piece after another or several at the same time. Runs that go side by side each get a record of their own, so none waits on another; the record comes back as a bundle and the work as a branch. A run that stops for you there is kept: you read it, answer it and have it driven on by naming it, and what you approve is its branch at one commit. lilcaddie run --from-queue --at-once 3 three pieces, each in a container of its own lilcaddie sandbox kept the runs that wait for you, and the branch each is on lilcaddie approve --kept