better-context AGENTS.md

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/davis7dotsh/better-context/agents-md
Clone the repo
git clone --depth 1 https://github.com/davis7dotsh/better-context

Made for: Codex, OpenCode.

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. Scan, not verified.
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 $0.00452 $0.00452
Opus 5 $0.00226 $0.00226
Sonnet 5 $0.00090 $0.00090
Haiku 4.5 $0.00045 $0.00045

Measured yesterday against content hash 3d8ad16487fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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 · 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. yesterday 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,157 stars, last pushed 4mo ago), licensed MIT. It adds 452 tokens to every session, about $0.0023 per session on Opus 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.