opencode-ralph: Instructions file for Codex

AGENTS.md

opencode-ralph AGENTS.md is an instructions file for Codex, OpenCode from Hona/opencode-ralph. It costs 952 tokens per session, scanned A, original, MIT.

Repository guidance for Hona/opencode-ralph, including the required TypeScript, Bun, OpenTUI, and keyboard settings. OpenTUI is a toolkit for building terminal user interfaces.

In plain words
What is it for?
Configuring the project, starting its terminal interface, handling keyboard input, and following its TypeScript and Bun setup.
Why use it?
It records configuration details that are easy to get wrong and could stop the terminal interface or build from working.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is Hona/opencode-ralph's own configuration. It tells Codex and OpenCode how to work on opencode-ralph itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything opencode-ralph configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Hona/opencode-ralph. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Hona/opencode-ralph/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Hona/opencode-ralph

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for opencode-ralph AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/hona/opencode-ralph/agents-md/github.svg)](https://agentmods.dev/instructions/hona/opencode-ralph/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/hona/opencode-ralph/agents-md"><img src="https://agentmods.dev/badge/instructions/hona/opencode-ralph/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.

agentmods 80×15 button for opencode-ralph AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/hona/opencode-ralph/agents-md"><img src="https://agentmods.dev/badge/instructions/hona/opencode-ralph/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 952 This file is loaded in full into every session.
When invoked 952 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00952 $0.00952
Opus 5.5 $0.00381 $0.00381
Sonnet 5.5 $0.00190 $0.00190
Haiku 4.5 $0.00095 $0.00095

Measured 2mo ago against content hash ad2805dd3763, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

opencode-ralph 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 2mo 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 · 110 lines

How it starts

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

AGENTS.md - Critical Operational Details

TypeScript Configuration

When using @opentui/solid, the jsxImportSource must be set to "@opentui/solid", NOT "solid-js". The plan.md incorrectly specifies solid-js but the actual requirement from the OpenTUI documentation is:

{
  "compilerOptions": {
    "jsx": "preserve",
    "jsxImportSource": "@opentui/solid"
  }
}

Additionally, a bunfig.toml preload is required:

preload = ["@opentui/solid/preload"]

Dependencies

The package.json uses @types/bun (modern approach) which doesn't require explicitly listing bun-types in the tsconfig's types array. The types are discovered automatically.

OpenTUI Configuration

When using @opentui/solid for CLI TUI rendering, use these render options:

render(
  () => <App />,
  {
    targetFps: 30,           // Balance between smoothness and CPU usage
    gatherStats: false,      // Disable stats gathering for performance
    exitOnCtrlC: false,      // Handle Ctrl+C manually via useKeyboard
    useKittyKeyboard: {},    // Enable Kitty keyboard protocol
  }
);

Critical pattern: Call renderer.disableStdoutInterception() immediately after useRenderer() to prevent OpenTUI from capturing stdout, which can interfere with logging.

Keyboard Handling

Known Issue: The onMount lifecycle hook in @opentui/solid does NOT fire reliably on Windows. Since useKeyboard registers its handler inside onMount, keyboard events may not work through OpenTUI's native keyboard handling.

Workaround: Implement a fallback stdin handler that activates after a timeout if no OpenTUI keyboard events are received:

// In src/index.ts
let keyboardWorking = false;
const keyboardTimeout = setTimeout(() => {
  if (!keyboardWorking && process.stdin.isTTY) {
    process.stdin.setRawMode(true);
    process.stdin.resume();
    process.stdin.on("data", (data) => {
      if (keyboardWorking) return; // OpenTUI took over
      const key = data.toString();
      if (key === "q" || key === "\x03") { /* quit */ }
      if (key === "p") { /* pause */ }
    });
  }
}, 5000);

// Pass callback to App to signal when OpenTUI keyboard works
onKeyboardEvent: () => { keyboardWorking = true; clearTimeout(keyboardTimeout); }

Read the full file on GitHub · 110 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. 2mo ago First seen · 110 lines · 952 tokens per session scan A ad2805dd3763

Subscribe to this mod's changes

opencode-ralph AGENTS.md is an instructions file published in the GitHub repository Hona/opencode-ralph (130 stars, last pushed 10mo ago), licensed MIT. It adds 952 tokens to every session, about $0.0038 per session on Opus 5.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.

Related

opencode-ralph AGENTS.md compared with instructions from other repositories

opencode-ralph AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
opencode-ralph AGENTS.mdHona/opencode-ralphInstructions file13010mo agoMITA952Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot