next level nerdingHow to use Pi Durable
How to use Pi Durable
Pi Durable is the new piece from the team behind the Pi coding agent. It saves every step an agent takes, so when the program crashes, the work carries on. It's not something you type into. It's a building block for agents that run without you. Never used Pi? Start here.
Jump to what it is, the six steps, or run it yourself, free.
The videos
Three videos, about 90 minutes in all. Alejandro explains it; IndyDevDan shows what he built with it. The chapters are each creator's own. Every timestamp on this page opens that video at that moment.
Watch first · 30 min · Oct 19, 2026
Pi Durable explained: build always-on agents with local models
Alejandro AO on the Hugging Face channel. What it is, where it sits next to Pi, the six setup steps, and a small agent on a free local model that picks up after he stops it.
Watch second · 35 min · Oct 12, 2026
Pi Durable proactive agents: Jev triggers an on-call Pi agent
IndyDevDan on his own channel. What it lets you build: an agent that starts work on its own, many screens on one agent, shared state, and jobs that wait for your OK.
- 0:00 Durable agents for agentic engineering
- 1:47 What is a durable Pi agent?
- 2:10 Jev triggers an on-call Pi agent
- 5:56 The durable agent network playground
- 7:56 Shared application state
- 9:44 Durable tasks and human near the loop
- 14:22 Tools inside your durable agent
- 20:23 Extend and customize every Pi agent
- 25:44 Why build durable agents?
Watch third · 23 min · Oct 19, 2026
A Pi Durable agent that curates news: hype, fact or signal
IndyDevDan on his own channel. One real app on it: a news agent that runs every minute on a Mac mini. The browser and the terminal show the same agent.
- 0:00 Proactive agents: in, near, out of the loop
- 1:23 The durable news agent
- 5:15 Build with taste: hype, facts, signal
- 6:58 Software architecture still matters
- 8:25 Building software in layers
- 10:26 Jev everywhere
- 11:17 Measure your agentic engineering
- 12:25 Building a useful product
- 18:27 Durable agents are powerful
Eight things to know
All three videos in eight boxes. Each links to the part of this page that explains it.
- 01Alejandro 8:27
It's a building block, not an app
You can't type pi durable and chat. It's a code library. You, or your coding agent, use it to build an agent that runs on its own.
How - 02Alejandro 6:18
Every step is saved before the next one
Each model call and each tool call is saved as a task with a checkpoint, in a file on disk. Nothing important lives only in memory.
How - 03Alejandro 7:25
Crash, restart, carry on
If the program dies, the next run opens the same file, finds the unfinished work and continues it. Nobody has to type continue.
How - 04Dan, on-call 4:38
Risky actions don't run twice
A tool cut off by a crash only runs again if it's marked safe to repeat. Otherwise the agent is told it was interrupted and decides what to do.
How - 05Dan, on-call 14:53
One agent, many screens
The agent lives on one machine. A browser, a terminal, a phone or a script can all connect to it and see the same thing.
How - 06Dan, on-call 7:56
Shared notes every agent can read
Agents can keep app state, like a to-do list or an incident report, saved right next to the chat. Other agents can read it too.
How - 07Dan, news 2:38
Proactive means it works first, then waits
Durable agent plus a trigger plus its own machine. Something happens, the agent starts, does the work, then waits for your OK.
How - 08Alejandro 15:13
It's experimental. Pin the version
Released Oct 1, 2026, already at 1.3.0, and the code has changed between releases. Lock the version you build on.
How
Words on this page
28 terms, in plain words. Read this first if Pi is new to you.
- Agent
- An AI model that can do things, not just talk: read files, run commands, search the web, then decide the next step from what came back.
- Pi
- A small, open-source coding agent you run in the terminal by typing pi. From Earendil, the team of Mario Zechner and Armin Ronacher. Version 1.0 shipped Oct 1, 2026.
- Pi Durable
- A code library from the same team for building agents that survive crashes and keep running when nobody is watching. Shipped with Pi 1.0. Experimental.
- Harness
- The program around the model. It sends your message, runs the tools the model asks for, saves the chat, and loops. Pi has one. Pi Durable is another.
- Library (npm package)
- Code you add to your own program with one install command. You don't open it like an app. Pi Durable is the package @earendil-works/pi-durable.
- Node.js
- The program that runs JavaScript and TypeScript outside a browser. Pi Durable needs version 22.19 or newer. Alejandro's demo needs 24.
- Tool call
- When the model asks the harness to do something for it, like read a file or send an email. The harness runs it and hands back the result.
- Conversation
- One chat between you and an agent, saved as a list of messages. If you've used Pi, think of a Pi session. One harness can run many at once.
- Submission
- One thing you hand a conversation, usually a message. You get back an ID, so you can wait for the answer now or check on it later.
- Task
- A saved unit of work: one model call, one tool call, or a longer job you define. Pi Durable runs everything as tasks.
- Checkpoint
- The note a task saves before it moves on: where it is and what it has done. After a crash, work restarts from the last one.
- Storage
- Where it all gets saved. SQLite (one file on disk) for real use, a JSONL folder, or memory, which forgets everything when the program stops.
- SQLite
- A small database that lives in one file. Nothing to install or run separately. Newer versions of Node have it built in.
- Registry and extensions
- The registry is the list of add-ons this program loaded. An extension is one add-on: a bundle of tools, system prompt parts and rules.
- Replay-safe
- A tool that's fine to run twice, like reading a file. Mark a tool replay: "safe" and it reruns after a crash. Everything else is unsafe unless you say so.
- Idempotency key
- A unique label on an action, so if it's sent twice it only happens once. Pi Durable calls its version a requestId.
- Daemon
- A program that runs in the background and is started again automatically if it stops. Pi Durable resumes when it's restarted, but it doesn't restart itself.
- Client
- A screen that connects to the agent: a web page, a terminal app, a phone, a curl command. The agent keeps running when you close it.
- Trigger
- The thing that starts an agent without you typing: a clock (cron), a new line in a log, a webhook, a message in Slack.
- Cron
- The built-in scheduler on Mac and Linux. One line says run this every minute, or every morning at 9.
- Proactive agent
- IndyDevDan's term: an agent that starts work when something happens, then waits for you to review. A durable agent, plus a trigger, on its own machine.
- In, near, out of the loop
- In: you prompt back and forth. Near: the agent works and you approve. Out: it runs without you. IndyDevDan's ladder.
- Sandbox
- A separate machine or box where an agent can't hurt your own files. Dan uses spare Mac minis and exe.dev cloud machines.
- Compaction
- Summing up older messages so a long chat still fits in the model's memory. Pi Durable does it in the background and keeps the old messages saved.
- Fork
- A copy of a conversation from some point on, so you can try a different direction without losing the first.
- Jev
- A fast, very cheap classifier model from TypeSafe. Dan uses it to sort every log line or news story before a pricier model sees it.
- llama.cpp and Qwen
- llama.cpp runs AI models on your own computer for free. Qwen3.5-0.8B is the tiny open model Alejandro runs on it.
- Local model
- A model that runs on your computer instead of a company's servers. Free and private, but small ones make more mistakes.
Pi is an app. Pi Durable is a part.
The most common mix-up, Alejandro says: people expect to type pi durable and get a Pi that never breaks. There's no such command. It sits one layer down, next to Pi's own engine. 8:27
What you use
The harness
Under both
Left: what you've seen if you've used Pi. Right: what Pi Durable is for. Alejandro's picture, 10:41 to 12:50. 10:41
Which one do I want?
Before and after · five emails, a crash on the fifth 2:48
Pi, the coding agent
- 1You ask it to send five emails. It starts a send email tool call.
- 2Four go out. On the fifth, the program crashes.
- 3The chat log has a tool call with no answer. Pi fills in an error.
- 4You restart it, type continue, and work out what got sent.
Pi Durable
- 1The send is saved as a task, with what it means to do, before it runs.
- 2Four go out. On the fifth, the program crashes.
- 3Something restarts the program. It opens the same file and finds the unfinished task.
- 4If the tool is marked safe to repeat, it runs again. If not, the agent is told it was cut off and decides. No one types continue.
Alejandro's example. Whether email five is sent, or emails one to four go out again, depends on how the send tool was written. More in what it won't do.
Three basic uses
A chat that picks up after a restart
Close the program halfway through an answer. Open it again and the answer finishes. That's Alejandro's second script.
Alejandro's demoAlejandro 28:00
A support bot on your website
A customer leaves and comes back hours later to the same conversation. Dan says every support bot should be built this way.
Said by DanDan, on-call 31:36
An assistant you message from Slack or email
You aren't watching it, so it must not break mid-job. Earendil's example: one Slack channel is a conversation, a thread is a fork.
Alejandro and the announcementAlejandro 9:36
Three advanced uses
An on-call agent
Jev reads every log line. When errors cluster, an agent opens an incident, finds the bug, writes the fix and waits for you to approve the deploy.
Dan's durable-pi repoDan, on-call 2:10
A news desk on a timer
A clock wakes it. It gathers stories, has Jev throw out the noise, ranks the rest and posts a few cards. You vote and it learns.
Dan's news agent repoDan, news 1:23
Long jobs that stop for a person
A release check runs in phases, has a helper agent gather evidence, then waits for a person before it publishes. A restart keeps its place.
Dan's durable-pi repoDan, on-call 10:48
Everything named
What each thing is and whether you need it. For the first run, you need Node and Alejandro's demo. Everything else is optional.
The Pi pieces
Coding agentOptional
Pi
The terminal agent. Not needed to run Pi Durable, but the easiest helper to have write and explain Durable code for you.
Earendil · MITSite
Durable harnessNeeded
Pi Durable
The library this page is about. Package @earendil-works/pi-durable. No command of its own.
Earendil · MIT · 1.3.0Site
Model connectorNeeded
pi-ai
Talks to the AI providers. Installed next to Pi Durable.
Earendil · MITSite
State and cancel helperNeeded
Chord
Earendil's small library for saved app state and for stopping work. Installed next to Pi Durable. You mostly see it as BACKGROUND_CONTEXT.
Earendil · MITSite
To run the first demo
Runs the codeNeeded
Node.js 24
Pi Durable needs 22.19 or newer. Alejandro's demo needs 24 because it uses the SQLite built into Node.
OpenJS FoundationSite
Local model serverOptional
llama.cpp
Runs an open model on your Mac for free. On a Mac it's one Homebrew install.
ggml-org · MITSite
Tiny open modelOptional
Qwen3.5-0.8B
The model in Alejandro's demo. Small enough for a laptop, so it's fast. Too small for real coding or tricky tool use.
Qwen · weights from UnslothSite
Two chat scriptsNeeded
Alejandro's demo
One script starts fresh each time. The other reopens the saved chat and finishes unfinished work. Plain JavaScript, no build step.
alejandro-ao · no license fileSite
In IndyDevDan's builds
Cheap classifierShown, not needed
Jev
Sorts each log line or story in a fraction of a second for a tiny fraction of a cent, so the pricier model only sees what matters.
TypeSafeOn FakeNerd
One key, many modelsShown, not needed
OpenRouter
Dan's repos use one OpenRouter key for the agent's model and for Jev.
OpenRouterSite
Agent machinesShown, not needed
exe.dev and Mac minis
Where Dan's agents live, so they keep running with his laptop closed. Both repos run on one laptop by default.
exe.dev · AppleSite
Command shortcutsShown, not needed
just
A tool for saving short named commands. Dan's repos use it for every step: just install, just combos dev.
Casey Rodarmor · CC0Site
Models on screen
On-call agent's modelShown, not needed
Claude Sonnet 5.5
Runs the agents in Dan's playground on screen, on low thinking, and the incident agent in his on-call repo.
Anthropic
Cheap modelsShown, not needed
GPT-6 Luna and Haiku 5.5
GPT-6 Luna runs the news agent on screen. The repo defaults to Claude Haiku 5.5. Both are the low-cost tier.
OpenAI · Anthropic
Also named, not part of the setup
- OpenAI Dots, Muse by Meta, GrokBotNamed by Alejandro as the always-on assistants Pi Durable lets you build yourself, on any model.Alejandro 9:36
- Claude in SlackDan's view: the big labs build products like this, and OpenAI Dots, on durable agent ideas. His claim, not shown.Dan, on-call 0:33
- Cloudflare Durable ObjectsA fourth storage option, added in 1.1.0. From the changelog, not the videos.Changelog
- Gemini 4 ArgonNot part of the setup. It's the news story Dan's agent caught while he filmed.Dan, news 1:34
The six steps, then a crash
Every Pi Durable program does the same six things, in this order. Then the harness takes over. Darker boxes are the code you (or your agent) write. Click any box, or press Start and follow one request through a crash. 19:58
Setup · six steps, in your code · darker boxes are yours
While it runs · Durable does this
Follow one request through a crash
Nine beats from Alejandro's second script. He asks a question, stops the program halfway, runs it again, and the answer still arrives. Press Start and watch the boxes light up in order.
Step 1 of 9 · you write it
Alejandro at 24:40Pick a model
const models = createModels(); models.setProvider(openaiProvider());
Tell pi-ai which provider to use: OpenAI, OpenRouter, or a model on your own computer through llama.cpp. Alejandro's demo picks llama.cpp if it's running, then OpenAI if you set a key, then a free echo model.
Why: Pi Durable doesn't tie you to one company. The same agent can run on a cheap cloud model or a free local one.
What you see
Nothing yet. This is a few lines at the top of the file.
Watch out
A saved conversation remembers its provider. In Alejandro's demo, reopening it with a different one stops with an error.
The six steps and their order are Alejandro's. The code lines are shortened from the package README and his demo; the three run-time boxes are FakeNerd's split of what the announcement describes.
The code, smallest first
You don't have to write this. Alejandro's advice is to have an agent do it. But it helps to recognize it. All three are from Earendil, MIT licensed, read Oct 19, 2026, when the latest release was 1.3.0. 21:00
Install · from the README
npm install @earendil-works/pi-durable @earendil-works/pi-ai @earendil-works/chord
1 · Ask one question · README quick start
import { BACKGROUND_CONTEXT } from "@earendil-works/chord/context";
import { createModels } from "@earendil-works/pi-ai/models";
import { openaiProvider } from "@earendil-works/pi-ai/providers/openai";
import { AssistantEntry, createRegistry, Harness, MemoryStorage } from "@earendil-works/pi-durable";
const context = BACKGROUND_CONTEXT;
const models = createModels();
models.setProvider(openaiProvider()); // reads OPENAI_API_KEY
const harness = await Harness.open(new MemoryStorage(), { models, registry: createRegistry() }, context);
const root = await harness.root(context, { agent: { model: { provider: "openai", modelId: "gpt-6-sol" } } });
const submission = await root.submit({ type: "input", content: "What is the capital of France?" }, context);
const settled = await submission.wait(context);
if (settled.status === "done" && settled.type === "input") {
const answer = await root.commit((tx) => tx.entry(AssistantEntry, settled.answer), context);
console.log(answer?.model?.[0]);
}
await harness.close(context);The whole loop in one file: models, an empty registry, memory storage, the harness, the root conversation, one submission. It needs an OpenAI key. Memory storage means nothing is saved yet.
2 · Make it durable · README
import { openNodeSqliteStorage } from "@earendil-works/pi-durable/storage/sqlite/node";
const harness = await Harness.open(await openNodeSqliteStorage("./session.sqlite"), { models, registry }, context);
const root = await harness.root(context); // the same root as last time
harness.resume(); // continue any run the last process left unfinishedSwap memory for a SQLite file and call resume(). That's the change that lets it survive a restart.
3 · A tool that's safe to repeat · announcement
import { Type } from "@earendil-works/pi-ai";
import { defineTool } from "@earendil-works/pi-durable";
const searchIssues = defineTool({
name: "search_issues",
description: "Search the issue tracker",
parameters: Type.Object({ query: Type.String() }),
replay: "safe", // only reads, so a rerun after a crash is fine
execute: async (args, api) => {
// streamed to every client watching
api.output(`searching for ${args.query}\n`);
return {
output: [{ type: "text", text: await tracker.search(args.query) }],
};
},
});What to notice in 3
replay: "safe"says rerunning it after a crash is fine, because it only reads.- Leave it out and the tool is unsafe: after a crash, the agent is told it was cut off instead.
- The announcement says
content:. Since 1.2.0 it'soutput:, shown here. trackeris a stand-in for your own code.
More: the package README and its 32 numbered examples, from a one-line conversation to a reload-and-restart. That folder is what Earendil says to point your agent at.
Proactive agents: they work, then wait
IndyDevDan's two videos are about one idea. Most agents wait for you to type. A proactive one starts when something happens and waits for you at the end. 2:38
His formula
= a proactive agent. Both of his builds run on one laptop by default. The spare Mac mini or the exe.dev machine is the always-on upgrade.
The on-call agent · darker steps are you2:10
- 1WatchA fake production log stream. Jev labels every line normal, suspicious or incident.
- 2TriggerThree incident labels (or eight suspicious ones) on the same error inside two minutes, and code opens an incident and starts an agent.
- 3InvestigateThe agent reads the logs and the code, finds the cause (a bad null check) and writes the fix on its own branch.
- 4WaitDeploy waiting for your approval. That wait survives a restart.· you
- 5ApproveDan declines at first, asks it to explain the bug and show the diff, then approves. The deploy runs once and production settles.· you
The logs are fake and the shop is a mock. Dan's count: Jev sorted thousands of log lines for a few cents. Repo: disler/durable-pi, MIT.
The news agent · darker steps are you10:26
- 1TickA cron line fires every minute. The app starts a sweep every five minutes by default.
- 2Gather, gate, dedupe, rankA saved, step-by-step task. Jev checks each story: relevant? worth it? same story as another? Hype, facts or signal?
- 3PresentThe agent picks up to seven cards for the feed. The browser and the terminal update together.
- 4VoteThumbs up or down, or say increase the weight of Gemini. It raised that keyword from 1.2 to 1.3.· you
- 5LearnYour labels become examples for Jev's next calls, so the feed sharpens over time.
It sorts each story into hype, facts and signal. Signal is the news you can act on today. Repo: disler/pi-durable-news-agent, MIT.
In, near, out of the loop · Dan's ladder 0:31
- 1You do every turnIn the loopYou prompt, it answers, you prompt again. Every Pi or Claude Code session today.
- 2You approveNear the loopIt starts on a trigger, does the work, and stops at the risky step for your yes or no.
- 3You check inOut of the loopIt runs and ships without you. You check results now and then.
Durable agents are his step from rung 1 to rung 2. His scorecard: how many agents are doing useful work for you right now, without you? 34:10 The whole ladder, with a map and a way to move your own tasks: In loop, near loop, out loop.
Later, not day one · shown in Dan's playground
Swap tools mid-run
Dan flips the agent to read-only while it's working. The next request goes out with fewer tools. The agent noticed and corrected itself.
18:25Turn add-ons on and off live
A Jev damage-control extension checks every bash command and blocked rm -rf as irreversible. Off again, and the same command ran.
20:57Fork an agent
Copy an agent with everything it knows so far and send the copy a different way.
22:28Durable jobs
Repeatable jobs in phases. If one phase fails, it reruns from that phase, not from the top.
9:44
What it won't do for you
Durable means saved step by step. It doesn't mean every action happens exactly once, or that your program restarts itself. These seven come from the README, the announcement and every demo repo.
- 1It's experimental"The API changes without notice between releases." Tool results were renamed from content to output in 1.2.0. The two demo apps in the announcement were removed from the main branch on Oct 12. · README, CHANGELOGDo: Pin an exact version in package.json. The three demo repos pin 1.2.0, 1.0.3 and 1.1.0.
- 2Tools aren't safe to repeat by defaultAfter a crash, a cut-off tool reruns only if it says replay: "safe". Even then, an email, a payment or a deploy could happen twice. · Announcement, spec, every demo READMEDo: Mark only read-only tools safe. Give anything that sends, pays or deploys its own idempotency key.
- 3It doesn't restart itselfRecovery happens when your program opens the storage again. If nothing starts it, nothing resumes. · Alejandro's video description and READMEDo: Run it under a service manager (launchd on Mac, systemd on Linux), or start it from cron.
- 4One program per storage file"One process owns a storage at a time; there is no cross-process locking." · READMEDo: One running copy per SQLite file. Alejandro's demo adds a PID file to guard it.
- 5It's not a sandboxThe coding tools run with your permissions. Alejandro's demo prints: tools run with your user permissions. This is NOT a sandbox. · Alejandro's README, Pi's READMEDo: Use a throwaway folder, a container, or a separate machine like Dan's.
- 6It ignores your Pi setupNo .pi folder, no AGENTS.md, no skills. A conversation only gets what you pass in code. · Alejandro, 16:47Do: Put the instructions in the conversation's instructions field, or load your AGENTS.md text yourself.
- 7Memory storage forgetsMemoryStorage is lost when the program stops. JSONL keeps the whole history in memory too. · READMEDo: Memory to try things. SQLite for anything you want to survive.
Try it, smallest version first
Eight steps. One to five are free and take about half an hour on a Mac; step 5 is the moment it clicks. Steps 3 to 5 run in any terminal with Node 24, including a cloud box in Cloudroom or bb. Use a throwaway folder: the demo's tools can run commands as you.
- 01
Check you have Node 24
FreeOpen Terminal and type this. You need v24 or higher for Alejandro's demo. If it's missing or older, install the LTS from nodejs.org.
nodejs.orgStep 1 · in Terminal
node --version
- 02
Meet Pi first (optional, 5 minutes)
Free install. The model costs whatever your plan costsInstall Pi, open it in any folder, and connect a model with /login. You don't need Pi to run Durable, but it's the friendliest way to have an agent explain and change the code for you in step 6.
Pi quickstartStep 2 · in Terminal
curl -fsSL https://pi.dev/install.sh | sh pi # then, inside Pi, type: /login
- 03
Run Alejandro's demo with no model
FreeIt runs on a built-in echo model: no key, no download. You'll see a banner with the tools and the SQLite file, then it repeats what you type. Type /quit to leave.
The demo repoStep 3 · in Terminal
git clone https://github.com/alejandro-ao/pi-durable-demo.git cd pi-durable-demo npm ci --ignore-scripts npm run chat
- 04
Give it a real brain, still free
Free. Prefer a cloud model? Put OPENAI_MODEL and OPENAI_API_KEY in .env insteadInstall llama.cpp and start the tiny Qwen model in a second Terminal window (the brew line is for a Mac; llama.cpp's page covers Linux and Windows). The first run downloads the model. Then start the chat and ask: Read README.md and tell me the secret phrase.
llama.cppStep 4 · in Terminal
# second window: install and start the model brew install llama.cpp llama-server -hf unsloth/Qwen3.5-0.8B-GGUF:BF16 --alias qwen3.5-0.8b-bf16 --jinja --reasoning off -c 16384 --parallel 1 -ngl 999 --host 127.0.0.1 --port 8080 # first window, inside pi-durable-demo: npm run chat:llama
- 05
Crash it on purpose
FreeStart the resume version. Ask it to read the docs and say what the project does. Press Ctrl+C while it's working. Run the same command again and watch the answer arrive. This is the whole point of Pi Durable, in one minute.
Step 5 · in Terminal
npm run chat:resume:llama
- 06
Have your agent explain it and change it
Your agent's usual costOpen Pi, Claude Code or Codex in the demo folder and paste the first starter prompt below. Then ask for one small change, like a new instruction or a tool. This works in Cloudroom or bb too.
Starter prompts - 07
See a proactive agent, still free
Free in this mode. Live mode needs an OpenRouter key: about $0.32 the first sweep, then under a centDan's news agent has a free offline mode with fake news and a scripted model. It needs just (brew install just). Open http://localhost:4851 when it's up.
The news agent repoStep 7 · in Terminal
git clone https://github.com/disler/pi-durable-news-agent.git cd pi-durable-news-agent just install cp .env.example .env just api tokens just combos dev
- 08
The full on-call demo, when you're ready
About $0.09 per incident, per the repoThe one in Dan's video: Jev watches logs, an agent fixes the bug, the deploy waits for you. It has the most moving parts and needs an OpenRouter key. Follow the repo's README, or let your agent run its /install command.
The durable-pi repo
Commands for steps 3 to 5 are from Alejandro's README; step 7 from Dan's; step 2 from pi.dev. The order and the step 1 check are FakeNerd's.
Starter prompts
None of the videos shows a prompt for building on Pi Durable, so these three are FakeNerd's. Paste them into Pi, Claude Code, Codex, Cloudroom or bb. Fill in the [BRACKETS].
FakeNerd · explain the demo
I'm new to Pi and Pi Durable. This folder is a small Pi Durable demo. 1. Read README.md, chat.mjs and chat-resume.mjs. 2. Explain, in plain words and short paragraphs, the six setup steps: models, registry, storage, harness, conversation, submit. Point to the line for each. 3. Explain exactly what happens when I press Ctrl+C in chat-resume.mjs and run it again. 4. Tell me which tools this agent has and what could go wrong if I ran it outside a throwaway folder. Don't change any files yet.
Use in Alejandro's folder after step 5. It only reads.
FakeNerd · first agent
Build me the smallest Pi Durable agent in this empty folder. - Node 24, plain JavaScript (.mjs), no build step. - Install exact versions: @earendil-works/pi-durable, @earendil-works/pi-ai and @earendil-works/chord, all [VERSION, e.g. 1.3.0]. Pin them. - Read the package README first: https://github.com/earendil-works/pi/blob/main/packages/durable/README.md - Model: [PROVIDER AND MODEL, e.g. OpenAI gpt-6-luna, key in .env]. - Storage: SQLite in ./data/agent.sqlite. Call harness.resume() on start. - Tools: none, except one read-only tool I describe here: [WHAT IT SHOULD LOOK UP]. Mark it replay: "safe". - Instructions for the agent: [ONE OR TWO SENTENCES]. - A tiny terminal chat: type a message, see the answer, /quit to exit. Give every message a requestId. When it works, show me how to stop it mid-answer and restart it, and explain what I should see.
Use in an empty folder. One read-only tool keeps the first one safe.
FakeNerd · make it proactive
Turn this Pi Durable agent into a proactive one. - Trigger: [WHAT STARTS IT, e.g. every morning at 8, or a new file in ./inbox]. - When it fires, submit one message to the root conversation with a requestId made from the trigger (for example the date), so a double fire counts once. - The job: [WHAT IT SHOULD DO]. - Before anything that sends, pays, deletes or deploys, stop and ask me. Save my answer so a restart doesn't ask twice. - Show me how to run it under launchd on my Mac so it restarts after a crash or a reboot. - Don't add tools that write outside ./data.
Use once the first one survives a restart. This is Dan's formula, small.
Next to the others
Other pages on this site that this one leans on.
- Pi workflow How Armin Ronacher, one of Pi's makers, works with the Pi coding agent day to day.You want to use Pi itself well
- Guillermo Rauch's workflow fx, Vercel's small terminal agent and its library, with the brain-and-hands picture.You want another small harness to compare
- Autoresearch Leaving an agent running for hours or days on one goal.You want long runs, not always-on
- Jev The cheap classifier in both of Dan's builds, with prompts and the wiki.You want the filter in front of your agent
FakeNerd's take
Most people don't need it yet
If it's you in a terminal, plain Pi and pi --continue already cover a crash. Durable earns its keep when the agent runs without you: on a schedule, for customers, for a team.
Steal the habit even if you skip the library
Save what you're about to do before you do it. Mark what's safe to repeat. Give every send and every charge a one-time key. That's good practice for any agent or script.
Let your agent write the Durable code
Alejandro says it outright: don't hand-code this. The API moves every week. Point your agent at the README and the 32 examples, pin a version, and review what it writes.
Proactive is the engine, approval is the brake
Dan's demos sell the dream of agents that start before you show up. The part worth copying first is the stop: a saved wait for your yes before anything risky.
Attribution
- Pi Durable EXPLAINED: Build Always-On Agents with Local Models by Alejandro AO on the Hugging Face channel (Oct 19, 2026). The definition, the Pi family picture, the five-email example, the six steps and the restart demo are his, in our words. His demo repo has no license file, so this page links to it and quotes single lines only.
- Two videos by IndyDevDan: Pi Durable PROACTIVE Agents: Jev Triggers My ON-CALL Pi Agent (Oct 12, 2026) and My Jev Pi Durable Agent CURATES News: HYPE, FACT, or SIGNAL (Oct 19, 2026). Proactive agents, the formula and the in-near-out ladder are his. He sells courses (Tactical Agentic Coding, and a Phase 3 course in pre-sign-up) and plugs them in both videos; those parts are left out. He says he takes no sponsorships. His repos are MIT. Costs and claims about the big labs are his and were not checked.
- Pi and Pi Durable by Earendil, MIT. Package facts, code and quotes are from the announcement (signed Earendil Engineering), the Pi 1.0 post, and the package README and changelog, read Oct 19, 2026.
- Jev is made by TypeSafe. FakeNerd's own notes on it are on the Jev card.
- Captions were read, not the screen; where a caption and a repo disagreed, the repo won. The map's run-time split, the walkthrough wording, the examples grouping, the step order in Try it, the three starter prompts and the takes are FakeNerd's. Not sponsored by anyone on this page.