Headlong is an open-source microharness whose core fits in less than 10,000 lines of Bash. Install it with curl -fsSL https://headlong.ai/install.sh | bash, and the agent can keep thinking between messages instead of waiting for another prompt. That persistent loop makes Headlong useful for long-running research and maintenance experiments, but it also creates a continuous cost meter, a powerful shell-execution boundary, and one shared memory stream that is not suitable for secrets.
Laude Institute released Headlong on August 25 with researchers from MIT. The project calls the design "persistent agency." In plain terms, the agent remains an active process. A Slack message, Telegram message, or terminal command becomes a new observation inside the same ongoing train of thought.
Run Headlong in a disposable environment before giving it a real repository.
What is the Headlong microharness?
An agent harness is the software around a language model. It supplies instructions, executes tools, records events, manages context, and decides when the model runs again. Headlong calls itself a microharness because the complete core is small enough to inspect: its README reports about 9,800 lines across the Bash programs in bin/ and thinkers/.
The project is not another model. It can call Anthropic, OpenAI, Gemini, or OpenRouter. Headlong supplies the runtime, shell access, memory, and communication channels.
Most chat agents are reactive. They start when a person sends a request and stop after returning an answer. Headlong's thinker process continues after the answer. It can reconsider a problem, inspect earlier work, or decide that there is nothing useful to do. New input joins that same trajectory rather than creating an isolated session.
We think the distinction matters more than the small codebase. A persistent process can discover useful work without another prompt, but any failure mode can persist too.
Set up Headlong inside Docker
Headlong requires Bash 3.2 or newer, Git, curl, jq, and one model-provider API key. Its dashboard also needs Python tooling plus Bun or Node.
The project's recommended path is Docker. You can create a dedicated container with:
docker run -it --name headlong \
--restart unless-stopped \
-p 8080:8080 \
buildpack-deps:curl \
bash -c 'curl -fsSL https://headlong.ai/install.sh | bash; exec bash'
Inside the container, provide a dedicated API key with a hard spending cap. Do not reuse a production key. Headlong executes real shell commands, and the project's documentation explicitly recommends isolating the agent.
Start a conversation from the terminal:
ada hello
ada
The first form submits one observation. The second opens an interactive chat. Operational commands include:
ada stop
ada start
ada dash
ada bugreport
If several agents are running and you need an emergency stop, the project provides headlong-killall.
Docker reduces the blast radius. It does not make an autonomous shell process safe by itself. Mount only the working directory the experiment needs. Keep SSH agents, cloud credentials, browser profiles, and host sockets outside the container. A mounted Docker socket would let a process control the host's Docker daemon, defeating the isolation you intended to create.
If your team wants to test a persistent coding agent against a real backlog, our AI agent development work can turn one bounded task into a containerized pilot with spending limits, acceptance tests, and an operator-controlled stop path.
How the persistent thought loop works
Headlong's core is a set of small command-line components rather than one large service.
shellm is the recursive model loop. It sends context to a model, executes Bash blocks from the response, returns the command results, and repeats until the model emits a final response. llm provides a common interface across model vendors.
thinkers are the long-lived processes. A thinker wakes, assembles context, calls the model through shellm, records what happened, and waits before another pass. External messages are observations added to that loop. They do not replace its internal state.
The wait follows exponential backoff when the agent has no useful work. The documented sequence starts at roughly 5 seconds, then 10, then 20, and continues increasing. A new message resets the interval. This limits waste during quiet periods, but it does not turn the process into a free event-driven service. It still wakes and calls a model.
The traj component stores events as an append-only JSONL graph. JSONL means one JSON object per line, which makes the history streamable and easy to inspect with normal command-line tools. The graph can fork when work branches and merge when the agent combines results.
context projects that growing history into the next model prompt. Recent events remain verbatim. Older events are summarized in progressively coarser tiers, while the original trajectory stays addressable. This is context compaction: preserve enough recent detail for the next decision without resending every token from the agent's lifetime.
Developers comparing runtimes should also read our DeepSeek Harness setup and production limits. DeepSeek Harness focuses on a plugin-based agent runtime. Headlong answers a different query: how to keep one thought stream alive and observable across time.
The background cost is part of the architecture
Headlong estimates background thinking at about $1 to $2 per hour with its documented GLM or Grok settings. If an agent sustained that rate around the clock, the arithmetic is $24 to $48 per day, or roughly $720 to $1,440 over a 30-day month.
That is a derived range, not a guaranteed bill. Provider pricing, prompt size, model choice, backoff behavior, and actual activity will change it. A growing trajectory may also make later calls more expensive even when compaction keeps the prompt bounded.
This cost model is different from a reactive agent billed only when a user asks for work. The right unit is not cost per chat. It is cost per useful unattended outcome.
Before a longer run, record model spend per hour, wake cycles with no action, accepted changes, and operator interventions. If the agent spends all night restating its plan, persistence is not creating value.
We would start with an eight-hour cap and one measurable task. Examples include triaging a constrained issue queue, maintaining a benchmark against new commits, or investigating a reproducible performance regression. Stop the run automatically when the budget expires, even if the agent says it is close to a breakthrough.
One shared thought stream creates a privacy boundary
Headlong can connect several people through Slack, Telegram, and its own chat interface. They all communicate with one mind. There are no hard per-user sessions in the current design.
That is useful for a small research group that wants a shared collaborator with continuous context. It is a blocker for confidential, multi-tenant, or role-separated workflows. A message from one participant can affect later behavior for everyone, and the project's launch notes warn users to assume shared information is visible to the group.
Do not place customer records, private credentials, unreleased financial data, or HR material in that stream. Channel permissions are not equivalent to memory isolation. If two audiences must not see or influence each other's data, run separate agents with separate stores, keys, containers, and identities.
Why self-improvement needs a narrow boundary
Laude reports that Headlong agents contributed more than 50 commits that were pulled back into the main project. The launch post also describes an agent accidentally killing its own service three times, followed by a guard and a later fix to that guard.
These examples show both sides of persistent agency. The process can inspect and improve the system that runs it. It can also damage that system while acting on a locally reasonable idea.
We would not let the agent push directly to a protected branch. Give it a disposable worktree, require tests, and make every proposed change reviewable. Keep the runtime's own files read-only unless the experiment is specifically about self-modification.
Headlong is alpha research software. The team does not claim a strong quantitative evaluation proving that persistent thought outperforms well-designed reactive agents. The evidence is currently qualitative and based on observed behavior. That is enough to justify an experiment, not a production dependency.
When Headlong is worth using
Headlong is a strong fit when the research question is itself about persistent agency. Use it for an internal experiment on a dedicated machine or container where the task has a clear verifier. A benchmark, test suite, or finite issue queue is better than an open instruction to improve the company.
It is not worth using for a scheduled script that can be expressed with a cron job, a queue worker, or a deterministic state machine. Those systems are cheaper and easier to reason about. It is also the wrong default for customer-facing automation, confidential team chat, or any workflow that needs strict tenant isolation.
Our position is simple: persistent agents should earn the right to persist. First measure whether thinking between messages produces accepted work. Then decide whether the added shell access, memory lifecycle, and continuous cost are justified.
FAQ
Is the Headlong microharness a new AI model?
No. Headlong is an agent runtime that connects to an existing model through Anthropic, OpenAI, Gemini, or OpenRouter. It manages the continuing thought loop, Bash tools, trajectory, context compaction, and messaging interfaces. Model quality and token prices still depend on the provider and model you configure.
How much does a Headlong persistent agent cost?
Headlong estimates about $1 to $2 per hour for background thinking with its documented GLM or Grok settings. That can imply $720 to $1,440 for 30 continuous days, but the actual bill depends on activity, context size, backoff, provider pricing, and the model selected.
Is Headlong safe to run on a developer laptop?
We would not give it unrestricted laptop access. Headlong executes real Bash commands and remains active between messages. Use a Docker container or dedicated virtual machine, mount only a disposable workspace, exclude credentials and host sockets, cap model spending, and keep a reliable external stop mechanism.
Build a bounded persistent-agent pilot
Headlong makes persistent agency concrete enough to inspect. The production decision lives around its small Bash core: isolation, spending controls, memory boundaries, and validation.
We build AI agents, generative AI applications, and full-stack SaaS products with those operating controls in place. If you want to test whether a continuous agent can improve a real engineering workflow without creating an uncontrolled process, book a call with Axentia. We can define the verifier, contain the runtime, and measure the outcome before persistence becomes infrastructure.
