Building Pie: Just Because I Could

A nuanced look at why I built a minimal AI agent, and the practical workflows it enables.


For the past few months, I’ve been working on a new kind of AI assistant called Pie.

If I’m being completely honest, I built Pie primarily just because I could. There’s something uniquely satisfying about stripping away the complexity of modern AI interfaces and seeing what happens when you build a tool from the ground up to be exactly what you need. While interactive agents like Claude and ChatGPT are incredible, they solve a very broad set of problems, and that generality often leads to “session bloat”—where you’re paying for thousands of tokens of context just to make a one-line change.

I built Pie to explore a different path. Heavily inspired by pi-mono, Pie is a deliberately minimal agent. No bloated MCP support, no massive system prompts—just a lean, surgical tool for getting work done.

What is Pie?

Pie is an interactive agent by default, but its real power lies in its non-interactive mode. It’s designed to be a “Swiss Army Knife” for AI-powered workflows.

While it’s great for avoiding the cost of a long Claude session, that’s just the beginning. I’ve found it incredibly useful for:

  • Agent Orchestration: Using Pie inside other agents. If you’re running a complex agentic workflow, you don’t always need a heavy-hitter for every sub-task. You can spawn Pie to handle a specific, bounded operation.
  • CLI Scripting: Automating repetitive tasks. Because Pie is fast and CLI-native, you can pipe code into it, have it refactor or document it, and pipe it right back out.
  • Rate-Limit Fallback: When your primary Claude or ChatGPT limits hit, Pie is perfect for auto-rotating through various APIs to keep your momentum going without context loss.
  • Rapid Prototyping: Sometimes you just want to test a prompt or a small piece of logic without starting a new browser session or a heavy IDE instance.

The goal isn’t to replace the industry giants. Instead, Pie is a complementary CLI for the “middle and low complexity” tasks. While you use the heavy-hitter models for high-level architectural decisions, Pie handles the surgical edits, documentation lookups, and quick tests.

The Mission: AI for Everyone (Accessible)

The main goal behind Pie is to make access to AI accessible to everyone.

Cost is a huge barrier to entry for high-end AI tools. By focusing on surgical tasks and efficient context management, Pie reduces token usage wherever possible. It’s about being smart with how we use these models, ensuring we aren’t “context-poisoning” our sessions with noise just to change a CSS variable or refactor a small utility function. Making it lean makes it accessible.

What I’ve Accomplished So Far

  • Dual-Mode Architecture: A seamless transition between a focused interactive loop and one-shot scripting.
  • Sub-Agent Orchestration: Pie can already spawn and coordinate sub-agents to handle parallel or specialized tasks.
  • Token Efficiency: A focus on minimal history and precise context injection to keep costs down.
  • Skill System: Ready-to-use skills for codebase audits, document lookup, and code simplification.

The Long Game: An Autonomous Copilot

While Pie is currently a surgical tool, the eventual goal is to transform it into a truly autonomous agent.

I want Pie to work on its own, like a real copilot that doesn’t just wait for instructions but can proactively handle chunks of work. Whether it’s managing a refactor across several files or independently verifying a bug fix, the vision is a tool that understands the “why” as much as the “how.”

What’s Next?

Building an agent is an iterative process. Here’s what I’m focusing on for the next version:

  1. Cost-Aware Routing: I’m currently working on logic to automatically choose the cheapest model capable of handling a specific sub-task.
  2. Regression Testing: Defining a robust testing suite is a high priority so I can catch regressions in agent behavior as the system evolves.
  3. LSP Integration: Adding semantic understanding via LSP to make codebase navigation even more precise.
  4. Reasoning Visualization: A way to see how Pie reached a conclusion, making it easier to trust its output.

Pie is about making AI agents sustainable and accessible for daily developer workflows. It’s not just about having an AI that can code; it’s about having a teammate that helps you build better, faster, and cheaper.

If you’re interested in checking it out, follow me on GitHub for updates!


Headshot of Dinesh Bhattarai

Hi, I'm Dinesh. I'm a software engineer based in Kathmandu. You can connect with me on Linkedin, see some of my work on GitHub, or read more about me on dbhattarai.info.np.