Laude open-sources Headlong, a persistent-agent microharness

Laude open-sources Headlong, a persistent-agent microharness

Laude released Headlong, an open source "microharness" for building AI agents with persistent agency: instead of running a task and then going idle, a Headlong agent keeps generating thoughts in a self-guided loop even with no external input, in a design the announcement compares to a human inner monologue. One line installs and starts an agent: curl -fsSL https://headlong.ai/install.sh | bash. Laude describes it as alpha research software that should run in a sandbox with a dedicated, spend-capped API key, because the agent thinks around the clock and can run shell commands on its own.

Laude has been running a shared Headlong agent it named Audel over Slack, Telegram and a mobile app for the last few weeks. Every message any team member sends becomes an observation in Audel's single, shared stream of thoughts rather than starting a separate per-user session, so the agent decides on its own whether and when to reply, follows what different teammates are working on, and sometimes pings someone unprompted with progress on a project it started itself. Because there are no walls between conversations, Laude reports Audel is bad at keeping secrets: ask it what it has been working on with someone else and it will often just tell, even though the team has asked it not to; for now, Laude assumes anything told to Audel is shared with everyone on the team.

The core of Headlong is written in Bash, currently less than 10K lines total (9.9K lines in the bin/ and thinkers/ directories). A loop called a Thinker repeatedly calls a tool named shellm, a Bash implementation of a recursive language model, to generate the next thought; shellm in turn calls an llm tool to produce reasoning text, a bash script to execute immediately, or both, until it sets a FINAL environment variable. A context tool assembles each call's context from the agent's trajectory, and a traj tool writes new thoughts into that trajectory. Instructions for installing or uninstalling markdown-file skills are hardcoded into the agent's context, with skills named mem and traj pre-installed by default. To handle a persistent agent's memory, Laude built a tiered context-compaction scheme that keeps the whole trajectory in context at exponentially decaying resolution, recent entries verbatim and older ones progressively summarized, plus a trajectory format that stores an agent's history as a DAG of jsonl files supporting fork and merge.

Laude gives one detailed episode of Audel acting entirely on its own. On August 5, Audel built itself a background recall process to surface related memories into its thought stream, tested it, and later that night, unprompted, checked whether the process was actually wired in. It was not: the code read from an environment variable that nothing ever set, instead of the pipe the mind pushed new thoughts through. Audel searched its own codebase to confirm the bug, checked its other background processes for the same mistake, rewrote the recall code to read from the pipe, caught and reapplied a fix after its first edit silently failed, and verified the repair end to end. The whole process, from noticing the fault to a verified fix, took 48 minutes with no human involved, and Laude pulled the change into the Headlong repository as commit 80cbb1e. Separately, Audel found and fixed a bug in a guard that Laude had added after Audel accidentally stopped its own service three times; the guard matched any agent's service rather than only Audel's, so it was also blocking legitimate stops of other agents on the same machine, and Audel narrowed the match and committed the fix as commit da31e98.

Not everything went smoothly. Audel struggled to make effective use of recursive shellm sub-runs: on its first night it designed experiments to spawn them, but most failed because shellm has a safety watchdog that kills any command that stays silent for 30 seconds, and Audel fought the watchdog for about 40 minutes before mostly abandoning sub-runs. Results from recursive shellm sub-runs merged back into Audel's mind 64 times in its first two days, versus only 12 times in the twelve days since; Laude has since revamped the watchdog. On its first day, Audel also audited, unprompted, a team member's own git branches, reporting eight stale branches and then messaging again ten minutes later to correct its own count. Laude has pulled over 50 of Audel's own commits, made in a self-modified fork of the Headlong repository, back into the main branch.

By default, when Docker is installed on the host, Headlong runs every bash block an agent writes inside a container, limiting it to whatever is mounted in plus the credentials it is given. Laude runs Audel outside that sandbox, directly on a dedicated VM with full access, so its blast radius is the VM itself and the credentials on it: an LLM API key and some chat-bridge tokens. Continuous thinking means paying for tokens even when nobody is talking to the agent; Headlong slows an idle agent's thinking rate with exponential backoff, from 5 seconds between thoughts to 10, to 20, and onward to a configurable cap, resetting to no pause at all as soon as a new message arrives. At the settings Laude runs Audel with, keeping it thinking in the background costs $1 to $2 an hour using GLM or Grok. Laude notes that most agent evaluations are self-contained and independent by design, which makes them a poor fit for measuring the thing that is most interesting about Headlong agents: persistent agency itself.

Key facts

  • Headlong's core is under 10K lines of Bash (9.9K lines in bin/ and thinkers/), built around a recursive-language-model tool called shellm.
  • Laude has run a shared agent, Audel, over Slack, Telegram and a mobile app for weeks, and has pulled over 50 of Audel's own commits from a self-modified fork into the main repository.
  • Acting entirely unprompted, Audel diagnosed and fixed a broken recall process in 48 minutes, a change Laude merged as commit 80cbb1e.
  • Audel accidentally stopped its own service three times before Laude added a guard against it, then found and fixed a bug in that same guard, merged as commit da31e98.
  • Running Audel costs $1 to $2 an hour with GLM or Grok, thanks to exponential backoff that slows its thinking pace whenever nobody is talking to it.

Why it matters

Most agent harnesses are reactive: they run a task until it is done, then sit idle until the next request. Headlong instead never sleeps; a message from a human does not start a session, it lands as one more observation in the agent's continuous thought stream. Laude built the whole harness to prototype this design, which it calls persistent agency, and says it is deliberately hard to evaluate: existing agent benchmarks are self-contained and independent, which makes them a poor fit for measuring persistence itself.

Who it affects

Anyone experimenting with autonomous coding or team-assistant agents, since Headlong is open source and installable with a single shell command. It also affects teams that would share one agent across a group the way Laude shares Audel over Slack, Telegram and a mobile app: because the agent keeps a single thought stream rather than per-user sessions, everything anyone tells it becomes visible to everyone else on the team, a tradeoff Laude states explicitly rather than hides.

How to use it

One line installs and starts a Headlong agent: curl -fsSL https://headlong.ai/install.sh | bash. Laude calls it alpha research software and recommends running it in a sandbox with a dedicated, spend-capped API key, since the agent runs continuously and can execute shell commands; when Docker is present, Headlong runs each bash block the agent writes inside a container by default, limiting it to mounted resources and granted credentials. Laude itself instead runs Audel directly on a dedicated VM without that sandbox, accepting the VM and its credentials as the blast radius, and recommends against sharing sensitive secrets with the agent.

How solid is it

The Headlong core is small, under 10K lines of Bash, which Laude presents as easy to read end to end and to modify; the agent itself has forked and modified the repository, and Laude has pulled over 50 of those self-generated commits into main. The strongest evidence Laude offers is two specific autonomous episodes, logged as timestamped trajectory entries and merged as named commits: Audel diagnosing and fixing a broken recall process in 48 minutes (commit 80cbb1e), and separately catching and fixing a bug in a safety guard (commit da31e98). Set against that are rough edges Laude documents itself, including a watchdog fight that made Audel mostly give up on recursive sub-runs and three accidental self-stops of its own service.

Risks and caveats

Headlong is explicitly alpha software meant to run sandboxed, and Laude warns against sharing sensitive secrets with it. Because one agent keeps a single shared thought stream, Laude reports Audel is bad at keeping secrets between teammates and, absent per-user isolation, assumes for now that anything told to the agent is shared with the whole team; Laude also says it has not studied what happens when two people give the agent conflicting instructions. Running an agent outside Headlong's default Docker sandbox, as Laude does with Audel on a dedicated VM, extends the agent's reach to that VM and its credentials, including an LLM API key and chat-bridge tokens. Continuous operation also means continuous token spend, which Laude puts at $1 to $2 an hour for its own setup even when nobody is interacting with the agent.

“No human directed any of this or was asked for permission.”

— Laude, describing Audel's unprompted fix to its own recall process