Kuna: Decompiler Development in the Age of Coding Agents
TL;DR Highlight
An LLM-written decompiler, Kuna, nearly matches IDA Pro on control flow structuring
Who Should Read
A backend or tooling developer curious how to hand a large project to coding agents and improve quality automatically
Core Mechanics
- An LLM wrote nearly all the code
- Kuna is an experimental decompiler that turns binaries back into C code.
- The author says an LLM wrote nearly every line.
- Structuring score is near IDA
- On C programs, Kuna perfectly structures 44.4% of functions (control flow structuring recovers if, loop and switch).
- IDA Pro 9.2 gets 45.7%.
- The secret is an autonomous refinement loop
- The LLM studies cases where it performs worse than IDA Pro.
- It learns by trial and error how other decompilers solve hard problems.
- 20+ angr features reimplemented
- Ghidra and the angr decompiler were also studied in the process.
- This let the LLM reimplement more than 20 fundamental angr features in Kuna.
- Human-led research came first
- Starting automatic refinement required new fundamental metrics and meaningful benchmark data.
Community Reactions
- Creator explains the Ghidra origin
- The creator says Kuna started as Ghidra ported to Rust and has changed considerably.
- The Switch layout and some variable simplification in the site screenshot are not Ghidra features.
- Pushback: why not train an LLM to be the decompiler
- One commenter argued compilers can generate unlimited training data.
- The creator replied that this has been tried for two decades with no project beating traditional decompilers on fundamental metrics.
- Interest in agentic naming of functions and variables
- A commenter hoped agents could track data flow and propose names.
- The creator said on DecBench, Codex and Claude given only assembly dominate but have significant recall problems.
How to Apply
- Start a loop with a failure-case set
- Collect 5 cases today where your coding agent does worse than a reference tool.
- Attach the reference output and metric to each and ask the agent to analyze the gap.
- Define a measurable metric first
- Design the metric and benchmark data yourself before handing improvement to an agent.
- Have the agent automatically verify only that the score goes up.
- Use an existing tool as a teacher
- When reimplementing a feature, give the agent input/output examples from a mature open-source version.
- Check the license first.
Try It
# Paste into Claude or Claude Code as is (simplified version of the article's method)
You are an agent improving {{our tool}}. The reference tool is {{reference tool}}.
The metric is {{metric name}}.
Below are cases where our tool scores lower than the reference.
{{failure cases and both outputs}}
Do the following in order.
1. For each case, analyze why the reference does better.
2. Pick one common pattern and propose a fix for our code.
3. Write a test that checks the metric improves after the fix.
Next step: re-measure the score after the fix and repeat with the remaining failures.Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.