Repository navigation
Show and tell: Reducing token waste in REA workflows. What are you using? #1958
Replies: 4 comments 5 replies
|
TL;DR: I don't have token numbers either. What helps me most is splitting the work. One main agent plans, cheaper agents do the digging, and only short reports come back. Everything lands in files, so nothing gets found twice. Thanks, jaelliot, for starting this. I first picked up REA to help troubleshoot huge modpacks for single-player games. I liked the project a lot, so now I help by running tests on PRs and issues where I can. So my setup is a Linux test lab for REA pull requests, more than an RE lab. The context problems are the same, though. The box: Nobara 44 (Fedora-based), Ryzen 9 5900X, 32 GB RAM and a Radeon RX 6700 XT with 12 GB. I drive Claude Code from its extension in VSCodium (MIT), and from Paw, my own build of the foot terminal (MIT), inside tmux (ISC). My notes live in an Obsidian vault. What I run
Large REA results
What went wrong
A local model and REA#1065 counts REA's tool list at about 141k proxy tokens, before some later trims. My local code model has 32k, so MCP can't fit. #1669 would be one way in. So today I tried the CLI route. OpenCode (MIT) ran KAT-Coder with On this card the model reads prompts at about 320 tokens per second and writes about 26. Next I'll try with bash as its only tool. MeasurementsEdit: I counted my real token use from the session logs on my box. This covers all my agent sessions from October 9 to 11. Nearly all of it was REA testing. It also includes some small personal tasks that weren't REA, so the numbers are a bit muddied. Treat it as a rough count until I run a clean REA-only benchmark.
My other REA benchmark is MCP start-up time. If you share your baseline, I'm happy to run it on Linux. 🤖 Generated with Claude Code (Opus 5.5) 🦊 |
|
This is an interesting thread. Originally REA was designed as a proto codemode MCP but the thing is that most clients had built in forms of lazy loading for servers so tool context windows were no longer an issue. Search + execute doesn't work well as a surface for most agents, but I do think that programmatically allowing agents to interact with tools is something that's worth exploring. There was someone on localLLAMA that had modified his REA MCP's ghidra bridge to allow for this. Just sharing my 2 cents on it |
|
A suggestion for the planned single-agent versus coordinator/helper comparison: keep unsuccessful and inconclusive tasks in the cost total. Tokens per verified finding can look better if a setup quietly stops tackling the hard cases. I would keep one row per fixed task: outcome (verified, unknown, or incorrect), fresh input, cached input, output, and wall time. Aggregate the coordinator and every helper, including startup and failed attempts. Separate cold-start and resumed-session results, since reused analysis is part of what you are testing. I have not benchmarked REA, so this is a proposed measurement layout, not a savings claim. Written with Codex assistance. |
|
Managing token consumption with large decompilation outputs is a very real challenge. Dumping full function inventories or large cross-reference graphs into the context window burns through tokens quickly and often dilutes the agent's focus. One approach that helps significantly is shifting from a "push" model (dumping context) to a "pull" model using retrieval. By indexing the decompiled code and function metadata locally, you can give the agent tools to search and retrieve only the specific snippets it needs at that moment. Hybrid search is particularly effective for reverse engineering—you need exact keyword matching (BM25) for specific registers, memory addresses, or symbol names, combined with vector search for semantic queries like 'find the encryption initialization routine.' If you're looking for tools to back this, I've been using Infino. It's an open-source retrieval engine that runs embedded (in-process, like SQLite), so you don't have to manage a separate search cluster for your personal RE lab. It handles hybrid search over Parquet files and includes an MCP server ( Disclosure: I work on Infino. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hey everyone,
I've recently contributed to REA's generic MIPS and PSP/Allegrex support ([#1362](#1362) and [#1599](#1599)), and I've been building a personal reverse-engineering lab around REA, Ghidra, and Codex.
One thing I'm particularly interested in is reducing LLM token consumption during reverse engineering.
These investigations can become pretty context-heavy. Between large decompilation results, function inventories, cross-references, tool responses, and agents repeatedly exploring the same code, it's easy to consume a substantial amount of tokens without necessarily making much progress.
I've been experimenting with a few approaches in my other development work and am now adapting them to my RE lab.
What I'm currently working with
The source-code tooling has been useful in my other projects, although I'm still integrating and benchmarking the overall approach in my reverse-engineering environment.
I'm also working on more disciplined agent workflows: limiting investigation scope, using appropriate models and reasoning effort, maintaining checkpoints between sessions, and keeping large raw analysis artifacts outside the model's context until they're actually needed.
What I'm curious about
How are other people optimizing their REA workflows for token efficiency?
I'd be especially interested in hearing about approaches to managing large Ghidra results, caching analysis across sessions, reducing repetitive MCP calls, and keeping agents focused during long-running investigations.
Are there other MCP servers, code-intelligence tools, caching mechanisms, or agent-harness features that you've found particularly effective?
I'm also curious whether anyone has benchmarked these approaches against actual token usage rather than just output size. Fewer bytes and fewer tool calls are useful, but ultimately I'd like to measure something closer to tokens per verified finding, while preserving correctness.
I don't think the goal should be to make REA return less information indiscriminately. It's more about ensuring the agent retrieves the right information, at the right time, without unnecessarily repeating work.
I'd be interested in hearing what people have tried, what has worked, and what hasn't. If anyone has benchmark results or an interesting setup, I'd love to take a look.
I'm planning to run some controlled comparisons in my own lab and would be happy to share the results as that work progresses.
All reactions