Headlong
Open-source agent microharness with persistent, recursive agents in bash.
Working when we checked on .
What is Headlong?
Headlong is an open source agent microharness built on roughly 11K lines of Bash, designed for researchers and developers building persistent AI agents. Its defining feature is persistent agency: the agent keeps thinking in a self-guided loop inspired by human inner monologue, and human messages land as observations it chooses when to answer. Its core, shellm, is a Bash implementation of a recursive language model (RLM) where the agent thinks by writing and running shell commands. One shared agent can serve a whole team across Slack, Telegram, and a chat app, with all conversations merged into one thought stream, and it supports Anthropic, OpenAI, Gemini, OpenRouter, or local models.
Headlong pricing
Pricing model: Free
Open source (free); see LICENSE file for licensing terms
Headlong pros
- Core is about 11K lines of Bash with no tool system besides shell needed
- Persistent agency: agent thinks continuously in a self-guided inner-monologue loop
- One agent can be shared by a team over Slack, Telegram, and a chat app
- Works with Anthropic, OpenAI, Gemini, OpenRouter, or local models via OpenAI-compatible servers
- One-line installer interviews the user and opens a live mind dashboard
- Offers Docker container isolation for agent shell commands
Headlong cons
- Alpha research software with frequent expected changes
- Agents run real shell commands, so sandboxing is required for safety
- Users must supply a spend-capped LLM API key since agents think around the clock
- Requires bash 3.2+, git, curl, jq, and Python 3; dashboard additionally needs uv and bun or node
Frequently asked questions about Headlong
What is Headlong?
Headlong is an open source agent microharness: a complete agent harness with a core of about 11K lines of Bash. It is built around persistent agents powered by a Bash implementation of a recursive language model called shellm.
What is persistent agency in Headlong?
The agent keeps thinking between external interactions in a self-guided loop inspired by human inner monologue. A human message does not start a session; it lands in the agent's thought stream as an observation, and the agent decides if and when to respond.
Which LLM providers does Headlong support?
It works with an Anthropic, OpenAI, Gemini, or OpenRouter API key, or a local model on any OpenAI-compatible server such as llama.cpp, Ollama, vLLM, or LM Studio, which requires no key.
Can a team share one Headlong agent?
Yes. A whole team can talk to one agent over Slack, Telegram, and a chat app. Every conversation lands in the agent's single stream of thoughts, and the agent pings whoever seems most relevant.
How does the Headlong agent think?
At its heart is shellm, a Bash implementation of a recursive language model. The agent thinks by writing shell commands, running them, and reading the output—no tool system besides Bash is needed.
How do you install Headlong?
A one-line curl command installs everything, interviews you to create a Headlong agent, and opens a dashboard where you can watch the agent's mind run.
What are Headlong's system requirements?
You need bash 3.2+, git, curl, jq, Python 3, and an LLM API key or local model. The dashboard also needs uv and bun or node, which the installer can fetch.
Is Headlong safe to run?
It is alpha research software and should be run in a sandbox because agents execute shell commands. Users are advised to use a dedicated, spend-capped API key and not give the agent sensitive secrets.
Who is Headlong for?
It is aimed at developers and researchers experimenting with persistent AI agents, and teams who want to share a single agent across Slack, Telegram, and a chat app.
Can Headlong run in a container?
Yes. With Docker running, the installer offers to keep the whole agent in a container, or to install on the machine with the agent's commands sandboxed.