espai: Instructions file for Codex

AGENTS.md

espai AGENTS.md is an instructions file for Codex, OpenCode from pouriya/espai. It costs 4,559 tokens per session, scanned A, original, MIT.

A set of coding rules for Espai, a small browser extension with a native host program. The rules favor simple files, reusable browser-independent building blocks, and keeping the program's standard output available for communication with the browser.

In plain words
What is it for?
Use it when modifying Espai's Rust host or browser extension, especially when handling captured network data, trusted input, and browser messaging.
Why use it?
It prevents changes that make the small project harder to understand, break browser communication, or depend on fragile selectors for particular websites.

Instructions file for CodexOpenCode

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

This is pouriya/espai's own configuration. It tells Codex and OpenCode how to work on espai 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 espai configures →

Reuse

Borrowing it

Nothing to install: this file belongs to pouriya/espai. 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/pouriya/espai/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/pouriya/espai

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 espai AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/pouriya/espai/agents-md"><img src="https://agentmods.dev/badge/instructions/pouriya/espai/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,559 This file is loaded in full into every session.
When invoked 4,559 The same file — it is already loaded in full.
Security scan A 1 finding. 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.04559 $0.04559
Opus 5.5 $0.01824 $0.01824
Sonnet 5.5 $0.00912 $0.00912
Haiku 4.5 $0.00456 $0.00456

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

Security

Grade A, and why

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

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

commit.** Keep it markdown — it is read straight out of `curl` output.
AGENTS.md · 296 lines

How it starts

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

Agent Guidelines

Coding conventions for this project. Follow these when writing or modifying code.

Kept plain

The native host is one main.rs with four dependencies; the extension is six files the browser loads as they are — no bundler, no npm, no build step beyond copying them next to the manifest rendered from the template in extension/. Anything you add should pay for the loss of "read one file, understand the system".

The style rules below favour locally-readable code over idiomatic density. They are choices, not oversights — do not "modernize" them into iterator chains, combinator pipelines, or extracted abstractions.

Generic primitives, never site adapters

No twitter.js, no instagram.js. Those sites regenerate their markup continuously, so a selector committed here breaks within weeks with nothing to warn us but a user reporting that likes silently stopped working. Snapshot-with-refs, trusted input and the network capture are site-agnostic and together they are enough. Anything site-shaped belongs in the agent's prompt, where it costs nothing to be wrong.

Never write to stdout

println! is a fatal bug. stdout is the native messaging channel: one stray byte desynchronises the length-prefixed frames, Chrome sees a garbage length and kills this process. The symptom is a silent disconnection, not an error.

Diagnostics go to stderr via eprintln!, prefixed espai:. We inherit Chrome's stderr, so they land wherever Chrome was started from — a terminal, or nowhere. Nothing may depend on a human seeing them.

How Chrome starts and kills this process

  • One host process per connectNative(), not per tab or per browser, and lazily: nothing runs until the service worker connects. argv[1] is the calling extension's origin, and the working directory is unspecified, so never use a relative path.
  • Chrome, Chromium, Edge and Brave each read the host manifest from their own profile root, and one in the wrong root is silently ignored — the extension loads fine and the host never starts. make install-chrome / install-chromium copy it where that browser looks.
  • Those targets fail on a profile root that does not exist rather than creating one, since a manifest under ~/.config/google-chrome on a Chromium-only machine is a directory that looks installed and is never read. Edge and Brave get no target for the same reason. install.sh writes every root that already exists and creates none.
  • Manifests point at bin/espai, which release copies out of target/. A path into target/ breaks on the next cargo clean, and a missing binary looks exactly like a missing manifest.
  • version in Cargo.toml and in manifest.chromium.json.in are bumped in the same commit — the halves speak a private frame protocol and ship as one thing. make check-version enforces it, and Chrome refuses a version that goes backwards.
  • Shutdown is EOF on stdin, so UnexpectedEof on the length read is the ordinary exit path, not an error to log loudly.

Read the full file on GitHub · 296 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 · 296 lines · 4,559 tokens per session scan A 1f0fbece0a30

Subscribe to this mod's changes

espai AGENTS.md is an instructions file published in the GitHub repository pouriya/espai (13 stars, last pushed 3mo ago), licensed MIT. It adds 4,559 tokens to every session, about $0.0182 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

espai AGENTS.md compared with instructions from other repositories

espai AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
espai AGENTS.mdpouriya/espaiInstructions file133mo agoMITA4,559Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode ai-customization.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA1,907GitHub Copilot