tokenmaxxing: Instructions file for Codex

AGENTS.md

tokenmaxxing AGENTS.md is an instructions file for Codex, OpenCode from 851-labs/tokenmaxxing. It costs 1,212 tokens per session, scanned A, original, MIT.

Repository instructions for an Effect-based TypeScript project, covering error types, export style, data synchronization, date handling, command-line tokens, and command-line output.

In plain words
What is it for?
Use them when adding Effect errors, exporting code, syncing daily device data, handling date strings, managing command-line tokens, or designing foreground CLI output.
Why use it?
They keep shared code patterns consistent and prevent mistakes such as throwing untyped errors, changing date buckets, or breaking idempotent synchronization.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/851-labs/tokenmaxxing/agents-md"><img src="https://agentmods.dev/badge/instructions/851-labs/tokenmaxxing/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,212 This file is loaded in full into every session.
When invoked 1,212 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.01212 $0.01212
Opus 5.5 $0.00485 $0.00485
Sonnet 5.5 $0.00242 $0.00242
Haiku 4.5 $0.00121 $0.00121

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

Security

Grade A, and why

tokenmaxxing 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 10d 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 · 34 lines

How it starts

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

Repository Instructions

Effect Error Style

  • Prefer native Effect errors over plain JavaScript Error subclasses in Effect code.
  • Use Data.TaggedError for internal typed errors that stay inside the Effect error channel.
  • Use Schema.TaggedError when an error is part of a public schema or wire contract.
  • Avoid throw for expected domain failures; return Effect.fail(...) with a typed error instead.

Export Style

  • Prefer local declarations first and grouped exports at the end of each authored source file.
  • Use export { ... } for runtime values and export type { ... } for type-only exports.
  • Put default exports at the end too, using a named local value before export default name;.
  • Do not hand-edit generated files just to satisfy this style rule.

Conventions

  • Daily usage rows are keyed (deviceId, date, source, model) and upserted; sync must stay idempotent.
  • Cost is frozen at first upload unless the usage (token counts) changes: the usage_days upsert keeps the stored cost_usd when all token columns match (ccusage re-prices unmarked Codex history with the device's current speed tier), takes the incoming cost when any token count differs, and prices a row stored at 0. Fixing already-stored cost means editing D1 directly; re-ingesting payloads with the same tokens is a no-op for cost.
  • Only a parser change may lower a re-sent day. Each raw-ingested usage_days row records counted_by, the server PARSER_VERSION that produced it. A re-sent (device, day, source) is kept when every stored row has the current counted_by and the uploading owner, and the stored total is higher than the re-count. Kept means never lowered or pruned, though models that are new or grew are still taken. A lower re-count from the same parser means the device lost logs (deleted or pruned, a narrower source root, a full re-sync past Claude Code's 30-day cleanup), not a correction. The decision is per whole day, so a model relabeled without a loss is still replaced and pruned. Any other re-send replaces the day as before. So a correction that has to lower or drop stored usage ships as a PARSER_VERSION bump, also when it comes from a ccusage or CLI-side counting fix. A bump is required for any server change to the rows a report yields (parsing, model labels, plausibility limits). A bump re-counts every device's trailing window once, losses included. The structured /usage/sync path writes NULL, which is always replaced. Known gaps: a timezone change moves usage near midnight into the next day while the earlier day keeps its higher count, and two concurrent ingests from one device can race the check.
  • date columns are opaque YYYY-MM-DD strings (ccusage local-time buckets); never parse them into Date objects for bucketing. Do day arithmetic with shiftDayKey/utcDayKey from @tokenmaxxing/api-contract (API windows live in apps/api/src/date-keys.ts).
  • Published CLIs bundle a frozen contract. packages/api-contract/fixtures/ (recorded CLI requests + the CLI endpoint OpenAPI slice) is a compatibility contract: review diffs there as breaking-change reviews, and add a legacy/ fixture before changing a shape a released CLI sends. Responses go the other way: apps/api/src/http/cli-compat.test.ts decodes every replayed response and typed CLI error with frozen copies of the released CLI decoders, so fields may be added but never dropped, renamed or retyped, and error _tags never change. fixtures/full-api.openapi.json snapshots the whole API as a review aid; only the CLI slice is frozen.
  • CLI tokens (tmx_ prefix) never expire; revocation (revokedAt) is the only kill switch.
  • D1 caps a statement at 100 bound parameters, and the sqlite test harness (apps/api/src/testing/sqlite-d1.ts) enforces it. Never bind an unbounded list: chunk it, or pass it as one JSON parameter through json_each.
  • Keep bun run test output clean. A test that exercises a logging path captures and asserts the log (makeTestLogger in apps/api/src/testing/logger.ts; vi.spyOn(console, ...) outside Effect) instead of letting it print. makeTestApp already captures into app.logs. Captured Effect logs are replayed when a test fails.

Read the full file on GitHub · 34 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. 10d ago Changed · +1 lines · +300 tokens per session 7814d3a731e3
  2. 29d ago Changed · +7 lines · +239 tokens per session e9204b6e922f
  3. 1mo ago Changed · +1 lines · +102 tokens per session 65a19a618827
  4. 1mo ago Changed · +3 lines · +314 tokens per session b789bd7622a6
  5. 1mo ago Changed · -14 lines · -181 tokens per session c9a5139493e7
  6. 1mo ago First seen · 36 lines · 438 tokens per session scan A 525f14f2ec16

Subscribe to this mod's changes

tokenmaxxing AGENTS.md is an instructions file published in the GitHub repository 851-labs/tokenmaxxing (84 stars, last pushed 4d ago), licensed MIT. It adds 1,212 tokens to every session, about $0.0048 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

Other instructions, from other repositories