crit AGENTS.md

crit AGENTS.md is an instructions file for Codex, OpenCode from tomasz-tomczyk/crit. It costs 7,807 tokens per session, scanned A, original, MIT.

Development instructions for Crit, a single-file Go command-line tool that opens a browser interface for reviewing code changes and Markdown files. It supports inline comments, multiple files, Git diffs, and review files that coding agents can use.

In plain words
What is it for?
Use them when developing Crit, its browser review interface, GitHub or version-control integrations, AI-agent integrations, Markdown rendering, live mode, or automated tests.
Why use it?
They explain the project layout and how its command-line program, server, browser interface, integrations, and tests fit together, making changes easier to locate and verify.

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/tomasz-tomczyk/crit/agents-md
Clone the repo
git clone --depth 1 https://github.com/tomasz-tomczyk/crit

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tomasz-tomczyk/crit/agents-md.svg)](https://agentmods.dev/instructions/tomasz-tomczyk/crit/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/tomasz-tomczyk/crit/agents-md"><img src="https://agentmods.dev/badge/instructions/tomasz-tomczyk/crit/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 7,807 This file is loaded in full into every session.
When invoked 7,807 The same file — it is already loaded in full.
Security scan A 1 finding. 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.07807 $0.07807
Opus 5 $0.03904 $0.03904
Sonnet 5 $0.01561 $0.01561
Haiku 4.5 $0.00781 $0.00781

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

Security

Grade A, and why

crit AGENTS.md scanned grade A with 1 finding 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 3d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- State-changing requests (POST/PUT/PATCH/DELETE) with a `Sec-Fetch-Site` header must be `same-origin`. Missing header is allowed (CLI/curl/agent). `cross-site` is rejected — CSRF defense against malicious pages posting
AGENTS.md · 419 lines

How it starts

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

Crit — Development Guide

Single-binary Go CLI that opens a browser-based UI for reviewing code changes and markdown files with GitHub PR-style inline commenting. Multi-file review with git diff rendering and structured review file output for AI coding agents.

Project map

crit/
├── cmd/crit/            # package main — thin CLI (main.go, cli_*.go, wire.go)
├── internal/            # Core logic packages (daemon, server, session, github, share, vcs, …)
├── web/                 # Embedded frontend assets (Go package webassets; embed.go)
│   ├── index.html       # HTML shell — code-review OR live-mode script fork
│   ├── app.js           # Code-review mode JS
│   ├── live-mode*.js    # Live-mode modules
│   ├── crit-agent.js / agent-*.js / agent-marker.css  # Injected iframe scripts
│   ├── crit-*.js        # Shared renderer, SSE, draft, comment UI modules
│   ├── style.css / style-live.css / theme.css
│   ├── __tests__/       # Node.js unit tests (node --test)
│   └── *.min.js         # Vendored markdown-it, highlight.js, mermaid
├── integrations/        # Drop-in config files for AI coding tools (claude-code, cursor, aider, …)
├── test/                # Test harnesses, E2E, roundtrip docs, shared fixtures
├── Makefile
├── package.json
└── copy-deps.js         # Copies npm deps into web/ for embedding

Key architecture decisions

  1. All frontend assets embedded via Go's embed.FS — produces a true single binary
  2. No frontend build step — vanilla JS, no npm/webpack/framework. npm is only for fetching vendor libs.
  3. Two modes: "git" mode (auto-detect from git) and "files" mode (explicit file arguments)
  4. markdown-it for parsing — chosen because it provides token.map (source line mappings per block)
  5. Block-level splitting — lists, code blocks, tables, blockquotes split into per-item/per-line/per-row blocks so each source line is independently commentable
  6. Diff hunk rendering — code files show git diffs with dual gutters (old/new line numbers)
  7. Comments reference source line numbers — stored in ~/.crit/reviews/<key>.json with per-file sections
  8. Real-time output — review file written on every comment change (200ms debounce)
  9. File watching — git mode polls git status --porcelain; files mode polls mtimes; reloads via SSE
  10. Localhost by default — server binds to 127.0.0.1 (no CORS headers needed). Non-loopback --host / CRIT_HOST / global host, or any public_url, require --allow-unauthenticated-network / CRIT_ALLOW_UNAUTHENTICATED_NETWORK=1 (Crit has no network auth).
  11. Two-level config~/.crit.config.json (global) merged with .crit.config.json (project), CLI flags override both. agent_cmd, auth_token, share_url, and plan_approve_mode are global-only (prevents malicious repos from hijacking agent commands, redirecting share requests, or weakening Claude Code permissions)
  12. Headless CLI commentcrit comment writes directly to the review file without starting the server; SSE notifies any running server
  13. Comment threading — comments support nested replies and a resolved boolean. Review file schema nests replies inside each comment's replies array.
  14. Centralized review storage~/.crit/reviews/<key>.json keyed by cwd + branch (git mode) or cwd + args (file mode)
  15. VCS abstractionvcs.go defines a backend interface; git_vcs.go, sapling.go, and jj.go are the implementations. Auto-detected, overridable via --vcs flag or vcs config key. Subcommands not yet threaded through (see TODO at main.go:1826).
  16. Focus mode — sub-views over the file list: file focus, range focus (--range A..B), stacked focus (range layer in a stacked PR). Lives in focus_*.go and /api/focus.

Read the full file on GitHub · 419 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. 3d ago First seen · 419 lines · 7,807 tokens per session scan A f249131b699c

Subscribe to this mod's changes

crit AGENTS.md is an instructions file published in the GitHub repository tomasz-tomczyk/crit (979 stars, last pushed 5d ago), licensed MIT. It adds 7,807 tokens to every session, about $0.0390 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.