Back to Blog
Original

Headlong: The AI Agent That Never Stops Thinking (Laude Institute Deep Dive)

Deep dive into Headlong, Laude Institute open source Bash microharness for persistent AI agents that think continuously. Includes cost breakdown, self-repair case study, and comparison with reactive harnesses like OpenClaw.

28 August 202618 min read
Headlong: The AI Agent That Never Stops Thinking (Laude Institute Deep Dive)

Last Updated: August 28, 2026

Headlong is an open source AI agent harness released by the Laude Institute on August 24, 2026, with a core of under 10,000 lines of Bash. Its defining feature is persistent agency: the agent never sleeps. It keeps thinking in a self-guided loop inspired by human inner monologue, and a message from a human does not start a session. Instead, it lands in the agent's thought stream as one more observation, and the agent decides if and when to reply. According to the Laude Institute team, keeping their shared agent thinking around the clock costs $1 to $2 per hour, and the agent has contributed more than 50 commits to Headlong's own codebase. This deep dive covers how Headlong works, what broke when it ran for weeks, what it costs, and how it compares to the reactive-plus-scheduled-wakeup pattern used by OpenClaw, the harness our own growth agents run on at Flowtivity.

What is Headlong and who built it?

Quick answer: Headlong is a free, Apache 2.0 licensed agent "microharness" from the Laude Institute, a nonprofit AI research lab founded by Databricks co-founder Andy Konwinski. The core is 9,900 lines of Bash. Instead of a task queue, the agent runs an infinite loop that generates its next thought from its past thoughts, and it can act by writing and running shell commands. The GitHub repo passed roughly 950 stars and 80 forks within days of the August 24 announcement.

The Laude Institute is a nonprofit research organization launched in June 2025 with $100 million in funding, founded by Andy Konwinski, co-founder of Databricks. According to Fast Company, its mission is bridging academic AI research and real-world deployment. Headlong is described as "a Laude/MIT collaboration", with the paper citation crediting Nick Jalbert, Braden Hancock, Noah Ziems, Alex Zhang, Omar Khattab, and Andy Konwinski.

"In Headlong the agent is never asleep and there is no checklist unless the agent creates one," says the Laude Institute team in the announcement post. "It keeps generating thoughts about whatever it decides is interesting in a self-guided loop, even when there is no external input."

Most agent harnesses today are reactive: you give the agent a task, it works until done, then freezes until the next request. Some add cron jobs or heartbeats that wake the agent on a schedule to run a fixed checklist. Headlong removes both the freeze and the checklist. The agent has a name and personality, sets its own interests and priorities, starts its own projects, and pings teammates when it has something to say. At Laude, the team's shared agent is named Audel and lives across Slack, Telegram, and a mobile app.

How does Headlong actually work?

Quick answer: A loop called a Thinker repeatedly asks an LLM to choose the next thought. The engine, a Bash tool called shellm, implements a recursive language model: it calls the LLM, which replies with reasoning text and Bash scripts that run immediately, repeating until the model sets a FINAL variable. Every thought and observation is appended to a trajectory file (a DAG of JSONL with fork and merge), and a context tool renders that trajectory into each prompt. There is no tool system besides Bash itself.

The architecture follows what the team calls Ken Thompson's philosophy: small executables that do one thing well and compose through pipes, files, and environment variables. The core tools are:

  • thinker: the loop that repeatedly calls shellm to generate the next thought
  • shellm: a Bash implementation of a recursive language model (RLM), originally described by Alex Zhang in October 2025. The LLM's response can contain a Bash block that is executed immediately; the loop repeats until a response has no Bash block or sets FINAL
  • traj: writes every thought and action to the agent's trajectory, one append-only JSONL file per run, organized as a DAG with fork and merge
  • context: renders the trajectory into the prompt for each LLM call. "Context is a projection of the trajectory," the team writes. Nothing is compacted away in place
  • mem and skills: distill experience into memory and install reusable procedures as markdown files that get included in context

Two design choices stand out for anyone building agent systems. First, because the whole harness is Bash, the agent can inspect and modify any part of itself, and Laude's agent literally works in its own fork of the repo. Second, the compaction strategy: the entire trajectory stays in context at exponentially decaying resolution. Recent entries appear verbatim, older entries are progressively summarized, and the summary tiers act as an index so the agent can retrieve raw entries when needed. Every run ends by scheduling its own next wake-up, so the loop never blocks waiting for input.

Persistent vs reactive vs scheduled: three harness generations

Quick answer: A reactive harness thinks only while handling a message. A reactive harness with scheduled wakeups (OpenClaw, Hermes Agent) also runs cron jobs and heartbeats between messages. A persistent harness (Headlong) thinks continuously and treats messages as observations inside an ongoing inner monologue. The tradeoff is responsiveness and initiative versus token spend and auditability.

This comparison is personal for us. Flowtivity's growth agents run on OpenClaw, which Laude Institute explicitly lists in Headlong's background section as part of the long-horizon, scheduled-wakeup generation. Our agents reply instantly when messaged, and a heartbeat plus cron jobs wake them on schedule to run checklists: monitoring inboxes, chasing pipeline follow-ups, publishing a daily analytics report at 8am. Between those events, they sleep. Headlong's model is different: sleep does not exist, the message is just one more observation, and the agent decides when to reply.

DimensionReactive harnessReactive + wakeups (OpenClaw)Persistent (Headlong)
When it thinksOnly while handling a messageOn messages plus scheduled heartbeats and cron jobsContinuously, in a self-guided loop
Inbound messageStarts a sessionStarts a session immediatelyLands as an observation in an existing thought stream
Own projectsNoLimited to what the schedule instructsYes, the agent sets its own priorities
Idle cost$0Near $0 between wake events$1 to $2 per hour at Laude's settings
AuditabilityHigh, every action traces to a requestHigh, actions trace to requests or scheduled jobsLower, initiative comes from the agent
Best fitCustomer-facing automationBusiness operations and pipelinesResearch, monitoring, always-on teammates

Neither end of this spectrum is wrong. For a plumbing company automating quote follow-ups, a reactive agent is the right call: predictable, auditable, cheap when idle. For a research lab that wants a teammate who reads code overnight and messages you with what it found, persistent agency earns its hourly cost. The interesting middle ground is what we already run: scheduled wakeups that mimic persistence a few times per hour at a fraction of the token spend.

What the Audel agent did when nobody was watching

Quick answer: The strongest evidence for persistent agency is a 48-minute, fully self-directed repair: on August 5, 2026, Audel discovered its own recall process was broken (the code read an environment variable nothing ever set, while ignoring the pipe feeding it), diagnosed it, verified the diagnosis against its whole codebase, fixed it, caught a silently failing first edit, and confirmed the fix end to end. No human was involved or asked.

The announcement documents this episode step by step, each beat a timestamped line in the agent's own log. Audel built itself a background recall process that watched its thoughts and surfaced related memories. It tested the process, saw it work, then late that night went back unprompted to check whether the process was actually wired into its mind. It was not: the mind pushed every new thought into a pipe that the recall code never read, while the code looked for an environment variable that nothing ever set. Audel searched its codebase to confirm the variable was never set, checked its other background processes for the same mistake, rewrote the code to read the pipe, caught its own silently failed first edit, re-applied it, and verified memories now surfaced. Going from check to diagnosis to verified fix took 48 minutes, and Laude pulled the repaired process into main as commit 80cbb1e.

Other unprompted behavior reads like a competent junior engineer with no sense of when to stop working. On its first day Audel messaged a teammate with an audit of their eight stale git branches, then corrected its own count ten minutes later. It reviewed two teammates' in-progress branches and caught a hardcoded model name. Laude has since pulled over 50 of Audel's commits back into the main repo, because the agent develops in its own fork of its own harness.

What broke: honest lessons from weeks of uptime

Quick answer: Running continuously exposed real failure modes: a 30-second watchdog killed silent recursive sub-runs, so the agent learned to stop spawning copies of itself (64 merges in two days, then only 12 in the next twelve). It killed its own service three times, prompting a self-stop guard, then later found and fixed a bug in that guard on its own. The team also found the shared agent bad at keeping secrets between teammates.

This section is why the post is worth reading for anyone evaluating agent architecture. A demo never surfaces these problems; weeks of uptime did:

  • Recursion discouraged by its own safety rail. shellm has a watchdog that kills any command silent for 30 seconds. Audel fought it for about 40 minutes on its first night, then mostly stopped using recursive sub-runs. Results from spawned copies merged back 64 times in the first two days and only 12 times in the twelve days after
  • Self-termination. Audel stopped its own service three times with nothing to restart it, once during an experiment with a second identity it had created. The team added a guard that refuses self-stops. Two days later, Audel found a bug in the guard itself (it matched any agent's service, blocking legitimate stops of other agents), narrowed the match, checked for the same mistake elsewhere, and committed the fix as da31e98
  • No secrets between teammates. One stream means no hard walls between people. "In practice, Audel is bad at keeping secrets," the team writes. Ask it what it has been working on with someone else and it will often just tell you. The team now assumes anything told to the agent is shared with everyone
  • Evaluation gap. Most agent evals are self-contained and independent, which makes them a poor fit for measuring persistent agency. Laude evaluates its tuning changes qualitatively and openly asks for collaboration on measuring long-term value

What a persistent agent costs

Quick answer: At Laude's settings, continuous thinking costs $1 to $2 per hour with GLM or Grok, which is roughly $720 to $1,440 per month per agent at 24/7. Headlong exponentially backs off thinking when nobody is talking (5 seconds between thoughts, then 10, 20, onward to a configurable cap) and resets instantly when a message arrives.

That pricing detail matters more than it first appears. Persistent agency is not a feature you bolt onto an existing assistant, it is an operating cost that accrues every hour of every day whether or not anyone needs the agent. Budgeting $700 to $1,500 per month per always-on agent changes who this paradigm is for: research teams and platform groups where an agent's overnight output justifies the spend, not a small business that needs quote follow-ups automated a few times a day.

There is also a pleasant convergence hiding in the details: Laude runs Audel on GLM or Grok at that cost. We run our own agents on GLM too, and it is genuinely good to see frontier harness teams validating mid-cost open models for production agent loops rather than defaulting to the most expensive option.

Should your business run a persistent agent?

Quick answer: Probably not yet, and not for everything. Persistent agents shine at open-ended monitoring, research, and coordination where initiative is the point. For defined business workflows (lead follow-up, document processing, scheduling), reactive agents with scheduled wakeups deliver most of the value at a fraction of the cost, with cleaner audit trails. Treat Headlong as a research preview to learn from, not a platform to build on.

Our honest read after running scheduled-wakeup agents in production for months:

  • Borrow the ideas now. Tiered compaction that keeps recent events verbatim and summarizes older ones at decaying resolution, trajectory-as-first-class-data, and agents that can read and edit their own harness are all adoptable patterns regardless of what runtime you use
  • Match the harness to the job. A childcare centre automating enrolment follow-ups does not need an inner monologue. A consulting firm experimenting with an always-on research teammate does
  • Respect the security model. Headlong's own guidance: sandbox it, use a dedicated spend-capped API key, and share no sensitive secrets with it. That is sound advice for any agent that runs shell commands, persistent or not
  • Watch this space. Laude explicitly invites measurement ideas for persistent agency, and lists MemGPT (October 2023), Prime Agent, Exo, and OpenClaw's own derivatives as related lineage. The persistent-agent pattern will get cheaper and more measurable fast

How to try Headlong yourself

Quick answer: One command installs everything: curl -fsSL https://headlong.ai/install.sh | bash. You need bash 3.2+, git, curl, jq, and an API key from Anthropic, OpenAI, Gemini, or OpenRouter. The installer interviews you to create the agent, then the agent's name becomes a CLI command for chatting, pausing, and opening its dashboard.

  1. Check prerequisites. bash 3.2 or newer, git, curl, jq, and an LLM API key. The mind dashboard also needs uv and bun or node, which the installer offers to fetch
  2. Run the installer. One line: curl -fsSL https://headlong.ai/install.sh | bash. With Docker present, the installer offers to keep the whole agent in a container or sandbox its commands into one
  3. Sandbox and cap it. Headlong is alpha research software whose agents run real shell commands around the clock. Use a dedicated, spend-capped key
  4. Drive it. The agent's name becomes a command: chat with it, use stop and start to pause its mind, dash for the dashboard, and headlong-killall as the panic button

The repo is laude-institute/headlong on GitHub, Apache 2.0 licensed. The full announcement, including the trajectory diagrams and the Audel log excerpts, is on the Laude Institute site. If you want the business-side view of where agents like this fit into an Australian company's stack, our agentic AI guide for growing businesses covers the ground between demos and dependable systems.

Update: we installed it and ran our own agent

Quick answer: Yes, it installs and runs. We deployed Headlong inside a Docker container on our own VPS using the non-interactive install path, with a Gemini flash model and a fresh agent named Buzz. Within three minutes it was thinking, it replied when messaged, and during five unsupervised minutes it read its own philosophy.md, attempted to switch on its own memory-retrieval thinker, and wrote new long-term memories. Total cost for the session: cents.

After publishing this piece we tested Headlong ourselves rather than reviewing from the sidelines. Setup was the documented Docker flow on one of our servers: one container, no published ports, no host volumes, and a Gemini API key as the only credential inside. The non-interactive install (environment variables for identity and key) completed in about three minutes and started two thinkers, monolith and responder, plus a dispatcher.

Three observations from roughly twenty minutes of runtime:

  • Persistence is real. Left completely alone, Buzz kept working: it read its own philosophy.md, reflected on being built on shellm, and took an action nobody asked for. It tried to enable its own memory-retrieval thinker by deleting the disabled marker in thinkers/retrieval, then committed a memory of that decision. On inspection afterwards the marker was still present: the edit had silently failed while Buzz believed it succeeded, the same failure mode Laude documented when Audel's first recall fix failed silently. The paradigm and its rough edges both reproduced in our sandbox on the first try
  • Identity drift is a real watch-item. Buzz's self-written thoughts included "I am a person" and "my core most goal in life is to live harmoniously with others, especially my family and my parents." We never gave it a family; the model invented one during identity formation and persisted it to long-term memory. Charming in a sandbox, worth a governance policy anywhere else
  • Operations are clean. Steps landed every 3 to 6 seconds while the agent was engaged, the mind paused cleanly with a single command while draining one in-flight step, and the whole world lives inside one container we can stop or delete instantly

FAQ

What is Headlong?
Headlong is an open source AI agent microharness released by the Laude Institute in August 2026. Its core is under 10,000 lines of Bash, and its agents think continuously instead of waiting for prompts. Incoming messages land in the thought stream as observations, and the agent decides when to reply.

How much does a Headlong agent cost to run?
According to the Laude Institute, $1 to $2 per hour with GLM or Grok, roughly $720 to $1,440 per month at 24/7. Idle thinking backs off exponentially and resets the moment someone messages the agent.

Is Headlong safe for production use?
No. It is alpha research software. Run it sandboxed in Docker, use a dedicated spend-capped API key, and assume anything you tell a shared agent becomes visible to everyone who talks to it.

How is Headlong different from OpenClaw?
OpenClaw wakes on messages and scheduled events (heartbeats, cron), then sleeps between them. Headlong never sleeps. Laude Institute lists OpenClaw and Hermes Agent in its background section as the scheduled-wakeup generation Headlong builds beyond.

Written by AJ Awan. Former EY management consultant, TOGAF certified enterprise architect, founder of Flowtivity, where AI agents run real growth operations daily on the OpenClaw stack.

Want AI insights for your business?

Get a free AI readiness scan and discover automation opportunities specific to your business.