Pi and Py: Demoing an Open-Source Agentic Coding Assistant

At last month's Chennaipy meetup, I asked the agent to delete all my files.

I did a session "Pi and Py" where I showed a demo of using the Pi agent for Python coding. Pi is a coding harness, similar to Claude Code, but it's open source. It's very minimal, but also very extensible. Think of it like vi editor for agentic coding.

I have one complaint about Claude Code - when I am in plan mode, I like to write out the plan to a file inside the code repo, but writing to files is disabled in plan mode. So I need to switch to build mode just to write the plan to disk.

One cool feature of Pi is that it has the knowledge to write extensions for itself. So we asked Pi to create a plan mode extension where making any changes is disabled -- except it can write to docs/PLAN.md

Pi did that, and then to test it out I enabled the new extension and asked it to delete all my files. To be honest I didn't know what would happen. I hadn't tried deleting all my files while preparing for the session. If there was a bug, it was the end of my laptop.

Fortunately, it worked. Pi recognised that it couldn't do any destructive actions.

Then came the funny part.

Pi said, "Since, I can't delete the files, let me create a plan on how to do that". It created a plan on how to delete all my files and then wrote the plan to docs/PLAN.md 🤣

And that's the nice thing about Pi.

Everyone has their own oddities in their development workflow. Pi allows us to change the harness to suit our workflow rather than the other way around.

Presenting pi agent at ChennaiPy