Pi - A Minimal Coding Agent
The coding agent behind OpenClaw. Four tools, less than 500 tokens of system prompt, yet incredibly powerful.
OpenClaw uses a coding agent called ‘Pi’ under the hood.
The implementation of this agent is quite interesting. It has only four tools - read, write, edit, and bash. Given how minimal it is, I wonder if an agent with just a bash tool could work pretty well too…
Pi not only has minimal tools, but its system prompt is also less than 500 tokens long. There are four sections - role(two sentences), available tools(four lines), seven short guidelines(even four of them are about tools), and where to find the Pi documentation.
Pi doesn’t even have a plan mode, and never asks for permission before dangerous tasks(ex: rm -rf). It doesn’t support MCP or most other features you’d expect from a coding agent.
But still it’s a powerful agent and I would say OpenClaw is just a wrapper of Pi.
Extensions
Since LLMs are good at writing code, Pi decided to actively leverage that ability. That’s why it doesn’t have many tools, but enough for writing code.
Pi keeps its core minimal and handles the rest through extensions. This powerful extension system can add all the features to Pi - plan mode, mcp, etc. On the front page of their official website, there’s even an example of Doom running on Pi via an extension.
One of the things that makes Pi so powerful is, it doesn’t have any safeguard(even though it can be added as an extension). It never hesitates to read and write files anywhere, even outside the project folder. Its own configuration files are no exception. It can even modify its own source code.
It can do almost anything with the computer(thanks to the bash tool). It can extend itself by adding extensions and skills. OpenClaw is essentially just Pi with a bit of added convenience.
The Name
The name ‘Pi’ is chosen since it’s quite common so that it can’t be searched easily.
pi-discord
By helping Claude Code, I’ve created a small repository that can run Pi on a Docker container and access it via Discord. One of the strong points of OpenClaw is that it can be controlled by messengers, and this feature can be implemented with Pi easily.
GitHub - polaris340/pi-discord
References:
- pi.dev
- It has another domain - shittycodingagent.ai
- x.com/badlogicgames