Ships in bnsql. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use SELECT name FROM pragma_function_list for the live function list. The
catalog below is canonical for v0.0.14 but verify against the runtime when in
doubt.
| Class | Cost | Examples | Use case |
|---|---|---|---|
| Fast (pure SQL) | µs | hex, printf, json_* | Anywhere |
| Moderate | ms | disasm(addr) | Small result sets |
| Slow (one BN API call per row) | ms × N | func_start, func_at, func_end, name_at, xrefs_to, xrefs_from | Single-address lookups only |
| Very slow (decompiles function) | seconds | decompile(addr) | Single function only |
Rule: Don't put slow UDFs inside bulk SELECTs over many rows. Use
pre-computed views (callers, callees) or pre-computed columns
(xrefs.from_func) instead.
| Function | Description |
|---|---|
disasm(addr) | Single-instruction disassembly text |
disasm(addr, count) | Up to count disassembly lines (capped at 1000) |
mnemonic(addr) | Instruction mnemonic only |
operand(addr, index) | Zero-based disassembly operand text, or NULL |
Byte reads use the bytes table:
SELECT hex(blob_concat(value)) FROM (SELECT value FROM bytes WHERE start_addr = X AND n = N ORDER BY addr)
(or blob_concat(value) for BLOB).
| Function | Description |
|---|---|
byte_search(pattern) (table) | All matches — FROM byte_search(...) → addr, matched_hex, matched_bytes, size |
byte_search(pattern, start, end) (table) | Matches within [start, end) |
search_first(pattern) (scalar) | First match address (or NULL) |
See the data skill for pattern syntax (?? / 4? FlexHex wildcards).
| Function | Description |
|---|---|
name_at(addr) | Name at address (or NULL) |
func_at(addr) | Function name containing address |
func_start(addr) | Start of containing function |
func_end(addr) | End of containing function |
func_qty() | Total function count |
func_at_index(n) | Function address at index n |
| Function | Description |
|---|---|
xrefs_to(addr) | JSON array of xrefs TO address |
xrefs_from(addr) | JSON array of xrefs FROM address |
For bulk xref work, query the xrefs table or callers / callees views
directly — these UDFs are for single-address lookups.
| Function | Description |
|---|---|
next_head(addr) | Next defined item |
prev_head(addr) | Previous defined item |
segment_at(addr) | Segment name at address |
| Function | Description |
|---|---|
comment_at(addr) | Get comment at address |
set_comment(addr, text) | Set comment (requires save() to persist) |
| Function | Description |
|---|---|
set_name(addr, name) | Set name at address |
save() | Persist in-memory edits to disk (explicit-save model) |
| Function | Description |
|---|---|
decompile(addr) | Full-function HLIL text |
decompile(addr, limit) | Limit-aware variant |
decompile(addr, limit, refresh) | Optionally reanalyze before rendering |
hlil_at(addr) | First HLIL expression rendered at an address |
hlil_op_at(addr) | Native HLIL operation name at an address |
| Function | Description |
|---|---|
entities_search(pattern[, limit][, offset]) | JSON entity search; limit defaults to 50 and is capped at 500 |
get_ui_context_json() | Live GUI context JSON — view kind + IL level, cursor, selection, highlight, split panes[]; works whether or not BN is focused. Stable unavailable envelope headlessly |
bnsql_python(code[, sandbox]) | Gated Python snippet execution (all runtimes, headless included); see the python skill |
bnsql_python_file(path[, sandbox]) | Gated Python file execution (all runtimes, headless included); see the python skill |
| Function | Description |
|---|---|
blob_concat(value) | Concatenate BLOBs or integer bytes (0–255); NULL inputs are skipped |
| Function | Description |
|---|---|
hex(val) | Format integer as hex string |
printf(fmt, ...) | Standard SQLite printf |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub 0xeb/bnsql-skills --plugin bnsqlOther plugins' skills for the same job
11 skills in this plugin
/analysisBNSQL analysis workflows: triage, security audit, crypto/network detection, multi-table queries./annotationsEdit Binary Ninja databases: comments, renames, types, patches. Mutations require SELECT save() to persist (explicit-save model, v0.0.9+)./connectConnect to Binary Ninja databases and bootstrap sessions. Use when starting analysis, routing to other skills, or setting up CLI/HTTP/MCP connections./dataQuery Binary Ninja strings, bytes, and binary patterns. Use the byte_search table for fast byte-pattern search.