Your autonomous agent dies when its context window fills up. everloop is the fix.
A tiny, dependency-free starter kit for agents that run 24/7 by executing bounded ticks over durable on-disk state — surviving context limits, crashes, and restarts.
Every "autonomous agent" hits the same wall: a single LLM session has a finite context window. Run a long loop in one session and it slowly fills up, degrades, forgets, and dies. Bolting on summarization just delays the funeral.
Don't keep the agent alive. Keep its state alive.
scheduler ─fires every N min─┐
▼
┌─────────── one TICK = a FRESH process (empty context) ───────────┐
│ boot from RESUME.md → do ONE bounded step → write state → │ ──► exit (context discarded)
└──────────────────────────────────────────────────────────────────┘
│ state lives on disk (git)
▼
next fire = another fresh process, resumes from disk
No single process accumulates context, so nothing ever fills up. The loop is immortal because each link in it is disposable. Memory is files (a boot block + an append-only ledger), so a crashed or missed tick just means the next one resumes — no recovery code needed.
git clone https://github.com/GhostlyGawd/everloop && cd everloop
bash everloop/tick.sh # run it 3 times
bash everloop/tick.sh
bash everloop/tick.sh
cat state/counter.txt # => 3Three separate processes, each starting cold, advanced a counter 1 → 2 → 3 with no shared
memory — only state/. That's the whole trick. Now swap the demo step for a real Claude Code
agent and you have one that runs forever → ready-to-run example in
examples/claude/ (or read docs/wire-claude-code.md).
everloop/tick.sh/.ps1— the bounded tick driver (lock → boot → one step → persist → exit).state/— durable memory: a regeneratedRESUME.mdboot block + an append-onlyledger.md.examples/counter/— the dependency-free demo above (runnable in CI, proves the mechanic).examples/claude/— a Claude Code reference agent: each tick is one freshclaudeprocess.ecosystem.config.cjs— pm2 driver: one tick per cron fire in a fresh process. Or use cron/systemd.docs/wire-claude-code.md— turn each tick into a Claude Code run.
npm i -g pm2
pm2 start ecosystem.config.cjs # one tick per interval, each a fresh process
pm2 logs everloop # watchBecause state is just files in git, the scheduler is swappable (pm2, cron, systemd, a cloud routine) and you can move the agent between machines without losing a thing.
The big, mature agent projects are excellent — and solve a different problem. everloop is the small survival primitive they each assume you've already built. Honest comparison:
| You're looking at… | What it actually is | Why everloop is different |
|---|---|---|
| claude-flow | A multi-agent swarm orchestrator — spin up fleets of agents, route tasks between them. Much larger & more mature. | everloop runs one loop and has no opinion about agents, swarms, or routing. It's the disposable-process-over-durable-state trick underneath, not a fleet manager. |
| LangGraph | A graph workflow framework with checkpointers; you model your app as nodes/edges and assemble persistence from its primitives. | everloop isn't a framework you build inside. It's ~50 lines of loop + state/ you own outright. No graph, no DSL, bring your own step logic. |
| Letta / MemGPT | Tiered memory — self-editing context so an agent remembers more within a session. | Complementary, not competing. Letta answers "what does the agent remember?"; everloop answers "how does the process never die?" Use both: Letta for memory, everloop for the immortal loop. |
| A cron job + a script | The closest honest analogue — and a fine start. | everloop is that, plus the parts you'd hand-roll next: a regenerated boot block, an append-only ledger, a tick lock, and a swappable scheduler. ~50 lines so you can read all of it. |
The one-line test: if your problem is "my long-running agent fills its context window and dies," everloop is aimed squarely at it. If your problem is orchestration, memory, or workflow modeling, reach for the projects above — and wrap them in an everloop tick so they survive.
v0.1.0 — minimal but real. The core mechanic works and is tested. A Claude Code reference agent
ships in examples/claude/. Roadmap: richer state helpers and an optional
verification/guard layer. Contributing welcome — issues and PRs.
MIT.