cc65-Chess AGENTS.md

cc65-Chess AGENTS.md is an instructions file for Codex, OpenCode from StewBC/cc65-Chess. It costs 6,355 tokens per session, scanned A, original, Unlicense.

Project-specific instructions for developing and testing cc65 Chess, a chess program written for older computers such as the Commodore 64 and other 6502-based machines.

In plain words
What is it for?
Use it when modifying the chess engine, platform code, search or evaluation logic, or build and test workflow for the project's supported computers.
Why use it?
It records fixed design constraints, known traps, required reading, and performance limits so changes do not accidentally break supported ports or past decisions.

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/stewbc/cc65-chess/agents-md
Clone the repo
git clone --depth 1 https://github.com/StewBC/cc65-Chess

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 cc65-Chess AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/stewbc/cc65-chess/agents-md.svg)](https://agentmods.dev/instructions/stewbc/cc65-chess/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/stewbc/cc65-chess/agents-md"><img src="https://agentmods.dev/badge/instructions/stewbc/cc65-chess/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 6,355 This file is loaded in full into every session.
When invoked 6,355 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.06355 $0.06355
Opus 5 $0.03178 $0.03178
Sonnet 5 $0.01271 $0.01271
Haiku 4.5 $0.00636 $0.00636

Measured 4d ago against content hash abc027b7c2be, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cc65-Chess 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 4d 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 · 381 lines

How it starts

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

Working on cc65 Chess

A chess program in C, originally for ~1 MHz 6502 machines — c64, apple2, atmos, plus4, atari. Faster 6502s came later: cx16 and rp6502, at up to 8 MHz. Then ports that cc65 does not cover — spectrum, mac68k — plus a terminal build used for development. Each port with whichever compiler that machine needs.

doc/engine.md explains how the engine works and is the right thing to read first. This file is the short list of constraints that are easy to violate by accident.

doc/rework-log.md is the working journal, and its last section is the closed search and evaluation portfolios. Read that before proposing a search technique or an evaluation term. B3+B4 shipped (−17.2% per node on a C64). The skill budgets are 400 / 1,200 / 18,000 / 65,000. Do not reopen a rejected candidate by renaming it.

Hard constraints

plat.h and the 0–63 tile numbering are frozen. The 0x88 board representation stays inside the engine and converts at the boundary. This is what lets the platform files that cannot be built here stay untouched.

There is one addition to plat.h since the freeze, and the bar it had to clear is the point. plat_GetSeed() returns a byte of entropy for the opening randomiser. It went in because every machine has a free-running counter, cc65's own asminc names all of them, and the implementation is three lines a port that reads a register and cannot fail visibly — a wrong address gives repeating openings, which is what the engine did anyway. Anything asking to be added here should be held to that: no writes to hardware on a port that cannot be run, and a failure mode nobody has to debug. Note there are eleven platform files, not seven — c64.chr is a separate port, spectrum and mac68k use other compilers, and term is the one that must return a constant.

The frozen interface is wider than plat.h. Every port also reads four globals directly, and this was discovered the hard way:

  • gChessBoard[y][x] — pieces, for drawing
  • the attacker count for a tile and side — no port ever reads the attacker list
  • gTile[0], gTile[1], gPiece[1], gColor[0] — the move log line, valid only inside a undo_FindUndoLine walk; see the log contract below

Read the full file on GitHub · 381 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. 4d ago First seen · 381 lines · 6,355 tokens per session scan A abc027b7c2be

Subscribe to this mod's changes

cc65-Chess AGENTS.md is an instructions file published in the GitHub repository StewBC/cc65-Chess (50 stars, last pushed 15d ago), licensed Unlicense. It adds 6,355 tokens to every session, about $0.0318 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.