laude-institute/headlong

An open source agent microharness featuring persistent agency and recursive LLMs. Of bash, by bash, for bash; it's shells all the way down.

What it solves

Headlong provides a framework for creating persistent AI agents that do not simply react to user prompts, but maintain a continuous "inner monologue" and self-guided loop of thought. It solves the problem of reactive, turn-based agents by allowing them to set their own priorities, start projects, and decide when to communicate with humans across multiple platforms (Slack, Telegram, and a web dashboard).

How it works

At its core, Headlong uses shellm, a Bash-based implementation of a Recursive Language Model (RLM). The agent thinks by writing and executing shell commands, using Bash as its primary toolset. It records its entire history as a Directed Acyclic Graph (DAG) of JSONL files, which serves as its trajectory.

To manage memory, it uses tiered context compaction, where recent events are kept verbatim and older events are progressively summarized. This allows the agent to maintain a long-term history without exceeding LLM context limits. The system is designed as a collection of small, single-purpose Bash executables that compose via pipes and files, following a Unix-style philosophy.

Who it’s for

Developers and researchers interested in autonomous agents, those who want to experiment with persistent AI personas that can collaborate with teams, and users who want a lightweight, Bash-centric agent harness that is easy to read and modify.

Highlights

  • Persistent Agency: Agents run in a continuous loop, thinking and acting even without external input.
  • Multi-player Interaction: A single agent can interact with multiple people across different chat bridges, treating all conversations as a single stream of thought.
  • Bash-native Tooling: Uses shell commands for all actions, eliminating the need for complex tool-calling schemas.
  • Trajectory DAGs: Maintains a full, forkable history of thoughts and actions, enabling the agent to self-improve by forking its own codebase and merging successful changes.
  • Docker Sandboxing: Automatically runs generated code in containers to ensure host security.
  • Broad Model Support: Compatible with major providers (Anthropic, OpenAI, Gemini) and local servers (Ollama, llama.cpp, vLLM).

Related

  • Project
  • Dispatch
  • Project
  • Project
  • Project