A background agent that thinks in Bash and bills by the hour
Headlong exists to run a persistent LLM agent that thinks in shell commands, never sleeps, and fits in a 10K-line Bash microharness.

What it does Headlong is a complete agent harness written almost entirely in Bash. It runs an LLM in a continuous loop: the model writes shell commands, executes them, reads the output, and repeats. Human messages from Slack, Telegram, or a local chat app are injected into this ongoing thought stream as observations, and the agent decides for itself if and when to respond. There are no request/response sessions—just an agent that thinks around the clock.
The interesting bit
Instead of a framework with plugins, Headlong treats Unix pipes, files, and environment variables as its architecture. The core is a handful of small executables—shellm, traj, context, llm—that compose to form a recursive language model. Because the LLM reasons by emitting Bash, standard tools like curl and jq become the entire tool layer; no secondary abstraction is needed.
Key highlights
- Persistent agency: the agent maintains a self-guided inner monologue even without external input, backing off exponentially when idle and resetting when a message arrives.
- Shared mind: one agent serves multiple people across chat platforms in a single timeline, correlating conversations and pinging whoever seems relevant—though nothing is private between users.
- Tiered memory: the full trajectory is kept in context at decaying resolution; recent entries are verbatim, older ones are progressively summarized, and the agent can retrieve raw history on demand.
- Self-improvement via fork/merge: an agent can fork the Headlong repo, modify its own code, test it, and merge changes back; the maintainers report pulling over 50 agent commits into main.
- Sandboxing by default: generated code runs inside Docker containers whenever possible, while unsandboxed host execution requires an explicit, discouraged opt-in.
Caveats
- Alpha software with real costs: the README warns this is research-grade, runs shell commands continuously, and costs roughly $1–$2 per hour at default settings; a spend-capped API key is strongly advised.
- No privacy walls in multi-user mode: because all conversations feed into a single thought stream, anything you tell the agent is visible to everyone else who talks to it.
- Host execution risk: without Docker, the agent runs commands directly on your machine as your user, which the installer treats as a dangerous edge case requiring explicit confirmation.
Verdict Headlong is for developers who want a fully inspectable, hackable agent core that runs autonomously in the background. If you need strict security boundaries, predictable billing, or a non-Bash foundation, look elsewhere.
Frequently asked
- What is laude-institute/headlong?
- Headlong exists to run a persistent LLM agent that thinks in shell commands, never sleeps, and fits in a 10K-line Bash microharness.
- Is headlong open source?
- Yes — laude-institute/headlong is open source, released under the Apache-2.0 license.
- What language is headlong written in?
- laude-institute/headlong is primarily written in Shell.
- How popular is headlong?
- laude-institute/headlong has 1.2k stars on GitHub.
- Where can I find headlong?
- laude-institute/headlong is on GitHub at https://github.com/laude-institute/headlong.