Headlong: A microharness for persistent agents
TL;DR Highlight
A 10K-line Bash harness keeps an agent thinking continuously, even with no requests
Who Should Read
A backend or agent developer frustrated that request-driven agents sit idle and exploring an always-on agent architecture
Core Mechanics
- It keeps thinking without requests
- Typical harnesses finish a task and sit frozen until the next request.
- A Headlong agent keeps generating its own next thoughts even with no external input.
- A human message is not a new session but one more observation in the thought stream.
- The core is a single infinite loop
- It repeatedly calls the LLM with a prompt to choose the next thought given past thoughts.
- A thought is either inner monologue or something that triggers an action.
- Each run ends by scheduling its own next wake-up.
- The core is under 10K lines of Bash
- It is 9.9K lines across bin/ and thinkers/.
- Tools, framework, memory, and skills are all executables and files, so the agent can inspect and modify itself.
- The agent worked in its own fork, and over 50 of its commits were pulled into main.
- Memory is compacted at varying resolution
- The whole trajectory stays in context: recent entries verbatim, older ones progressively summarized.
Community Reactions
- Shared agent means no data isolation
- One commenter said the article waves away zero data isolation in three sentences.
- The article itself says Audel is bad at keeping secrets and to assume everything is shared with the team.
- Looping alone doesn't improve the model, one view
- A commenter argued that thinking in a loop is not learning.
- They said retraining such as RLAIF or STaR plus human review is needed to avoid compounding mistakes.
- Scheduled wake-ups fall short of the pitch, one view
- A commenter said the turn, FINAL, schedule wake-up structure resembles an always-on background agent.
- They said a sub-second loop with no FINAL would be closer to how humans think.
- Complaints about curl | bash and cost
- A commenter asked not to normalize curl-piped-to-bash installs for alpha software.
- Another said BYOK-only is expensive, citing $50-$150 for roughly one kanban ticket with frontier models via OpenRouter.
How to Apply
- Run it in isolation today
- On a dedicated VM or Docker host, run the install command with a separate spend-capped API key.
- Do not give the agent sensitive secrets.
- Name the agent, send one message, and watch whether it decides to reply.
- Add exponential backoff to wake-up intervals
- Add a guard against self-stopping for always-on agents
- Design memory as a trajectory with tiered compaction
Try It
# Simplified version of the article's method: paste into a new Claude or ChatGPT chat. It manually mimics the persistent agent's "choose the next thought" loop.
너는 멈추지 않는 에이전트다. 아래 trajectory(과거 생각과 관찰)를 보고 다음 생각 하나만 골라라.
생각은 (1) 속으로 하는 독백, (2) 실행할 행동, (3) 사람에게 보낼 메시지 중 하나다.
새 메시지는 시스템 세션이 아니라 관찰 하나로 취급하고, 답할지 말지는 네가 정해라.
[trajectory]
{{지난 생각과 관찰 목록}}
[새 관찰]
{{새 메시지 또는 "없음"}}
출력 형식:
- 생각 종류:
- 내용:
- 다음 wake-up까지 대기 시간(초):
Next: append the output to the end of the trajectory and repeat the same prompt, and see whether the wait time grows on its own when there are no new observations.Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.