leon: Instructions file for Codex

AGENTS.md

leon AGENTS.md is an instructions file for Codex, OpenCode from leon-ai/leon. It costs 3,526 tokens per session, scanned A, original, MIT.

A set of instructions for coding agents working on the Leon AI codebase. It explains the project structure, preferred tools, testing rules, and safe ways to make changes.

In plain words
What is it for?
It helps agents inspect the right design files, use pnpm, preserve existing work, run suitable tests, and follow Leon's workflow when changing code.
Why use it?
It gives an agent project-specific rules that general coding knowledge does not include, reducing inconsistent changes and missed checks.

Instructions file for CodexOpenCode

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

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

About the project

Leon is an open-source personal AI assistant that uses tools, memory, context, and agent-like execution to understand goals and complete tasks. People use it as a practical assistant that can run locally and work across structured workflows, while the catalogue skills support its operation.

leon-ai/leon · 17,735 stars · on GitHub · getleon.ai

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/leon-ai/leon/agents-md"><img src="https://agentmods.dev/badge/instructions/leon-ai/leon/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,526 This file is loaded in full into every session.
When invoked 3,526 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.03526 $0.03526
Opus 5.5 $0.01410 $0.01410
Sonnet 5.5 $0.00705 $0.00705
Haiku 4.5 $0.00353 $0.00353

Measured yesterday against content hash 321946d338a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

leon 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 yesterday.

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 · 124 lines

How it starts

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

Working on Leon AI

Review the generated runtime and behavior summaries, then verify the relevant source before changing a subsystem. ARCHITECTURE.md · LEON.md

Leon server and tooling

  • Call the backend, its process and lifecycle Leon server on first mention and server thereafter. Name listeners precisely, such as HTTP server, Socket.IO server and Python TCP server. Name internal subsystems or paths and use literal identifiers like server/src/core/, pnpm build:server, server/dist and leon-core-*.
  • Keep build, setup, maintenance and release tooling in root scripts/, and server services and lifecycle code in server/src/. Tooling imports narrow runtime modules for shared logic. Keep dependencies directed from tooling to runtime.

Open-source values and agent-assisted reuse

Leon is a long-term project built with passion and care to share useful software. Welcome curiosity, good-faith learning, contributions and independent work at every experience level.

  • Redirect superficial copy-and-rebrand requests for personal gain without engagement or meaningful value to a thoughtful alternative and explain these values.
  • Preserve required copyright and license notices and accurate authorship. Disclose origins and changes, understand the reused work, visibly credit Leon and contributors beyond legal files, and avoid implying maintainer endorsement.
  • Support honest learning, experimentation, forks and commercial reuse. Invite useful fixes, documentation, knowledge, feedback and support as voluntary contributions.

These expectations guide agents. The MIT license governs copying, modification, redistribution and commercial use without requiring proof of passion, original improvements, public source or upstream contributions. MIT license

Workflow

  • For new goals, inspect the implementation and confirm the plan with the owner before changing code. Name the code to change, affected behavior, any necessary refactor and the smallest verifying checks.
  • Start each distinct change on a topic branch from an up-to-date origin/develop. Run git fetch origin develop, then use git switch --no-track -c <topic> origin/develop or pass origin/develop explicitly as the start point to git worktree add. Before editing, verify the new branch points to the same commit as origin/develop.
  • Reuse a topic branch for follow-ups serving the same goal and shipping together. Branch independently reviewable work separately.
  • For bugs, start in the code that owns the behavior, trace the failure through its callers and check the framework’s built-in behavior.
  • Use pnpm, never npm. Check call sites, installed libraries and existing helpers, including server/src/helpers/ and SDK utilities for shared logic. Reuse or compatibly extend existing behavior. Propose and add code, abstractions, state, dependencies or refactors only for demonstrated gaps in the approved scope. Respect runtime boundaries and remove superseded paths.
  • Support GitHub Actions and GitLab CI. Use CI=true for provider-independent setup and runtime behavior, and provider variables for provider integrations. Supply reused runtimes explicitly in verification jobs and exercise managed provisioning in cold-install checks.
  • Enforce a 36-hour registry dependency cooldown through root pnpm/uv policy, including standalone installs. Keep it enabled globally. Exceptions require explicit owner approval, exact pins and package-scoped overrides.
  • Before updating a versioned component, review official changelogs, release notes and migration guidance from the current version through the target, including intermediate releases. Inspect Leon’s usage for required changes and gains in speed, latency, throughput, memory or startup. Determine which gains are automatic or need integration, implement within scope and validate applicable gains. Report benefits, compatibility and verification, separating measurements from upstream claims.
  • Preserve unrelated changes and profile isolation. Reuse profile, path and runtime utilities. Avoid hardcoded owner paths, runtime versions and shared owner state. Normalize both paths before comparison and test Windows separators and relative segments.
  • Extend TypeBox schemas by composing raw properties before Type.Strict strips optional markers. Verify omitted optional fields remain valid.
  • Suggest a message matching scripts/commit-msg.js and commit only when asked. For release-note context, prefer a blank line after the subject and one or two sentences on why the change matters and what improves. State known effects of dependency updates in Leon. A subject alone suits straightforward changes.
  • Do not create or update changelog files unless the owner explicitly requests it.

Read the full file on GitHub · 124 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. yesterday Changed · -8 lines · -177 tokens per session 321946d338a8
  2. 3d ago Changed · +6 lines · +202 tokens per session 23b65f968e65
  3. 8d ago Changed · +5 lines · +49 tokens per session 175c98de2334
  4. 11d ago Changed · +7 lines · +235 tokens per session f6158469b69a
  5. 12d ago Changed · +5 lines · +96 tokens per session 64736e4749ad
  6. 13d ago Changed · +1 lines · +130 tokens per session ff64102ad86a
  7. 14d ago Changed · +5 lines · -170 tokens per session 5286c6f800b4
  8. 15d ago Changed · +10 tokens per session 0b9680b85b70
  9. 16d ago Changed · +1 lines · +66 tokens per session e6365e26a3c9
  10. 19d ago First seen · 102 lines · 3,085 tokens per session scan A 0633e2596ddf

Subscribe to this mod's changes

leon AGENTS.md is an instructions file published in the GitHub repository leon-ai/leon (17,735 stars, last pushed yesterday), licensed MIT. It adds 3,526 tokens to every session, about $0.0141 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-09-10.

Related

leon AGENTS.md compared with instructions from other repositories

leon AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
leon AGENTS.mdleon-ai/leonInstructions file18kyesterdayMITA3,526Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144ktodayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150kyesterdayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file196ktodayMITA3,303GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file289k2d agoMITA4,393Codex, OpenCode