frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Open-Sourced Code Mode to Cut ~60% of My Rust Agent's Token Burn

https://github.com/legend-of-alan/ghostmode
1•legend-of-alan•13m ago
For those who are tracking, Anthropic released an announcement last week about their experimental code mode for Claude Code, claiming some bonkers token savings when it comes to tool calls (95% on some workloads(1)). I haven't benchmarked it myself, but independent studies come in somewhere closer to 60~70% savings (2), but I digress. TLDR; I built an open-source version for the community.

Context: I'm writing an AI RPG engine called Spookery, and I immediately wanted to try this technique for myself when I heard of it. Agent deployment is currently dominated by token costs, especially during tool calling (single prompt generating tens or hundreds of tool calls). Unfortunately, it looks like the only ones who are doing this seriously are big agentic products like Claude Code and Codex. So, I thought it'd be fun to try it myself and bring it to you all!

The idea of Code Mode is simple but powerful. Instead of passing back tool call results back to the LLM one at a time, let the LLM batch calls by letting it write a short script using your tools. Basically taking 30 trips to the grocery store for 30 items and turning it into one trip to the store with a list in-hand.

There's a few near-ish open-source options, but they used TypeScript backends, we're a little boilerplate heavy, and I wanted to have something a little faster and Rust friendly for my game engine. Pydantic's Monty seemed a good candidate--their self-reports are around 5x faster on execution and 100x faster on startup (3). I wouldn't take the numbers to the bank, but it's written on a Rust framework and the python backend is entirely built from Rust too.

Anyway, I had a couple of days off unexpectedly. So, I went temporarily insane and built a Rust tool to bring code mode to the greater community for free. In enough days to fit on one hand (and just as many hours of sleep), I came up with the implementation linked. I call it Ghost Mode. It's MIT licensed. It's a drop-in for your agent that already makes traditional tool calls. With ~20 lines of setup, you can convert your existing agent to a Code Mode agent.

I hope you get something out of this, and maybe I can save you some money. Considering how limiting token economics are right now, I think this could be a game changer for the industry. If there's interest, I can imagine we can build also add some great new features, language compatibility, and other great things. Thanks for reading :)

Sources: (1) https://www.marktechpost.com/2026/11/17/anthropic-claude-cod... (2) https://arxiv.org/abs/2611.19123 (3) https://pydantic.dev/docs/monty/get-started/

Curves and Surfaces (2021)

https://ciechanow.ski/curves-and-surfaces/
1•Letterui•1m ago•0 comments

Kimi for Science More scientific ideas, made possible

https://www.kimi.ai/news/kimi-for-science-program
1•theanonymousone•1m ago•0 comments

We migrated agent-swarm from SQLite to Postgres

https://www.agent-swarm.dev/blog/sqlite-to-postgres-in-six-days
1•tarasyarema•1m ago•1 comments

Show HN: Unterm v0.73 – Pure-Rust GPU Terminal Built for Claude Code, Codex, Agy

https://unterm.app/
1•zhitong45•2m ago•0 comments

Nvidia Blackwell Chips Turn Up at China Site Tied to Alice Huang

https://www.bloomberg.com/news/articles/2026-11-27/nvidia-blackwell-chips-turn-up-at-china-site-t...
1•dgellow•2m ago•0 comments

Doing It the Hard Way

https://terraformindustries.wordpress.com/2026/11/04/doing-it-the-hard-way/
1•surprisetalk•4m ago•0 comments

Show HN: A 307M encoder that flags 23 logical fallacies in 40ms on CPU

https://didistutter.dev/
1•ekkuleivonen•6m ago•0 comments

Magi-2: A 480B Frontier Video Generation Model

https://www.youtube.com/watch?v=in5bRvId5BM
1•s_u_d_o•6m ago•0 comments

Tower of HN

https://towerofhn.taptappers.club/
1•rounakdatta•7m ago•0 comments

AI is eroding my coding skills, and I don't care

https://flaviocopes.com/ai-eroding-coding-skills/
1•HowardLien•10m ago•1 comments

Reminder to not trust domain names

https://www.timeshighereducationranking.com/
1•kopje_koffie•10m ago•0 comments

Show HN: Askama-analyzer – LSP support for Askama templates

https://github.com/radiosilence/askama-analyzer
1•antihero•11m ago•0 comments

Hackers breach US Air Force flagship Cloud One computing platform

https://www.reuters.com/world/hackers-breach-us-air-force-flagship-cloud-one-computing-platform-2...
1•pseudolus•11m ago•0 comments

Show HN: Open-Sourced Code Mode to Cut ~60% of My Rust Agent's Token Burn

https://github.com/legend-of-alan/ghostmode
1•legend-of-alan•13m ago•0 comments

New September – discussions over real NNTP, chat over real IRC

https://newseptember.org
1•noraataco•15m ago•0 comments

Building apps is a system design exercise

https://blog.jacobstechtavern.com/p/apps-system-design
1•jakey_bakey•15m ago•0 comments

AI Finds 28 Zero-Day Flaws in Physical Robotics Software

https://spectrum.ieee.org/zero-day-robotics-vulnerabilities-vicone-security
1•rbanffy•17m ago•0 comments

Agentic system personalizes physical controls to help users "DJ their art"

https://www.csail.mit.edu/news/agentic-system-personalizes-physical-controls-help-users-dj-their-art
1•andsoitis•18m ago•0 comments

Cybersecurity Incident at SAP (De)

https://www.heise.de/news/IT-Vorfall-bei-SAP-Entwicklungssysteme-betroffen-11539973.html
2•ludikoff•19m ago•0 comments

A new form of memory helps robots learn complex skills

https://www.csail.mit.edu/news/new-form-memory-helps-robots-learn-complex-skills
1•andsoitis•20m ago•0 comments

Instinct refuses a user's command to disconnect its connectors

https://twitter.com/asafchohen/status/2126054663732564322
1•shmulc•21m ago•0 comments

To adapt an AI model to a small device, keep its training notes concise

https://www.csail.mit.edu/news/adapt-ai-model-small-device-keep-its-training-notes-concise
1•andsoitis•22m ago•0 comments

Nvidia chip buyers told to rule out Chinese renters

https://www.cnbc.com/2026/11/26/neoclouds-nvidia-china-ai.html
5•goatley•22m ago•0 comments

Pizza history: AI agent's cardless purchase is a first for UK

https://www.theguardian.com/business/2026/nov/27/ai-agent-cardless-transaction-pizza-papa-john-uk...
2•6LLvveMx2koXfwn•23m ago•0 comments

Show HN: IQ test" small brainteaser game

https://spa-mvc-pages.duckdns.org/spelhörnan/iq/iq.html
1•joexo•25m ago•0 comments

From Jira to OpenProject: A major milestone for digital sovereignty in Germany

https://www.openproject.org/blog/itzbund-jira-alternative-openproject/
2•Lapel2742•25m ago•0 comments

Advent of Code 2026

https://adventofcode.com/
1•ViktorasJucikas•28m ago•0 comments

The Techlash Is Back

https://dl.acm.org/doi/10.1145/3850023
2•rbanffy•28m ago•0 comments

SNAFUcatchers Workshop on Coping with Complexity

https://snafucatchers.github.io/
1•gtirloni•30m ago•0 comments

60,778 open math problems. Point your agent at one

https://lefttosolve.com/
1•Luc•31m ago•0 comments