Borrowing it
Nothing to install: this file belongs to buzzer-re/Rikugan. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/buzzer-re/Rikugan/main/AGENTS.mdgit 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/instructions/buzzer-re/rikugan/agents-md)<a href="https://agentmods.dev/instructions/buzzer-re/rikugan/agents-md"><img src="https://agentmods.dev/badge/instructions/buzzer-re/rikugan/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/buzzer-re/rikugan/agents-md"><img src="https://agentmods.dev/badge/instructions/buzzer-re/rikugan/agents-md.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.15403 | $0.15403 |
| Opus 5.5 | $0.06161 | $0.06161 |
| Sonnet 5.5 | $0.03081 | $0.03081 |
| Haiku 4.5 | $0.01540 | $0.01540 |
Grade A, and why
Rikugan AGENTS.md 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 2d 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.
- Blocked patterns (subprocess, os.system, etc.) are rejected before reaching the approval step How it starts
The opening of the file, as written. The whole thing — 1,244 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — Rikugan Developer Guide
Project Overview
Rikugan (六眼) is a multi-host reverse-engineering agent plugin that integrates an LLM-powered assistant directly inside IDA Pro and Binary Ninja. It has its own agentic loop, in-process tool orchestration, streaming UI, multi-tab chat, session persistence, MCP client support, and host-native tool sets.
Directory Structure
rikugan/
├── agent/ # Agent loop & prompt logic (host-agnostic)
│ ├── loop.py # AgentLoop: generator-based turn cycle
│ ├── turn.py # TurnEvent / TurnEventType definitions
│ ├── context_window.py # Context-window management (threshold compaction)
│ ├── exploration_mode.py # Exploration state machine (4 phases)
│ ├── mutation.py # build_reverse_record, capture_pre_state, _KNOWN_IRREVERSIBLE
│ ├── plan_mode.py # Plan-mode step orchestration
│ ├── subagent.py # SubagentRunner — isolated AgentLoop for tasks
│ ├── system_prompt.py # build_system_prompt() dispatcher
│ └── prompts/ # Host-specific system prompts
│ ├── base.py # Shared prompt sections (discipline, renaming, etc.)
│ ├── ida.py # IDA Pro base prompt
│ └── binja.py # Binary Ninja base prompt
│
├── core/ # Shared infrastructure (host-agnostic)
│ ├── artifacts.py # Oversized tool output: head/tail rendering, artifact:// store
│ ├── chat_context.py # Which chat the current tool call belongs to (context variable)
│ ├── config.py # RikuganConfig — settings, provider config, paths
│ ├── constants.py # Constants (CONFIG_DIR_NAME, etc.)
│ ├── errors.py # Exception hierarchy (ToolError, AgentError, etc.)
│ ├── host.py # Host context (BV, address, navigate callback)
│ ├── logging.py # Logging utilities
│ ├── thread_safety.py # Thread-safety helpers (@idasync, etc.)
│ ├── types.py # Core data types (Message, ToolCall, StreamChunk, etc.)
│ └── workspace.py # Path confinement for file tools, atomic writes, undo backups
│
├── ida/ # IDA Pro host package
│ ├── tools/
│ │ └── registry.py # IDA create_default_registry() — imports rikugan.tools.*
│ └── ui/
│ ├── panel.py # IDA PluginForm wrapper
│ ├── actions.py # IDA UI hooks & context menu actions
│ └── session_controller.py # IDA SessionController
│
├── binja/ # Binary Ninja host package
│ ├── tools/
│ │ ├── registry.py # BN create_default_registry() — imports rikugan.binja.tools.*
│ │ ├── common.py # BN shared helpers (get_bv, get_function_at, etc.)
│ │ ├── navigation.py # Navigation tools
│ │ ├── functions.py # Function listing/search tools
│ │ ├── strings.py # String tools
│ │ ├── database.py # Segments, imports, exports, binary info
│ │ ├── disassembly.py # Disassembly tools
│ │ ├── decompiler.py # Decompiler/HLIL tools
│ │ ├── xrefs.py # Cross-reference tools
│ │ ├── annotations.py # Rename/comment/set_type tools
│ │ ├── types_tools.py # Struct/enum/typedef tools
│ │ ├── il.py # IL core tools (get_il, get_il_block, nop_instructions, redecompile_function)
│ │ ├── il_analysis.py # IL analysis tools (get_cfg, track_variable_ssa)
│ │ ├── il_transform.py # IL transform tools (il_replace_expr, il_set_condition, il_nop_expr, patch_branch, etc.)
│ │ └── scripting.py # execute_python tool
│ └── ui/
│ ├── panel.py # BN QWidget panel
│ ├── actions.py # BN action handlers
│ └── session_controller.py # BN BinaryNinjaSessionController
│
├── tools/ # IDA tool implementations
│ ├── base.py # @tool decorator, ToolDefinition, JSON schema generation
│ ├── registry.py # Shared ToolRegistry class
│ ├── navigation.py # IDA navigation tools
│ ├── functions.py # IDA function tools
│ ├── strings.py # IDA string tools
│ ├── database.py # IDA database tools (segments, imports, exports)
│ ├── disassembly.py # IDA disassembly tools
│ ├── decompiler.py # IDA decompiler tools (Hex-Rays)
│ ├── xrefs.py # IDA xref tools
│ ├── annotations.py # IDA annotation tools (rename, comment, set type)
│ ├── types_tools.py # IDA type tools (structs, enums, typedefs, TILs)
│ ├── microcode.py # IDA Hex-Rays microcode tools
│ ├── microcode_format.py # Microcode formatting helpers
│ ├── microcode_optim.py # Microcode optimizer framework
│ ├── scripting.py # IDA execute_python tool
│ ├── filesystem.py # read_file, write_file, edit_file (both hosts)
│ ├── file_search.py # search_files: ripgrep or Python scan (both hosts)
│ └── shell.py # run_shell (both hosts)
│
├── hosts/ # Backward-compat shims → rikugan.ida.ui.* / rikugan.binja.ui.*
│
├── providers/ # LLM provider integrations (host-agnostic)
│ ├── base.py # LLMProvider ABC
│ ├── registry.py # ProviderRegistry
│ ├── anthropic_provider.py # Claude (Anthropic) — supports OAuth auto-detection
│ ├── openai_provider.py # OpenAI
│ ├── gemini_provider.py # Google Gemini
│ ├── ollama_provider.py # Ollama (local)
│ ├── minimax_provider.py # MiniMax (subclasses OpenAICompatProvider)
│ └── openai_compat.py # OpenAI-compatible endpoints
│
├── mcp/ # MCP client (host-agnostic)
│ ├── config.py # MCP server config loader
│ ├── client.py # MCP protocol client
│ ├── bridge.py # MCP ↔ ToolRegistry bridge
│ ├── manager.py # MCPManager — lifecycle management
│ └── protocol.py # MCP JSON-RPC protocol types
│
├── skills/ # Skill system (host-agnostic)
│ ├── registry.py # SkillRegistry — discovery & loading
│ ├── loader.py # SKILL.md frontmatter parser (mode field support)
│ └── builtins/ # 12 built-in skills
│ ├── malware-analysis/
│ ├── linux-malware/
│ ├── deobfuscation/
│ ├── vuln-audit/
│ ├── driver-analysis/
│ ├── ctf/
│ ├── generic-re/
│ ├── ida-scripting/ # IDAPython API skill with full reference
│ ├── binja-scripting/ # Binary Ninja Python API skill with full reference
│ ├── modify/ # Exploration mode: autonomous binary modification
│ ├── smart-patch-ida/ # IDA-specific binary patching workflow
│ └── smart-patch-binja/ # Binary Ninja-specific patching workflow
│
├── state/ # Session persistence (host-agnostic)
│ ├── session.py # SessionState — message history, token tracking
│ └── history.py # SessionHistory — auto-save/restore per file
│
└── ui/ # Shared UI widgets (Qt, host-agnostic)
├── panel_core.py # PanelCore — multi-tab chat, export, mutation log, event routing
├── session_controller_base.py # SessionControllerBase — multi-session, fork support
├── chat_view.py # Chat message display widget (queued message support)
├── input_area.py # User input text area with skill autocomplete
├── context_bar.py # Binary context status bar
├── message_widgets.py # Message bubble widgets (tool calls, exploration, approval)
├── tool_review.py # What a tool call will do, laid out for review (diffs, code, not JSON)
├── code_view.py # Read-only code display: syntax scanner, gutter, diff tints
├── mutation_log_view.py # MutationLogPanel — mutation history with undo
├── markdown.py # Markdown rendering for assistant messages
├── plan_view.py # Plan-mode UI
├── settings_dialog.py # Settings dialog (screen-aware sizing)
├── styles.py # Qt stylesheet constants
└── qt_compat.py # Qt compatibility layer (PySide6)
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.
- 2d ago Changed · +36 lines · +1,292 tokens per session d4e197e7f96b
- 2mo ago First seen · 1,208 lines · 14,111 tokens per session scan A 4562c8cb4b39
Rikugan AGENTS.md is an instructions file published in the GitHub repository buzzer-re/Rikugan (706 stars, last pushed 2d ago), licensed MIT. It adds 15,403 tokens to every session, about $0.0616 per session on Opus 5.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.
Rikugan AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| Rikugan AGENTS.mdbuzzer-re/Rikugan | Instructions file | 706 | 2d ago | MIT | A | 15,403 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |