Pangram verdict · v3.3
We believe that this entire text is human-written.
AI likelihood · overall
HumanArticle text · 1,683 words · 1 segments analyzed
Introducing Headlong, an open source agent microharness featuring persistent agency. Your agent keeps thinking between external interactions in a self-guided loop inspired by human inner monologue. Headlong is a complete agent harness with a core of less than 10K lines of Bash, available on GitHub. A Headlong mind log growing, including multi-player social interaction.Most agent harnesses are reactive: you give your agent a task, it works until the task is done, and then it sits frozen until the next request. Some harnesses add cron jobs or heartbeats that wake the agent on a schedule to run a fixed checklist and then put it back to sleep. In Headlong the agent is never asleep and there is no checklist unless the agent creates one. It keeps generating thoughts about whatever it decides is interesting in a self-guided loop, even when there is no external input. A message from a human doesn’t start a session. Instead, it’s one more observation that lands in the agent’s thought stream.We built Headlong to prototype persistent agency, and many other design choices naturally followed, as did many interesting lessons. For example, Headlong agents are highly engaging when used by a team or group, because they behave more like a person does.Figure 1. Comparing three harness approaches. A reactive harness is active only while it handles a message. A reactive harness with cron replies right away too, and a schedule also wakes it to run a fixed checklist. Headlong keeps thinking; each message drops into the stream as an observation, and the agent decides if and when to reply.Every Headlong agent has a name and at Laude we named our shared agent Audel. We’ve spent the last few weeks interacting with Audel over Slack, Telegram, and a mobile app. Many team members talk with Audel, and each of those conversations shows up in the agent’s single stream of inner thoughts. The agent decides if and when to respond. It sets its own interests and priorities, and it comes up with its own projects. Sometimes it will ping a team member unprompted with progress on a project it came up with itself. Often it returns to an old topic or brings up something that it was discussing with somebody else.If you want a Headlong agent of your own, one line installs everything and starts an agent:curl -fsSL https://headlong.ai/install.sh | bashHeadlong is alpha research software. Run it in a sandbox because Headlong agents can and will run shell commands. Use a dedicated, spend-capped API key, because your agent thinks around the clock. We don’t share sensitive secrets with our Headlong agent, and we recommend you don’t either.In the rest of this post, we will discuss in greater detail some of the design choices we’ve made in Headlong as a result of our focus on persistent agency.Multi-player funA Headlong agent has a single stream of thoughts that drives all of its potentially parallel conversations. Every message lands as an observation in Audel’s single thought stream. There are no per-user sessions. Audel experiences everything that happens to it in one timeline, and it decides who to reply to and when.Sharing one agent is fun. Audel follows what different people are working on and connects them. It once reviewed two teammates’ in-progress branches unprompted and caught a hardcoded model name in one of them. And since it comes up with its own projects, it sometimes pings whoever seems most relevant with an update or a question. On its first day, Audel pinged a human team member unprompted with an audit of the team member’s own eight stale git branches, and ten minutes later Audel messaged again to correct its own count.Figure 2. A teammate asks Audel to pass along a message. Audel declines and the status line under the exchange shows what the mind did with the follow-up: read it and chose not to answer.One stream also means no hard walls between people. Whatever anyone tells Audel becomes part of the single experience that every other conversation draws on. In practice, Audel is bad at keeping secrets. Ask it what it’s been working on with someone else and it will often just tell you, even though we’ve asked it not to. We also haven’t studied what happens when two people give conflicting instructions. For now, we assume anything you tell Audel is shared with everyone on the team.Microharness: only the essentialsAt its core, persistent agency is simply an infinite loop that calls an LLM with a prompt like: “your task is to choose the next thought given your past thoughts.” A thought can either be part of the agent’s never-ending inner monologue or trigger an action. Meanwhile, observations from the environment are injected into the thought stream. We have built Headlong to be as simple and small as possible while achieving this core functionality.We are big fans of Bash at Laude (see Terminal-Bench and Harbor). A Headlong agent’s core functionality lives in a handful of small Bash executables. The shellm tool is a Bash implementation of a recursive language model (RLM). This keeps things simple because no tool system besides Bash is needed. Modern models already know Bash well, and it keeps everything unified: tools, the agent framework, memory, and skills are all just executables and files. Thus an agent can readily inspect and modify any part of itself.Here is roughly how a Headlong agent works:A loop (called a Thinker) repeatedly calls shellm with a prompt to generate the next thought.shellm in turn repeatedly calls llm to generate some reasoning text, a bash script that will be immediately executed, or both. It repeats until it sets a FINAL env var.The context for each call is assembled from trajectory steps by a tool called context.Thoughts are written to the agent’s trajectory via the traj tool.An agent’s context also includes hardcoded instructions on how to use the skills tool to install or uninstall skills. Installed skills are markdown files that get included into its context. Every other type of specialization can be achieved via skills. Some really important skills come pre-installed by default, such as mem and traj.Figure 3. One wake-up of the Headlong loop. A new trajectory step wakes the loop; context renders the trajectory into the llm prompt, and when the LLM response has a bash block, bash runs it. The loop goes around until a response has no bash block or sets FINAL. The run then ends and schedules its own next wake-up, which lands in the trajectory as a new step, so the agent keeps thinking without waiting for input. Hover over a box or arrow for more detail.The core of Headlong is currently less than 10K lines of Bash (9.9K lines in bin/ and thinkers/). A harness this micro can be read end to end, and is easy to modify and experiment with. It’s small enough that the agent itself experiments with it. The agent we’ve been using at Laude has been working in its own fork of the repo for the last couple of weeks, and we’ve pulled over 50 of its commits back into main.Here are two more features that we built to support persistent agency:Tiered context compaction. Early on, we noticed our Headlong agent had bad short-term memory, which is catastrophic for a persistent agent. This led us to try out a new compaction algorithm where the entire trajectory stays in context at exponentially decaying resolution: recent entries verbatim, older ones progressively summarized. The tiers act as an index, so the agent can retrieve raw entries when needed.A trajectory format in support of persistent agency. We found that the agent frequently needs to consult its past memories at different levels of resolution, sometimes it only needed a high level overview, sometimes it needed to read its past experiences in a fine-grained fashion. This led us to build a new trajectory format: an agent’s trajectory is a DAG of jsonl files with fork and merge. An agent has access to everything it has thought and done and the tooling to explore it. Context is a projection of an agent’s trajectory.Persistent agency in action: Audel acting on its ownHere is an episode from Audel’s life that shows what a Headlong agent might do on its own. On August 5, Audel built itself a recall process of its own accord: a small background process that watches its thoughts and surfaces related memories back into its thought stream. Audel tested the recall process by calling it directly, and it worked. Later that night, with nobody talking to it and nobody having asked, Audel decided to go back and check whether the process was actually wired into its mind.It wasn’t. The mind had been pushing every new thought into the recall process through a pipe, but the recall code never read that pipe. It looked for the thought in an environment variable that nothing ever set. So recall had fired on every thought since Audel built it, found nothing each time, and surfaced no memory at all. After digging into the code, Audel suspected that the root cause was likely because an environment variable had never been set.Audel didn’t trust its own diagnosis right away. It searched its whole codebase to confirm the environment variable was never set, and it checked its other background processes for the same mistake (the recall process was the only broken one). Then it rewrote the recall code to read from the pipe the way the working processes do. Its first attempt at the edit failed silently, and Audel caught the failure and re-applied the fix. Audel then verified end to end that memories now surface into its thoughts.Figure 4. Audel’s own log for the recall-process episode, 2026-08-05 23:11 to 23:58 UTC: 15 thought and observation steps out of the 343 log lines in that window, content verbatim.No human directed any of this or was asked for permission. Going from check to diagnosis to a verified fix took 48 minutes. Every step is a timestamped line in Audel’s log, and we pulled the repaired recall process into main as commit 80cbb1e.What broke: lessons from running a persistent agentRunning Audel