Show HN: Open-Sourced Code Mode to Cut ~60% of My Rust Agent's Token Burn
Category: ai-ml
Tags: ai-agents, code-mode, token-optimization, rust, mcp, python-sandbox
Score: 6.3/10 (Innovation: 6, Technical: 7, Documentation: 7, Utility: 5)
Ghost Mode is a Rust library that implements the Code Mode pattern for AI agents: instead of round-tripping every tool result back to the model, the model writes a short Python script that chains tool calls, and only the final result is sent back, cutting token usage. It embeds Monty (a Python interpreter) in-process with an optional worker-pool backend for untrusted scripts, supports MCP and OpenAI tool schemas, and has signed session dumps.
Target audience: AI/agent backend developers working in Rust
Repository: https://github.com/legend-of-alan/ghostmode · Rust · MIT · 15 stars
View on Hacker News