core: Instructions file for Codex

AGENTS.md

core AGENTS.md is an instructions file for Codex, OpenCode from MetaMask/core. It costs 3,107 tokens per session, scanned A, original, MIT.

Repository instructions for AI coding agents working in MetaMask/core, a Yarn-managed monorepo containing multiple packages. They describe its architecture, tools, package layout, and configuration files.

In plain words
What is it for?
Use them to understand the TypeScript stack, package folders, tests, formatting, builds, releases, changelogs, and API documentation in MetaMask/core.
Why use it?
They give an agent the project rules and structure it needs before changing code, reducing mistakes caused by guessing how the repository is organized or tested.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/metamask/core/agents-md"><img src="https://agentmods.dev/badge/instructions/metamask/core/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,107 This file is loaded in full into every session.
When invoked 3,107 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.03107 $0.03107
Opus 5.5 $0.01243 $0.01243
Sonnet 5.5 $0.00621 $0.00621
Haiku 4.5 $0.00311 $0.00311

Measured 3d ago against content hash 4ac765cad939, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

core 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 3d 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 · 236 lines

How it starts

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

Guidelines for AI agents

This document provides guidance for AI agents working within this repo.

Architecture

Stack

  • Yarn 4 for managing the monorepo
  • TypeScript 5 for writing type-safe code
  • Vitest for writing tests
  • ESLint 9 and Prettier for linting and formatting code
  • @metamask/auto-changelog for writing and validating changelogs
  • @metamask/create-release-branch, MetaMask/action-publish-release, and MetaMask/action-npm-publish for creating and publishing releases
  • TypeDoc for generating API documentation

Package structure

Yarn workspaces are used to define and manage multiple packages.

Package in this monorepo are represented by subdirectories in packages/. Each directory follows this structure:

  • src/ — Files that get built and published when the package is released. May also contain tests (which do not get published).
  • tests/ — Optional directory that defines helpers or setup for tests.
  • package.json — Defines the name of the package, current version, dependencies, etc.
  • CHANGELOG.md — Each package has a changelog that lists historical changes.
  • README.md — Introduces the package to engineers and provides instructions on how to install and use it.
  • LICENSE — Each package has a license that describes how engineers can use it in projects.
  • Configuration files — See below.

Note that the package template in scripts/create-package/package-template also uses this same structure.

Configuration files

The monorepo uses a hierarchical configuration approach for different tools. For most tools, root-level config files define shared settings, while package-level files extend or customize them.

Contributing teams and codeowners

  • CODEOWNERS defines which GitHub teams own which packages in the monorepo.
  • teams.json instructs the create-update-issues GitHub workflow which labels to assign issues that are created when there are new major version releases of packages.

Read the full file on GitHub · 236 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. 3d ago Changed · +1 lines · +24 tokens per session 4ac765cad939
  2. 11d ago Changed · +1 lines · +32 tokens per session 6ae84227cca7
  3. 14d ago Changed · -2 lines · -33 tokens per session 0bae23021581
  4. 15d ago Changed · -3 tokens per session 8e4308b8b4b8
  5. 1mo ago Changed fc47c0c447a8
  6. 1mo ago Changed · +1 tokens per session 86c331e65880
  7. 2mo ago First seen · 236 lines · 3,086 tokens per session scan A c91a75d99f36

Subscribe to this mod's changes

core AGENTS.md is an instructions file published in the GitHub repository MetaMask/core (422 stars, last pushed yesterday), licensed MIT. It adds 3,107 tokens to every session, about $0.0124 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

core AGENTS.md compared with instructions from other repositories

core AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
core AGENTS.mdMetaMask/coreInstructions file422yesterdayMITA3,107Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode