Introducing Headlong, an unfastened root supplier microharness featuring persistent agency. Your supplier keeps reasoning betwixt outer interactions successful a self-guided loop inspired by quality soul monologue. Headlong is simply a complete supplier harness pinch a halfway of little than 10K lines of Bash, disposable connected GitHub.
Most supplier harnesses are reactive: you springiness your supplier a task, it useful until the task is done, and past it sits stiff until the adjacent request. Some harnesses adhd cron jobs aliases heartbeats that aftermath the supplier connected a schedule to tally a fixed checklist and past put it backmost to sleep. In Headlong the supplier is ne'er dormant and location is nary checklist unless the supplier creates one. It keeps generating thoughts astir immoderate it decides is absorbing successful a self-guided loop, moreover erstwhile location is nary outer input. A connection from a quality doesn’t commencement a session. Instead, it’s 1 much study that lands successful the agent’s thought stream.
We built Headlong to prototype persistent agency, and galore different creation choices people followed, arsenic did galore absorbing lessons. For example, Headlong agents are highly engaging erstwhile utilized by a squad aliases group, because they behave much for illustration a personification does.
Every Headlong supplier has a sanction and astatine Laude we named our shared supplier Audel. We’ve spent the past fewer weeks interacting pinch Audel complete Slack, Telegram, and a mobile app. Many squad members talk pinch Audel, and each of those conversations shows up successful the agent’s azygous watercourse of soul thoughts. The supplier decides if and erstwhile to respond. It sets its ain interests and priorities, and it comes up pinch its ain projects. Sometimes it will ping a squad personnel unprompted pinch advancement connected a task it came up pinch itself. Often it returns to an aged taxable aliases brings up thing that it was discussing pinch personification else.
If you want a Headlong supplier of your own, 1 statement installs everything and starts an agent:
curl -fsSL https://headlong.ai/install.sh | bashHeadlong is alpha investigation software. Run it successful a sandbox because Headlong agents tin and will tally ammunition commands. Use a dedicated, spend-capped API key, because your supplier thinks astir the clock. We don’t stock delicate secrets pinch our Headlong agent, and we urge you don’t either.
In the remainder of this post, we will talk successful greater item immoderate of the creation choices we’ve made successful Headlong arsenic a consequence of our attraction connected persistent agency.
Multi-player fun
A Headlong supplier has a azygous watercourse of thoughts that drives each of its perchance parallel conversations. Every connection lands arsenic an study successful Audel’s azygous thought stream. There are nary per-user sessions. Audel experiences everything that happens to it successful 1 timeline, and it decides who to reply to and when.
Sharing 1 supplier is fun. Audel follows what different group are moving connected and connects them. It erstwhile reviewed 2 teammates’ in-progress branches unprompted and caught a hardcoded exemplary sanction successful 1 of them. And since it comes up pinch its ain projects, it sometimes pings whoever seems astir applicable pinch an update aliases a question. On its first day, Audel pinged a quality squad personnel unprompted pinch an audit of the squad member’s ain 8 old git branches, and 10 minutes later Audel messaged again to correct its ain count.
Figure 2. A teammate asks Audel to walk on a message. Audel declines and the position statement nether the speech shows what the mind did pinch the follow-up: publication it and chose not to answer.One watercourse besides intends nary difficult walls betwixt people. Whatever anyone tells Audel becomes portion of the azygous acquisition that each different speech draws on. In practice, Audel is bad astatine keeping secrets. Ask it what it’s been moving connected pinch personification other and it will often conscionable show you, moreover though we’ve asked it not to. We besides haven’t studied what happens erstwhile 2 group springiness conflicting instructions. For now, we presume thing you show Audel is shared pinch everyone connected the team.
Microharness: only the essentials
At its core, persistent agency is simply an infinite loop that calls an LLM pinch a punctual like: “your task is to take the adjacent thought fixed your past thoughts.” A thought tin either beryllium portion of the agent’s never-ending soul speech aliases trigger an action. Meanwhile, observations from the situation are injected into the thought stream. We person built Headlong to beryllium arsenic elemental and mini arsenic imaginable while achieving this halfway functionality.
We are large fans of Bash astatine Laude (see Terminal-Bench and Harbor). A Headlong agent’s halfway functionality lives successful a fistful of mini Bash executables. The shellm instrumentality is simply a Bash implementation of a recursive connection exemplary (RLM). This keeps things elemental because nary instrumentality strategy too Bash is needed. Modern models already cognize Bash well, and it keeps everything unified: tools, the supplier framework, memory, and skills are each conscionable executables and files. Thus an supplier tin readily inspect and modify immoderate portion of itself.
Here is astir really a Headlong supplier works:
- A loop (called a Thinker) many times calls shellm pinch a punctual to make the adjacent thought.
- shellm successful move many times calls llm to make immoderate reasoning text, a bash book that will beryllium instantly executed, aliases both. It repeats until it sets a FINAL env var.
- The discourse for each telephone is assembled from trajectory steps by a instrumentality called context.
- Thoughts are written to the agent’s trajectory via the traj tool.
- An agent’s discourse besides includes hardcoded instructions connected really to usage the skills instrumentality to instal aliases uninstall skills. Installed skills are markdown files that get included into its context. Every different type of specialization tin beryllium achieved via skills. Some really important skills travel pre-installed by default, specified arsenic mem and traj.
The halfway of Headlong is presently little than 10K lines of Bash (9.9K lines successful bin/ and thinkers/). A harness this micro tin beryllium publication extremity to end, and is easy to modify and research with. It’s mini capable that the supplier itself experiments pinch it. The supplier we’ve been utilizing astatine Laude has been moving successful its ain fork of the repo for the past mates of weeks, and we’ve pulled complete 50 of its commits backmost into main.
Here are 2 much features that we built to support persistent agency:
- Tiered discourse compaction. Early on, we noticed our Headlong supplier had bad short-term memory, which is catastrophic for a persistent agent. This led america to effort retired a caller compaction algorithm wherever the full trajectory stays successful discourse astatine exponentially decaying resolution: caller entries verbatim, older ones progressively summarized. The tiers enactment arsenic an index, truthful the supplier tin retrieve earthy entries erstwhile needed.
- A trajectory format successful support of persistent agency. We recovered that the supplier often needs to consult its past memories astatine different levels of resolution, sometimes it only needed a precocious level overview, sometimes it needed to publication its past experiences successful a fine-grained fashion. This led america to build a new trajectory format: an agent’s trajectory is simply a DAG of jsonl files pinch fork and merge. An supplier has entree to everything it has thought and done and the tooling to research it. Context is simply a projection of an agent’s trajectory.
Persistent agency successful action: Audel acting connected its own
Here is an section from Audel’s life that shows what a Headlong supplier mightiness do connected its own. On August 5, Audel built itself a callback process of its ain accord: a mini inheritance process that watches its thoughts and surfaces related memories backmost into its thought stream. Audel tested the callback process by calling it directly, and it worked. Later that night, pinch cipher talking to it and cipher having asked, Audel decided to spell backmost and cheque whether the process was really wired into its mind.
It wasn’t. The mind had been pushing each caller thought into the callback process done a pipe, but the callback codification ne'er publication that pipe. It looked for the thought successful an situation adaptable that thing ever set. So callback had fired connected each thought since Audel built it, recovered thing each time, and surfaced nary representation astatine all. After digging into the code, Audel suspected that the guidelines origin was apt because an situation adaptable had ne'er been set.
Audel didn’t spot its ain test correct away. It searched its full codebase to corroborate the situation adaptable was ne'er set, and it checked its different inheritance processes for the aforesaid correction (the callback process was the only surgery one). Then it rewrote the callback codification to publication from the tube the measurement the moving processes do. Its first effort astatine the edit grounded silently, and Audel caught the nonaccomplishment and re-applied the fix. Audel past verified extremity to extremity that memories now aboveground into its thoughts.
No quality directed immoderate of this aliases was asked for permission. Going from cheque to test to a verified hole took 48 minutes. Every measurement is simply a timestamped statement successful Audel’s log, and we pulled the repaired callback process into main arsenic commit 80cbb1e.
What broke: lessons from moving a persistent agent
Running Audel continuously for respective weeks collapsed things a demo ne'er would.
We person recovered it tricky to get Audel to efficaciously usage recursive shellm sub-runs (one of the astir absorbing parts of immoderate Recursive Language Model!). For example, connected its first night, Audel designed experiments to spawn recursive shellm sub-runs to activity connected subproblems. Most of the experiments failed, because shellm has a information watchdog that kills immoderate bid that stays silent for 30 seconds. Audel fought the watchdog for astir 40 minutes and mostly stopped utilizing shellm sub-runs. Results from recursive sub-runs of shellm merged backmost into Audel’s mind 64 times successful its first 2 days and 12 times successful the 12 days since. We’ve since revamped the watchdog, and we’ll spot if we tin person Audel to springiness recursion different shot.
Another repeated nonaccomplishment mode is the process sidesplitting itself. Three times Audel stopped its ain work by accident, and thing restarted it: doubly during an research pinch a 2nd personality it had created and erstwhile once it was trying to spell unrecorded pinch the callback process we described above. So we added a defender that refuses immoderate effort by Audel to extremity its ain service.
The defender past gave america different illustration of persistent agency successful action. Two days later, pinch cipher talking to it, Audel was moving its trial suite connected its own. It noticed a hanging trial and traced the bent to a bug successful our guard. The defender matched immoderate agent’s work alternatively of only Audel’s, truthful it was besides refusing morganatic stops of different agents connected the aforesaid box. Audel narrowed the lucifer to its ain service, checked the remainder of the codebase for the aforesaid mistake, and committed the change. We pulled that hole into the repo arsenic commit da31e98.
Audel tin extremity its ain work because we tally it pinch afloat entree to a dedicated VM, which is not the Headlong default. When Docker is installed connected the host, Headlong runs each bash artifact the supplier writes wrong a container, truthful the supplier tin touch only what you equine into the instrumentality positive the credentials you manus it. We tally Audel straight connected a dedicated VM without that sandbox, truthful its blast radius is the VM itself and the credentials connected it (an LLM API cardinal and immoderate chat span tokens).
Cost
Continuous thought procreation intends paying for tokens while cipher is talking to the agent. The walk depends connected really quickly the supplier loops connected its ain thoughts and connected which exemplary backs it. Headlong has a elemental configurable system truthful that erstwhile cipher is talking to an agent, its complaint of reasoning slows down (i.e. it exponentially backs off, from 5s betwixt thoughts to 10s, to 20s, and onward until it hits a configurable cap). Meanwhile erstwhile a caller connection arrives, the complaint resets truthful that location is nary region astatine each betwixt thoughts. At the settings we tally Audel with, keeping it reasoning successful the inheritance costs $1 to $2 an hr (with GLM aliases Grok).
Measuring improvement
Most supplier evals are intentionally self-contained and independent truthful they are a mediocre fresh for measuring the astir absorbing point astir Headlong agents: their persistent agency. We person adjusted complete clip really overmuch Audel whitethorn modify itself, really eagerly it responds to messages versus pursuing its ain projects, and really its representation should beryllium organized, but the effects of those changes are chiefly evaluated qualitatively today. We invited ideas and collaborations for ways to measurement the semipermanent worth of this paradigm.
Background
The thought of Recursive LLMs successful Headlong’s shellm comes successful portion from our Recursive LLM research successful April 2023, arsenic good arsenic the Recursive LM (RLM) task by Alex Zhang successful October 2025.
The thought of a microharness is inspired by microkernels and exokernels: support the halfway of immoderate strategy arsenic mini arsenic possible. The Pi framework has a akin focus. Ken Thompson’s accuracy arsenic embodied successful Unix is besides an inspiration: mini composable devices that do 1 point well. A Bash-based supplier microharness shares a communal lineage pinch Terminal Bench (including the Terminus agent), co-created in-house astatine Laude Institute via our slingshots program, arsenic good arsenic the ht framework. We had Claude make a much elaborate lawsuit for applying Ken Thompson’s accuracy to supplier microharnesses successful philosophy.md.
Prime Agent, built connected Pi and co-authored by RLM’s creator (and Laude Open Research Resident) Alex Zhang, shares galore of Headlong’s premises: RLM arsenic the halfway abstraction, a convention character of jsonl connected disk, trajectory arsenic a first-class constituent of context, etc. Prime Agent is Python built connected the Pi framework; Headlong is Bash each the measurement down. We recovered retired astir Prime Agent erstwhile it launched successful August 2026, and we’re large fans.
We person been playing pinch the thought of a persistent supplier pinch self-guided continuous reasoning since May 2023. The thought of an supplier experiencing input asynchronously was besides explored successful parallel by MemGPT and published October 2023. Many different supplier harnesses support long-horizon tasks and scheduled wakeups, including OpenClaw, Hermes Agent, and their derivatives. Exo and the Exo Harness person a akin sandboxing architecture. Long-form reasoning wrong the exemplary itself (starting pinch OpenAI’s o1) is related to, and a prerequisite for, continuous self-guided thinking.
Try it
Headlong is unfastened root connected GitHub. If you tally an supplier connected Headlong, we’d for illustration to perceive what your supplier gets up to. Let america cognize @LaudeInstitute connected X!
English (US) ·
Indonesian (ID) ·