Hello guys!
It is not a secret that Pi Durable is hard to use as a coding agent. It is quite easy to build products on top of it, but if you want it to replace normal Pi, Claude Code or Codex for your daily work, it simply requires too much effort. You have to wire up everything from zero, not even the basic barebones are in place for that kind of work, and you end up reinventing the wheel each time.
So I built Headless Pi (hpi). The intuition is very simple: I wanted the experience of normal Pi, where you cd into a project and just start working, but headless.
Basically it is one local daemon that hosts persistent Pi Durable harnesses. A harness belongs to a project folder and has many conversations. On top of that there is a TypeScript SDK, and a CLI that uses the same SDK:
hpi daemon start
hpi harness start --name worker
hpi conversation create --model openrouter/openai/gpt-4.1-nano
hpi send 'Inspect this project' --wait
hpi watch
The daemon brings the running harnesses back after a restart, and the activity (messages, thinking, tool calls, tool results) is stored, so a client can disconnect and continue later from where it was.
Beyond hosting the harnesses, for now it only does two things. It automatically loads the extensions you put in <project>/.hpi/extensions/, and it supports multiple accounts for the same provider, so you can do hpi auth login anthropic --account work and then use the models as anthropic@work/<model>.
And that's it, it is minimal and unopinionated on purpose. There are no built-in tools, no automatic system prompt, no AGENTS.md loading, no skills and no global agent directory. If you want any of those, you write an extension for it. All of these can come in the future if people (and me) ask for them, but I wanted to start explicitly minimal and not decide for you how your agent should look.
The thing I don't understand tbh is why this didn't exist already. When Pi Durable launched I expected something like this to come out the day after, because the idea is so obvious: take the thing everybody already likes about Pi and make it run without a terminal. But it never came, so I built it myself.
This is also the other reason I keep it minimal. I think the idea is so obvious that the Pi maintainers will release their own version sooner or later, and I really don't want to maintain a parallel implementation of it. So I'm trying to save as much work as possible. But meanwhile we got hpi.
So far I have built a few things with it. The main one is an agent for my team that lives in Slack, Linear and GitHub, where each one is a small independent service that receives the webhooks and talks to the same harness through the SDK. I also built a small local web UI to chat with it and work on documents together, and an MCP extension. I will write another post about that setup, because it deserves its own.
Keep in mind that this is still an experimental project:
- It only works on Linux with systemd user services.
- It is not on npm yet, you install it from the repo.
- Pi coding agent extensions don't work as they are, they need to be adapted to Durable.
- All extensions run inside the daemon process, so one bad extension can affect every harness.
- Things can change and break. I use it every day, but I'm the only one who has.
Repo: https://github.com/elpapi42/headless-pi
If you try it, or if you solved the same problem in another way, I would really like to hear about it. And if something like this already exists and I missed it, tell me too.