Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/buzzer-re/rikugan/binja-scriptingnpx skills add buzzer-re/Rikugan --skill binja-scriptinggit clone --depth 1 https://github.com/buzzer-re/RikuganWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/buzzer-re/rikugan/binja-scripting)<a href="https://agentmods.dev/skills/buzzer-re/rikugan/binja-scripting"><img src="https://agentmods.dev/badge/skills/buzzer-re/rikugan/binja-scripting.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00017 | $0.02835 |
| Opus 5 | $0.00009 | $0.01418 |
| Sonnet 5 | $0.00003 | $0.00567 |
| Haiku 4.5 | $0.00002 | $0.00283 |
Grade A, and why
Binary Ninja Scripting scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- Process execution (subprocess, os.system, etc.) is blocked. Static analysis only. How it starts
The opening of the file, as written. The whole thing — 315 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Task: Help the user write Binary Ninja Python scripts. You have execute_python which runs code with bv (the current BinaryView), binaryninja module, and current_address pre-loaded.
Guidelines
- Use
print()for all output — it's captured and returned to you. - Prefer the Binary Ninja Python API over raw tool calls when the task requires iteration, filtering, or complex logic that a single tool can't express.
- Always handle
Nonereturns (e.g.,bv.get_function_at()returnsNoneif no function at that address). - Use
bv.update_analysis_and_wait()after bulk modifications (defining types, creating functions). - For large outputs, summarize or paginate — don't dump thousands of lines.
- User types (
define_user_*,add_user_*) persist to the database; auto types may be overwritten by analysis. - When modifying the database (renaming, retyping, creating structs), prefer
_user_methods.
Environment
The execute_python tool provides:
bv— the activeBinaryViewbinaryninja— the fullbinaryninjamodulebinaryninjaui— UI module (if available)current_address— cursor address (int, 0 if unavailable)- Full Python stdlib (except subprocess/os.exec — blocked for safety)
Quick Reference
Reading Data
data = bv.read(addr, length) # raw bytes
val = bv.read32(addr) # 32-bit int
ptr = bv.read_pointer(addr) # pointer-sized int
strings = bv.get_strings() # all StringReference objects
s = bv.get_string_at(addr) # single string
Functions
func = bv.get_function_at(addr) # exact start
funcs = bv.get_functions_containing(addr) # containing addr
funcs = bv.get_functions_by_name("main") # by name (list)
bv.add_user_function(addr) # create function
func.name = "NewName" # rename
func.type = Type.function(ret, params) # retype
func.set_comment_at(addr, "note") # comment
IL Access
# Three levels: llil < mlil < hlil (prefer hlil for analysis)
for inst in func.hlil.instructions:
print(f"{hex(inst.address)}: {inst}")
# SSA form for data flow
defn = func.hlil.ssa_form.get_ssa_var_definition(ssa_var)
uses = func.hlil.ssa_form.get_ssa_var_uses(ssa_var)
# Navigate between levels
llil_inst = func.get_llil_at(addr)
hlil_from_llil = llil_inst.hlil
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 315 lines · 17 tokens per session scan A 406542b25009
Binary Ninja Scripting is a skill published in the GitHub repository buzzer-re/Rikugan (672 stars, last pushed 2mo ago), licensed MIT. It adds 17 tokens to every session and 2,835 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
python-docs
Comprehensive Python 3.13 reference covering all language features: variables, built-in types, strings, control flow, functions, lambdas, decorators, classes, inheritance, dataclasses, enums, metaclasses, collections (list, dict, set, tuple, comprehensions), modules and packages, pip, venv, exceptions, context…
scripting-reference
Python for Rhino and Grasshopper (RhinoCommon, rhinoscriptsyntax, ghpythonlib), C# for Grasshopper components, Python for Revit (pyRevit, RevitPythonShell), JavaScript for web 3D (Three.js), and code patterns for AEC computational design.
scripting-reference
Python for Rhino and Grasshopper (RhinoCommon, rhinoscriptsyntax, ghpythonlib), C# for Grasshopper components, Python for Revit (pyRevit, RevitPythonShell), JavaScript for web 3D (Three.js), and code patterns for AEC computational design.
matlab
Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.
pennylane
Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with…
python-feature-lifecycle
Guidance for package and feature lifecycle in the Agent Framework Python codebase, including stage meanings, feature-stage decorators, feature enums, and how to move APIs from one stage to the next.