pulseaiclub/phi
a coding agent, rpc plugin, sub-agents, hashline edits, and mcp
What it solves
phi is a high-performance, lean terminal coding agent harness designed to provide a fast, low-overhead alternative to heavy AI coding assistants. It solves the problem of high resource consumption (RAM/CPU) and slow startup times typically associated with Electron or Python-based AI tools, while providing a safe, extensible environment for LLMs to interact with a local codebase.
How it works
Built in Go, phi operates as a TUI (Terminal User Interface) that connects to OpenAI-compatible or Anthropic models. It provides the LLM with a set of core tools (read, write, edit, bash, grep, find, ls) to manipulate files and execute commands. To maintain efficiency and safety, it employs several key mechanisms:
- Hashline Edits: Instead of rewriting entire files, the model uses anchors (tags and hashes) to perform precise edits, preventing silent corruption.
- Sub-agents: It can spawn isolated jobs with specific roles (explore, review, worker) to handle complex tasks without bloating the parent session's context.
- Lazy MCP Integration: It integrates with Model Context Protocol (MCP) servers without dumping all tool schemas into the prompt, using meta-tools to discover and call tools on demand.
- Permission Gating: A configurable policy (interactive, readonly, autopilot, headless-strict) ensures destructive tools are approved by the user before execution.
- PXB Protocol: A custom binary protocol allows native extensions written in Go or Rust to add tools and commands with minimal latency.
Who it’s for
phi is for developers who prefer terminal-based workflows and require a lightweight, fast-starting AI agent that can be integrated into their existing CLI tools and project structures.
Highlights
- Extreme Efficiency: Small binary (
15 MB) and very low idle RAM (21 MB) with near-instant startup (~31 ms). - In-TUI Diff Review: A full-screen git review overlay for reviewing and noting changes before applying them.
- Extensible Architecture: Supports native extensions in Go and Rust via the PXB protocol.
- Model Agnostic: Works with any OpenAI-compatible or Anthropic model.
- Context-Aware Skills: Allows users to define reusable procedures in Markdown files (SKILL.md) to guide the agent's behavior.
Related
- Project
- Project
- Project
- Project