better-context: Instructions file for Codex

AGENTS.md

better-context AGENTS.md is an instructions file for Codex, OpenCode from davis7dotsh/better-context. It costs 452 tokens per session, scanned A, original, MIT.

Project instructions for working in the better-context codebase, including its AGENTS.md rules, source-of-truth documentation, allowed commands, and formatting checks. AGENTS.md is a file that tells coding agents how to work in a repository.

In plain words
What is it for?
Following repository-specific rules, checking and formatting individual packages, and keeping the server and command-line documentation consistent with implementation.
Why use it?
It prevents common project mistakes, such as using the wrong package manager, running forbidden development commands, or changing code without updating the required documentation.

Instructions file for CodexOpenCode

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

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

About the project

better-context, also called btca, helps coding agents answer questions about project libraries and frameworks by searching their actual source code instead of relying only on documentation. It is for developers who need current technical context during coding, and the catalogue entries package its agent skill, rule, command, and instruction.

davis7dotsh/better-context · 1,151 stars · on GitHub · btca.dev

Reuse

Borrowing it

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

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 better-context AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/davis7dotsh/better-context/agents-md"><img src="https://agentmods.dev/badge/instructions/davis7dotsh/better-context/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 452 This file is loaded in full into every session.
When invoked 452 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.00452 $0.00452
Opus 5.5 $0.00181 $0.00181
Sonnet 5.5 $0.00090 $0.00090
Haiku 4.5 $0.00045 $0.00045

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

Security

Grade A, and why

better-context 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 · 39 lines

What it actually says

AGENTS.md

Critical Rules

  • ONLY use bun - never npm/yarn
  • NEVER run dev/build commands (bun dev, bun build)

Source of Truth

When working on this project, apps/docs is the documentation for the server and cli. Make sure when changing something about how an endpoint or command works, you update the documentation in apps/docs. And if you change something that makes it different from the docs, ask me about it. This does not apply to apps/web or apps/sandbox.

Commands

Root Commands

  • Type check all: bun run check:all
  • Format all: bun run format:all

Package-Specific Commands

After making changes in a specific package, run its check script:

Package Check Command Format Command
apps/cli bun run check:cli bun run format:cli
apps/web bun run check:web bun run format:web
apps/server bun run check:server bun run format:server
apps/sandbox bun run check:sandbox bun run format:sandbox
apps/server-simple bun run check:server-simple bun run format:server-simple
packages/shared bun run check:shared bun run format:shared

Code Style

  • Runtime: Bun only. No Node.js, npm, pnpm, vite, dotenv.
  • TypeScript: Strict mode enabled. ESNext target.
  • Imports: External packages first, then local. Use .ts extensions for local imports.
  • Bun APIs: Prefer Bun.file, Bun.serve, bun:sqlite, Bun.$ over Node equivalents.
  • Testing: Use bun:test with import { test, expect } from "bun:test".
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 · 39 lines · 452 tokens per session scan A 3d8ad16487fa

Subscribe to this mod's changes

better-context AGENTS.md is an instructions file published in the GitHub repository davis7dotsh/better-context (1,151 stars, last pushed 6mo ago), licensed MIT. It adds 452 tokens to every session, about $0.0018 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

better-context AGENTS.md compared with instructions from other repositories

better-context AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
better-context AGENTS.mddavis7dotsh/better-contextInstructions file1.2k6mo agoMITA452Codex, OpenCode
pudo-code-system pudo-api.instructions.mdDongDuong2001/pudo-code-systemInstructions file514d agoMITA182GitHub Copilot
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,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