LilCaddie – keep agent state outside the harness
LilCaddie keeps coding agent memory, context, and 29 MCP tools in a single local SQLite file outside harnesses like Claude Code, Codex, and Gemini CLI.
By Dillip Chowdary • Dec 06, 2026 • Source: willcooley.github.io

At a glance
- Product
- LilCaddie (npm package lilcaddie)
- Stage
- Early release
- Storage
- .lilcaddie/state/lilcaddie.db (local SQLite)
- MCP tools
- 29 tools via lilcaddie-mcp
- Built-in flows
- 9 total (init installs feature and onboard)
- Dashboard limits
- 30-second max replay; 600-file full map cap
In this post
Developer Will Cooley has released an early version of LilCaddie on npm as lilcaddie, an external control plane for coding agents described in willcooley.github.io's documentation. The tool plugs into Claude Code, Codex, OpenCode, Gemini CLI, and GitHub Copilot CLI to keep memory, context, and work state in a single SQLite file outside the agent harness. By enforcing deterministic exit gates, LilCaddie prevents coding agents from declaring a task finished before checks pass.
This article examines how LilCaddie manages agent loops, enforces human approvals, and tracks tool calls across repositories. It also details the current testing status across supported command-line harnesses, the live dashboard replay limits, and the nine built-in workflows. The overview is aimed at software engineers running autonomous or multi-tool coding sessions.
01Exit gates and the SQLite scorecard
LilCaddie acts as a scorecard and control layer around an existing agent harness rather than replacing the underlying model. When a run begins, a phase moves from entry to an exit gate that checks deterministic conditions such as a command's exit code, a file, recorded evidence, or untouched protected paths. If any check fails, the gate tells the agent what to fix and sends the run back into a retry loop.
In the example loop created by lilcaddie init, running lilcaddie start example --goal "Try lilcaddie" initializes run r_mx0kibdq60f5e8. Calling lilcaddie advance before recording work returns exit code 2 with a failure message on attempt 1 of 4 because zero done evidence records exist. After running lilcaddie evidence add done "Ran the example by hand", lilcaddie advance reports that all exit gates passed.
Each loop operates under explicit budgets so an agent cannot spin indefinitely until a user's usage allowance is exhausted. Between loops, a pure routing orchestrator reads recorded outputs, artifacts, and gate results to choose the next step. The orchestrator never asks a language model what to do next.
02Remote runs, queues, and human approval
Developers can start a coding task from a phone through a harness remote mode such as Claude Code's Remote Control while leaving the work running on a local machine. A pure policy engine governs bounded autonomy by deciding whether to advance, retry, go back, or escalate. Reversible decisions proceed automatically, whereas irreversible actions stop the run and wait for human input.
To protect sensitive files, any modification to a protected path either fails the active phase or is refused outright by hooks. Human sign-off relies on lilcaddie approve, a command that must be executed at a terminal on the user's machine. That command refuses to run inside an agent's own session, ensuring remote work waits for local approval.
When multiple agents tackle a large task, a built-in queue assigns each piece to a single taker inside its own repository checkout. This isolation keeps agents from repeating work or overwriting each other's edits. Every lesson learned and every message exchanged between agents is saved to the shared record for the next participant.
03Three interfaces over one local engine
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
Under the hood, three stateless interfaces sit above a single engine that judges gates, applies policy, and selects the next loop. Users interact through the lilcaddie terminal command, harnesses invoke lilcaddie hook, and agents call 29 tools exposed through lilcaddie-mcp. Each command, tool call, or hook opens the project, performs one action, and closes it without holding state in memory.
All persistent data lives inside .lilcaddie/state/lilcaddie.db, a local SQLite file stored directly in the repository's working copy. It requires no external account, cloud service, or provider hosting. The database holds a hash-chained ledger built to expose any tampering, alongside current run state, lessons, decisions, and rendered artifacts that fail their gate if manually edited.
Beyond memory and loop rules, the file stores structured context detailing where work stands, what the application does, and where task symbols are defined. Agents receive this context before opening a single file, and a human approves the notes defining the application's purpose. Any new session begins by calling loop_status to retrieve current phase and gate requirements.
04Harness portability and current test status
Standard agent harnesses store memory in their own formats and locations, meaning learned context is lost when a developer switches tools or hits a subscription cap. By moving memory into the repository's SQLite file, LilCaddie lets a developer start work in one harness and continue in another. Every supported tool reads the same store through identical MCP tools and faces identical gate checks.
In practice, a developer can hit a usage limit on one subscription and resume the same phase on another provider without leaving state behind. Multiple harnesses on one machine can also participate using their own separate subscriptions. Every action from every tool is appended to the same hash-chained ledger.
Note: Only Claude Code has been driven end-to-end by a model so far, including one session steered from a phone via Remote Control. Codex, Gemini CLI, OpenCode, and GitHub Copilot CLI are expected to work via the shared protocol but remain untested. Running two harnesses on one shared goal has also not been tried yet.
05Live run dashboard and nine flows
Hooks record every tool call an agent makes, allowing lilcaddie view to render a live network map over the repository's code structure. The agent sits at the center surrounded by its tools and indexed files grouped by location and joined by imports. Each call travels as a pulse from agent to tool, onto the target file, and faintly along its imports.
While a run is active, calls appear as they happen, and finished runs replay from start to finish in at most 30 seconds with failed calls highlighted in red. The dashboard logs only what the agent asked tools for, showing command programs and subcommands without naming external files. Code maps exceeding 600 files render only touched files and their direct imports.
LilCaddie ships nine prebuilt flows, each bundling a loop, phase gates, phase-specific skills, launch commands, and a report template. Running lilcaddie init installs feature and onboard, while the remaining flows can be added as needed. The bug flow enforces sequential stages from report, reproduce, and root cause through fix, tests, security, audit, and a final human shipping approval gate.
Frequently asked questions
What harnesses does LilCaddie support?
LilCaddie plugs into Claude Code, Codex, OpenCode, Gemini CLI, and GitHub Copilot CLI via MCP, hooks, skills, and commands. So far, a model has driven a loop end-to-end in Claude Code, while the other four harnesses are expected to work from the protocol and have not been tested yet.
Where does LilCaddie store agent memory and run state?
All memory, context, and run history are stored in a single local SQLite file at .lilcaddie/state/lilcaddie.db inside the repository's working copy. It uses a hash-chained ledger and requires no external account or cloud service.
How does LilCaddie prevent agents from finishing prematurely or editing protected files?
LilCaddie enforces deterministic exit gates at the end of each phase, checking command exit codes, files, recorded evidence, and protected paths. Any edit to a protected file fails the phase or is blocked by hooks, and irreversible actions require running lilcaddie approve in a local terminal outside any agent session.
What does the live dashboard in lilcaddie view show?
It renders a live network graph of tool calls over the repository's code map and can replay finished runs in at most 30 seconds, marking failed calls in red. If a repository has more than 600 files, the map displays only the files touched during the run along with their imports.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
Advertisement