rea AGENTS.md

A repository instruction document for REA, a command-line and MCP server toolkit for reverse-engineering software. It describes the product direction, supported analysis providers, project structure, and development rules.

In plain words
What is it for?
For guiding development, testing, configuration, and installation work in the REA repository. It helps agents preserve provider boundaries and report observations, inferences, and unknowns clearly.
Why use it?
It gives coding agents the project-specific context needed to make safe, consistent changes. It also records limits such as local-only operation, read-only analysis, and bring-your-own Ghidra setup.

Instructions file for CodexOpenCode

Install

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.

agentmods
npx agentmods add instructions/morluto/rea/agents-md
Clone the repo
git clone --depth 1 https://github.com/morluto/rea

Made for: Codex, OpenCode.

Per session 4,246 This file is loaded in full into every session.
When invoked 4,246 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.04246 $0.04246
Opus 5 $0.02123 $0.02123
Sonnet 5 $0.00849 $0.00849
Haiku 4.5 $0.00425 $0.00425

Measured 2d ago against content hash d75aebe86d40, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rea AGENTS.md scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 148 lines

How it starts

The opening of the file, as written. The whole thing — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Repository Guidelines

Product Direction

REA exposes reverse-engineering tools through a CLI and MCP server. Hopper and the bring-your-own Ghidra adapter are operation-capable deep binary-analysis providers. Ghidra is supported on Linux x64 and has an experimental Windows x64 P0 boundary for approved native x86-64 PE applications; it supplies admitted read-only inventory and function-analysis operations but no GUI or mutation authority. Keep provider-specific code out of the domain and application layers.

Prioritize:

  • tool results that distinguish observations, inferences, and unknowns;
  • equivalent behavior through the CLI and MCP;
  • additive, idempotent configuration with backups;
  • end-to-end tests for packaged artifacts and real Hopper/Ghidra claims.

Installers must not install or upgrade Homebrew, Node.js, npm, Java, Ghidra, or other unrelated software. Ghidra is bring-your-own. rea setup must print its planned changes and require approval before writing files or installing Hopper.

REA is a local-only tool; do not sanitize actionable local diagnostics such as artifact paths, digests, mismatch locations, or analysis metadata, while continuing to redact genuine secrets such as credentials and authorization headers.

Project Structure & Module Organization

REA is a layered ESM TypeScript application. Dependencies flow inward: domain underlies contracts and the shared process primitives; providers depend on those layers, followed by application, server, and the entry adapters.

See docs/architecture.mermaid for a visual architecture diagram.

  • scripts/rea.mjs: executable dispatcher. Routes only bare mcp and --mcp to the production stdio server; Incur handles registration utilities and one-shot commands.
  • src/main.ts: MCP adapter. Parses config, wires the shared session runtime, starts stdio transport, and owns process-lifetime shutdown.
  • src/cli.ts: one-shot CLI adapter for setup, diagnostics, analysis, and decompilation.
  • src/config.ts: Zod-validated parsing of environment configuration into AppConfig.
  • src/domain/: pure, side-effect-free modules. errors.ts owns the tagged error algebra; result.ts owns Result/ok/err; hopperValues.ts owns shared function-dossier values plus Hopper boundary parsers; symbolAnalysis.ts parses Swift/ObjC names; javascriptApplicationGraph.ts validates and canonically commits the provider-neutral JavaScript Application Graph; javascriptStaticAnalysis.ts performs bounded AST-only JavaScript structure recovery.
  • src/contracts/: caller-visible tool schemas and catalog metadata; toolContracts.ts owns the canonical inventory and enhancedInputs.ts owns enhanced input parsing.
  • src/process/: provider-neutral process ownership and lifecycle primitives. It owns private runtime roots, session-assigned run identity and token-verified lineage, absolute startup deadlines, correlated request waits, bounded output capture, and TERM-to-KILL cleanup without defining any provider wire protocol.
  • src/replay/: Linux x64 controlled-JavaScript-replay adapter. It owns exact runtime closure inspection, Bubblewrap/seccomp/cgroup admission, the disposable worker, strict parent/worker protocol validation, and complete cleanup observation.
  • src/browser/: loopback CDP/Inspector discovery, bounded WebSocket transport, exact-origin or canonical-root target authorization, passive browser/Electron and attach-only Node/Electron V8 observation, plus controlled Playwright scenarios with explicit launch/attach ownership and cleanup.
  • src/hopper/: Hopper launch and Unix-socket protocol mechanics. BridgeLauncher.ts spawns the Hopper app with the in-process bridge, HopperClient.ts correlates request/response over the socket with timeouts and cancellation, protocol.ts frames bridge messages.
  • bridge/hopper_bridge.py: runs inside Hopper and adapts declared operations to Hopper's public Python API. Hopper's bundled MCP server is not used.
  • src/ghidra/: exact Ghidra 12.1.2/JDK 21 inspection, analysis-profile commitment, digest-bound target snapshots, isolated analyzeHeadless launch, authenticated Unix-socket or Windows loopback transport, bounded serial request queue, and strict inventory/function boundaries.
  • src/dotnet/: execution-free managed PE/CLI inspection. It owns bounded PE, CLI metadata, heap, table, and resource parsing for rea-dotnet-static; it must never load, reflect, execute, decompile, or resolve target assemblies.
  • bridge/ghidra/ReaGhidraBridge.java: packaged read-only HeadlessScript loaded through Ghidra's scriptPath; it owns the persistent decompiler and adapts admitted inventory, function, reference, and CFG operations to public Ghidra APIs.
  • src/application/: shared CLI/MCP session composition, setup and diagnostics, and enhanced workflows. AnalysisProviderRegistry discovers overlapping deep candidates without starting them; SessionProviderRouter binds one candidate per target and composes it with disjoint auxiliary providers; JavaScriptArtifactReconstruction.ts safely projects local directories/ASARs and inert bundle syntax into the application graph without adding a caller-visible tool yet.
  • src/server/: MCP request translation. createServer.ts assembles the MCP server, registerOfficialTools.ts/registerEnhancedTools.ts register each tool set, toolResult.ts maps Result values to MCP content.
  • docs/product-catalog.json: generated package, tool-family, provider, setup-client, schema-version, and CLI facts. Regenerate it from source; do not edit it by hand.
  • tests/: Vitest suite. Focused immutable domain builders live beside their production owner as src/domain/*.fixture.ts; tests/fixtures/ holds reusable provider-process fixtures, source-owned Electron/Webpack/Rspack artifact trees, and the fake launcher, Hopper bridge, and CDP seams.
  • scripts/verify-real-hopper.mjs: real-Hopper end-to-end verifier.
  • scripts/verify-real-ghidra.mjs: real Linux Ghidra verifier for x86-64 debug/stripped ELF, AArch64 ELF, PE, and Mach-O function semantics plus complete cleanup.
  • scripts/verify-real-ghidra-windows.mjs: real Windows x64 Ghidra P0 verifier for the source-owned native PE fixture, all 19 admitted operations, digest linkage, loopback transport, and cleanup.
  • scripts/verify-real-browser.mjs: real Chrome end-to-end verifier for the passive CDP provider.
  • scripts/print-mcp-config.mjs: prints an MCP server config with absolute paths filled in (npm run config:print -- /path/to/binary).

Read the full file on GitHub · 148 lines

Changes

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.

  1. 2d ago First seen · 148 lines · 4,246 tokens per session scan A d75aebe86d40

Subscribe to this mod's changes

rea AGENTS.md is an instructions file published in the GitHub repository morluto/rea (389 stars, last pushed 4d ago), licensed MIT. It adds 4,246 tokens to every session, about $0.0212 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.