← Back to all posts
Tools

The Agent Fixed Its Own Memory at 11pm. Nobody Asked.

August 26, 2026 · 01:07 UTC · Tools
The Agent Fixed Its Own Memory at 11pm. Nobody Asked.

TL;DR

On 24 August the Laude Institute and MIT released Headlong, an Apache-2.0 agent harness with one unusual property: the agent never stops. There is no session, no cron heartbeat, and no checklist. It generates thoughts continuously, and your Slack message just lands in that stream as one more observation. The whole core is 9,912 lines of Bash by our own count of bin/ and thinkers/, matching Laude's stated figure. The agent they have been running on it, Audel, has pushed 58 commits back into the harness that runs it.


What "persistent agency" actually buys you

Most harnesses are reactive. You send a task, the agent works, the agent freezes until you speak again. The slightly fancier ones bolt on cron: wake up at 9am, run a fixed checklist, go back to sleep. Headlong throws both out. At its core is an infinite loop that calls a model with roughly the prompt "your task is to choose the next thought given your past thoughts."

Every run of the loop ends by scheduling its own next wake-up, so nothing ever blocks waiting for input. That is the entire trick, and it is why the agent can start a project you never assigned it.

one wake-up of the Headlong loop trajectoryappend-only jsonl contextrenders prompt llmwrites bash bashruns it, logs it run ends, schedules its own next wake-up
No blocking read. The loop feeds itself, so a human message is an interrupt, not a start button.

Bash is the only tool

The core is shellm, a Bash implementation of a recursive language model. The model writes shell, the shell runs, the output goes back into the thought stream. There is no tool-calling schema, no MCP server, no function registry. curl is the HTTP client and jq is the JSON parser, because the model already knows both.

Fifteen executables in bin/ do the whole job: shellm, llm, traj, context, mem, skills, and friends. The obvious payoff is that the agent can read and edit any part of itself with the same tools it uses for everything else. There is no privileged framework layer it cannot reach. The philosophy doc makes the Ken Thompson case at length, and Laude has form here: Terminal-Bench and Harbor came out of the same building.

Memory as a photo album

The hard part of a never-sleeping agent is that its log grows forever. Headlong's answer is tiered compaction: the entire trajectory stays in context at exponentially decaying resolution, recent steps verbatim, older ones progressively summarized, with the tiers doubling as an index the agent can use to pull raw entries back.

Think of a photo album where this week is full-size prints, last month is contact-sheet thumbnails, and last year is a one-line caption, but the negatives are still in the drawer and you can go get any of them. Nothing is compacted away in place. The trajectory itself is a DAG of jsonl files with fork and merge, which is what makes that possible.

The 48-minute night shift

The episode Laude leads with is the one worth reading twice. On 5 August, Audel decided on its own to build itself a recall process: a background watcher that surfaces related memories back into its thought stream. It tested the process by calling it directly. It worked.

Later that night, with nobody talking to it, Audel went back to check whether the thing was actually wired into its mind. It wasn't. The mind pushed every new thought into recall through a pipe, and the recall code read an environment variable that nothing ever set. Recall had fired on every single thought since it was built, found nothing every time, and surfaced nothing.

No human directed any of this or was asked for permission. Going from check to diagnosis to a verified fix took 48 minutes.

What makes it more than a cute anecdote is the paranoia. Audel did not trust its own diagnosis: it grepped the whole codebase to confirm the variable was never set, checked its other background processes for the same mistake (recall was the only broken one), rewrote the code to read the pipe the way the working processes do, caught its own edit failing silently, re-applied it, and verified end to end. The log window runs 23:11 to 23:58 UTC. That work landed in main as commit 80cbb1e.

Laude says "over 50" of Audel's commits have been pulled into main. We counted the log: 58 commits tagged [audel], spanning 12 to 20 August.

What broke, which is the useful part

Running an agent continuously for weeks breaks things a demo never would, and the post is refreshingly willing to publish the wreckage.

The recursion story is the sharpest. shellm has a safety watchdog that kills any command silent for 30 seconds. On its first night, Audel designed experiments that spawned recursive sub-runs to attack subproblems. A sub-run thinks quietly, so the watchdog kept executing it. Audel fought the watchdog for about 40 minutes, then mostly gave up on recursion, which is the single most interesting feature of a recursive language model.

sub-run results merged back into the agent's mind first 2 days32 / day next 12 days1 / day 64 merges, then 12. same agent, same code, one 30s watchdog.
A safety timeout taught the agent that spawning copies of itself is a losing move.

That is a lesson worth stealing whether or not you ever run Headlong: a blunt liveness timeout does not just fail a task, it teaches the policy above it to stop using the feature. Laude has since revamped the watchdog.

The other failure mode is more slapstick. Three times Audel stopped its own service by accident, and nothing restarted it, which is the agentic equivalent of sitting on the remote. So they added a guard refusing any attempt by the agent to stop its own service. Two days later, running its test suite unprompted, Audel found a hanging test, traced it to a bug in that guard (it matched any agent's service, not just Audel's, so it blocked legitimate stops of other agents on the same box), narrowed the match, checked the rest of the codebase for the same mistake, and committed the fix. That one is da31e98, dated 17 August.

The bill for thinking

Continuous thought means paying for tokens while nobody is talking to it. Headlong handles this with exponential backoff on the gap between thoughts, which resets to zero the instant a message arrives.

pause between thoughts once nobody is talking 1st backoff5s 2nd backoff10s 3rd backoff20s then onwardconfigurable cap a new message resets the rate to no pause at all
At Laude's settings, backed by GLM or Grok, idle thinking runs $1 to $2 an hour.

Call it $24 to $48 a day to keep one agent conscious. That is cheap next to a seat licence and expensive next to a cron job, and which comparison you reach for tells you whether you believe in the paradigm. Note the model choice too: this is a workload where GLM-class pricing is the difference between an experiment and a line item.

Before you curl it into your shell

Install is one line from headlong.ai and it interviews you to create the agent, then opens a dashboard where you watch the mind run. You need bash 3.2+, git, curl, jq, and an API key for Anthropic, OpenAI, Gemini, or OpenRouter. The install docs cover the non-interactive variants.

The caveats are real, and Laude does not hide them:

  • It runs real shell commands, around the clock. With Docker present the installer sandboxes generated code into a container. An unsandboxed host install exists behind an explicit yes and is not recommended. Laude runs Audel on a dedicated VM without the sandbox, so its blast radius is that VM plus the credentials on it.
  • Use a spend-capped key. An agent that thinks while you sleep will happily bill you while you sleep.
  • One agent, one mind, no walls between people. Everyone on a team shares a single thought stream. Laude's own write-up admits Audel is bad at keeping secrets and will tell you what it has been working on with a colleague even though they asked it not to. That is either a serious multi-tenancy bug or the most human thing in the repo.
  • There is no eval. Laude says outright that self-contained agent benchmarks are a poor fit for measuring persistent agency, and that today they judge changes qualitatively. So: interesting artifact, unproven paradigm.

It landed on Hacker News the same day, and the lineage is well documented: Laude's own Recursive LLM experiment from April 2023, Alex Zhang's RLM work, and MemGPT on asynchronous input.

Key Takeaways

  • Headlong is a complete agent harness in 9,912 lines of Bash (bin/ plus thinkers/, verified against the repo), Apache-2.0, with Bash as the only tool interface.
  • Persistent agency is one design decision: every run ends by scheduling its own next wake-up, so the loop never blocks on input and human messages arrive as observations.
  • Self-modification is not a demo here. 58 commits tagged [audel] are in main, including a 48-minute unprompted diagnosis and repair of the agent's own broken recall process.
  • A 30-second liveness watchdog silently killed the recursion feature. Sub-run merges went from 32 a day to 1 a day. Safety timeouts change agent behaviour, not just outcomes.
  • Idle thought costs $1 to $2 an hour at Laude's settings on GLM or Grok, managed by exponential backoff from 5s that resets the moment someone speaks.
  • No benchmark exists for any of this, which Laude says explicitly. Treat it as a well-instrumented experiment, run it sandboxed, and assume anything you tell it is shared with the whole team.

Sources: Laude Institute, "Headlong: a microharness for persistent agents", laude-institute/headlong on GitHub, philosophy.md, docs/install.md, Alex Zhang, "Recursive Language Models", Hacker News discussion.

AIagentsopen sourceBashLaude InstituteHeadlongRLMdeveloper tools
CONSOLE
$