Skip navigation
Introducing Headlong, an open source microharness for persistent agents: self-guided agents that…
0:00 / 0:52

Introducing Headlong, an open source microharness for persistent agents: self-guided agents that…

Andy Konwinski

@andykonwinski13K followers

Visit on X
1,926 likesDownloadOriginal post

364,997 views

Introducing Headlong, an open source microharness for persistent agents: self-guided agents that think continuously. Most agent harnesses are reactive: you send a task, the agent completes it, and then it sits frozen until the next request. Cron jobs and heartbeats wake it up to run a checklist and put it back to sleep. A Headlong agent is never asleep. It keeps generating thoughts about whatever it decides is interesting, in a self-guided loop inspired by human inner monologue. Your message doesn't start a session. It's one more observation that lands in the agent's thought stream, and the agent decides if and when to reply. Headlong is built on the idea of persistent agency: continuous inner thought generation between external interactions. The agent sets its own interests and priorities, comes up with its own projects, and sometimes pings you unprompted with progress. To keep our prototype as simple and small as possible, we implemented Headlong as a microharness: a complete agent harness in under 10K lines of Bash, organized as a handful of small executables. It includes a loop that generates the next thought, shellm (a recursive language model written in Bash), a trajectory stored as a DAG of jsonl files, and context as a projection of that trajectory. We've been running one Headlong agent internally at Laude for several weeks. The whole team talks to it over Slack and Telegram, and every conversation lands in its single stream of thought. It works in its own fork of Headlong and we've pulled over 50 of its commits into main. One night, with nobody talking to it, it went back to check whether a recall process it had built was actually wired into its mind, found that it wasn't, diagnosed and fixed the bug, and verified the fix end to end. 48 minutes, no human asked for the fix or was in the loop at any point. Every step is a timestamped line in its log. Things broke too, and we wrote those up. Background thinking costs us $1 to $2 an hour, our agent stopped its own service three times by accident, and self-delegation died on day one. Details in the post. One line installs everything and starts an agent. Use a dedicated sandbox and spend-capped API key; it runs real shell commands and thinks around the clock. Headlong is research software, be careful! curl -fsSL | bash Launch post: Repo: Headlong is a Laude Institute / MIT collaboration.

50 Comments

Comments from the original post on X (Twitter)

  • Drew Breunig's profile picture

    @dbreunig

    “What should $NAME think about when idle,” is the question I've most thought about in an install wizard. Also, love this:

    21 likes

  • Andy Konwinski's profile picture

    @andykonwinski

    labeling one's slop is a moral imperative. but more importantly, what did you name your agent?

    9 likes

  • Drew Breunig's profile picture

    @dbreunig

    iota

    1 like

  • Drew Breunig's profile picture

    @dbreunig

    Though given the technique, “Constance” was temping

    4 likes

  • Fraser Price's profile picture

    @fraserpricee

    i lost you at 10k lines of bash

    16 likes

  • Andy Konwinski's profile picture

    @andykonwinski

    more of a PowerShell guy?

    18 likes

  • Yohei's profile picture

    @yoheinakajima

    while true:

    11 likes

  • Andy Konwinski's profile picture

    @andykonwinski

    yeah, or maybe thought_history = [] recursively_generate_next_thought(thought_history)

    21 likes

  • Thomas Wolf's profile picture

    @Thom_Wolf

    @matei_zaharia Fun project! Maybe Audel could be a multi-agent entity to cultivate more diversity of thinking/reflectiveness

    8 likes

  • Andy Konwinski's profile picture

    @andykonwinski

    @matei_zaharia in my experience so far, diversity of thoughts is not yet one of Audel's strengths. It can be reflective though, and it definitely does things that delight me once in a while though. more like a child than a serious co-worker but I could see it getting there eventually

    8 likes

  • Filecoin's profile picture

    @Filecoin

    persistent agents depend on trajectory logs that stay verifiable after the sandbox closes

    6 likes

  • Jake Abernethy's profile picture

    @Thejakeyboy

    This is a good idea.

    4 likes

  • Andy Konwinski's profile picture

    @andykonwinski

    like 8 out of 10? or...

    1 like

  • JJ's profile picture

    @JosephJacks_

    Very cool, Andy.

    3 likes

  • Andy Konwinski's profile picture

    @andykonwinski

    thx!

    2 likes

  • Ashutosh Jha's profile picture

    @ashutosh887_

    I love the Institute Name!

    3 likes

  • Alex Garcia's profile picture

    @alex_here_now

    Love the cognitive architectural approach. I've taken an extremely similar path and it's working great for me: one continuous context 'awareness stream' with ability to yield_no_action via tool + a send_message tool back into dozens of external channels. Will dig into this

    2 likes

  • Mason Hall's profile picture

    @0xMasonH

    Why bash though

    2 likes

  • Andy Konwinski's profile picture

    @andykonwinski

    LLMs know bash well. and the philosophy behind bash is a pretty good fit for a microharness. here are some more thoughts (of mine and claude's) on the topic:

    12 likes

  • elliott's profile picture

    @cyburke

    I need one of these to just listen to my ramblings all day long... then at night while I'm sleeping its just thinking about "how can I help this insuferable human get over his shit?" and then it can share those findings with me and we repeat day after day towards improvement. 😶

    2 likes