selectools: Instructions file for Codex

AGENTS.md

selectools AGENTS.md is an instructions file for Codex, OpenCode from johnnichev/selectools. It costs 1,252 tokens per session, scanned A, original, Apache-2.0.

Project-specific instructions for contributing to selectools, a Python project, including its required tests, formatting, type checks, security checks, and documentation build.

In plain words
What is it for?
Use them when modifying selectools to run pytest, Ruff, mypy, Bandit, and MkDocs, and to follow rules for public APIs and regression tests.
Why use it?
They make the expected checks and contribution boundaries clear before committing or releasing changes.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/johnnichev/selectools/agents-md"><img src="https://agentmods.dev/badge/instructions/johnnichev/selectools/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,252 This file is loaded in full into every session.
When invoked 1,252 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.01252 $0.01252
Opus 5.5 $0.00501 $0.00501
Sonnet 5.5 $0.00250 $0.00250
Haiku 4.5 $0.00125 $0.00125

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

Security

Grade A, and why

selectools 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 · 96 lines

How it starts

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

Selectools -- Agent Instructions

Commands

# Test (MUST pass before any commit)
pytest tests/ -x -q
pytest tests/ -k "not e2e" -x -q          # no API keys needed

# Format + lint (MUST run before commit — replaces Black + isort + flake8)
ruff format src/ tests/
ruff check src/ tests/ --fix

# Type check
mypy src/

# Security (MUST pass before release tags)
bandit -r src/ -ll -q -c pyproject.toml

# Docs
cp CHANGELOG.md docs/CHANGELOG.md && mkdocs build

Stack

  • Python 3.9+ (CI: 3.9, 3.10, 3.11, 3.12, 3.13)
  • pip + setuptools, src-layout: src/selectools/
  • pytest (5000+ tests), Ruff (format + lint), mypy
  • MkDocs Material for docs, deployed to GitHub Pages

Boundaries

Always (do without asking)

  • Run ruff format and ruff check --fix on every modified file
  • Run pytest tests/ -k "not e2e" -x -q after implementation changes
  • Add type hints to all public APIs
  • Add a regression test for every bug fix
  • Apply @beta stability marker to new public symbols
  • Use response_msg.content or "" when reading provider content

Ask First

  • Adding new fields to AgentConfig, AgentResult, or AgentObserver
  • Adding new StepType values to AgentTrace
  • Modifying agent/core.py (the main agent loop)
  • Changing public API signatures on @stable symbols
  • Adding new dependencies to pyproject.toml

Never

  • Push directly to main -- MUST use PR workflow
  • Push to remote without explicit user request
  • Call real LLM APIs in unit tests -- use RecordingProvider or mocks
  • Use datetime.utcnow() -- MUST use datetime.now(timezone.utc)
  • Use x = x or default when 0, "", or [] are valid values
  • Create ThreadPoolExecutor() per-call in async code -- use module singleton
  • Use self.config.model in astream() -- MUST use self._effective_model
  • Stringify ToolCall objects -- check isinstance(chunk, str) first
  • Skip the tools parameter in provider stream()/astream() methods
  • Add co-author trailer lines to commits

Read the full file on GitHub · 96 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 · 96 lines · 1,252 tokens per session scan A e8d873464a94

Subscribe to this mod's changes

selectools AGENTS.md is an instructions file published in the GitHub repository johnnichev/selectools (11 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,252 tokens to every session, about $0.0050 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

selectools AGENTS.md compared with instructions from other repositories

selectools AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
selectools AGENTS.mdjohnnichev/selectoolsInstructions file114d agoApache-2.0A1,252Codex, 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