Overview
Have Claude Code write and run Ghidra scripts in automated mode to list functions, decompile the interesting ones and draft notes on what a binary you are allowed to analyse does.
Problem or Objective
More in Security Research
AI Agents and Models
Tools and Integrations
- Tools
- Claude Code · Ghidra · Python
- Prerequisites
- Ghidra with its prerequisites, Claude Code (most surfaces require a Claude subscription or Anthropic Console account), and an isolated virtual machine for unknown binaries.
How It Works
Work on a binary you own or are authorised to analyse, inside an isolated virtual machine with Ghidra and Claude Code installed. Create a working folder with the binary and an empty notes file, and start Claude Code there. Ask it to write a small Ghidra Python script that imports the binary into a new project in Ghidra's automated mode and exports the list of functions, imports, strings and entry points to text files, then run it with your permission. Read the lists together, pick the functions worth a closer look, and ask for a second script that decompiles only those and saves the output. Ask Claude Code to draft notes on what each function seems to do, quoting the addresses it relied on, and to mark guesses clearly. Open the same functions in Ghidra's interface yourself to confirm the notes before relying on them.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Claude Code, Ghidra.
- Connect the toolsConnect the tools this workflow relies on: Claude Code, Ghidra, Python.
- Check the prerequisitesGhidra with its prerequisites, Claude Code (most surfaces require a Claude subscription or Anthropic Console account), and an isolated virtual machine for unknown binaries.
- Gather your detailsCollect what the prompt asks for: Binary you are allowed to analyse, Ghidra install folder, What you want to understand.
- Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at github.com before you rely on it.
Practical Starter Prompt: Script a first pass over a binary in Ghidra
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
In this folder is [Binary you are allowed to analyse], which I am authorised to analyse. Ghidra is installed at [Ghidra install folder]. Write a Ghidra Python script that imports the binary into a new project in automated mode and exports the functions, imports, strings and entry points to text files in ./out. Show me the command before running it and wait for my approval; I will review each command. Then help me choose functions related to [What you want to understand], write a second script that decompiles only those, and draft notes in notes.md with the address behind every claim and guesses marked as guesses. Do not modify the binary.Run this in an isolated virtual machine, approve each command after reading it, and confirm the notes in Ghidra's interface before relying on them.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The Ghidra README supports disassembly, decompilation and scripting in Java or Python, in both interactive and automated modes, and the Claude Code pages support running shell commands with permission. No cited page documents a ready-made bridge between the two, and nothing here measures speed or cost against manual analysis.
Limitations and Considerations
Analyse only software you are allowed to, and do not use this to defeat licence checks or copy protection. Keep unknown or suspicious binaries in an isolated virtual machine with no access to your own files or accounts. In Manual mode the Bash tool asks for permission, except for a built-in set of read-only commands; read each Ghidra command before allowing it. Decompiled code and the model's notes can be wrong, so confirm important findings in Ghidra yourself. If you prefer a community bridge that exposes Ghidra to the agent as tools, check its source and permissions first; none was verified here. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Related Videos
About NationalSecurityAgency/ghidra
GitHub’s top: Copy any app, create gorgeous videos, 3d print anything & more (opens in a new tab)
The description links the GitHub repository.
Watch on YouTube (opens in a new tab)About anthropics/claude-code
The SECRET Claude Code Upgrade That Has Everyone Going Nuts (Full Guide) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)About anthropics/claude-code
The only Claude Code guide you'll ever need (Opus 4.5) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- NationalSecurityAgency/ghidra README (opens in a new tab)
Project documentation · github.com · Undated · Source checked 25 Nov 2026, 12:00 UTC
What this source supports
- Ghidra supports a wide variety of processor instruction sets and executable formats and can be run in both user-interactive and automated modes.
- Users may also develop their own Ghidra extension components and/or scripts using Java or Python.
- Overview - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:57 UTC
What this source supports
- Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools.
- Most surfaces require a Claude subscription or Anthropic Console account.
- Tools reference - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 12:10 UTC
What this source supports
- To control which tools Claude can use and when it asks first, configure permission rules in your settings, hooks , or a subagent’s tool list .


