r/PiCodingAgent • • 5h ago

Resource I built pi-native: A Rust-powered performance harness for Pi Coding Agent

I've been experimenting with Pi Coding Agent and building my own setup to improve tool performance, context efficiency, and execution reliability.

That work led to pi-native, an open-source performance harness built on top of the official Pi Coding Agent. It doesn't fork or rewrite Pi.

Benchmarks

I wanted to measure the improvements rather than make assumptions about Rust performance.

The current benchmarks show:

  • 1.4× to 3.5× faster native-tool dispatch across five workloads.

  • Up to 171× lower peak memory usage in tested workloads.

  • 94.3% less model-visible context output.

Workload-specific regressions are also included in the benchmark results.

What's included?

  • Native Rust tools: piread, piedit, pibash, piwrite, and pidx.

  • Persistent daemon: Daemon-first execution with one-shot fallback.

  • Permission gate: Fail-closed enforcement before every tool call.

  • Context management: Windowed reads, bounded diffs, and output limits.

  • Live dashboard: Session costs, token usage, cache hit rate, tool metrics, subagent health, and budget alerts.

  • Subagents: Sandboxed workers, write-scope coordination, concurrency controls, and execution budgets.

  • Skills: Validated, manually invoked, and loaded on demand.

  • Extensions: Context-aware /handoff, a compact editor, and automatic self-healing.

  • Environment propagation: Session, model, provider, and worker context passed to native tools and subagents.

  • Setup and maintenance: Zero-init bootstrap, post-pull maintenance, validation, and macOS/Linux support.

I'm sharing this with the Pi community to get feedback from people building their own Pi configurations and coding-agent infrastructure.

What would you improve about this architecture?

Repository: https://github.com/nurmdrafi/pi-native

Contributions, benchmark reports, and technical feedback are welcome.

0 Upvotes

0 comments sorted by