tokf: Instructions file for Claude Code

CLAUDE.md

tokf CLAUDE.md is an instructions file for Claude Code from mpecan/tokf. It costs 2,341 tokens per session, scanned A, original, MIT.

Development instructions for tokf, including its open-source principles, commit format, transparency rules, and testing expectations.

In plain words
What is it for?
Use them when committing code, changing filters or command-line behavior, adding tests, or updating continuous-integration checks.
Why use it?
They help changes match the project's contribution rules and keep its command-line behavior clear to users.

Instructions file for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions Claude Code.

This is mpecan/tokf's own configuration. It tells Claude Code how to work on tokf 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 tokf configures →

Reuse

Borrowing it

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

Made for: Claude Code.

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 tokf CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/mpecan/tokf/claude-md/github.svg)](https://agentmods.dev/instructions/mpecan/tokf/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/mpecan/tokf/claude-md"><img src="https://agentmods.dev/badge/instructions/mpecan/tokf/claude-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 tokf CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/mpecan/tokf/claude-md"><img src="https://agentmods.dev/badge/instructions/mpecan/tokf/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,341 This file is loaded in full into every session.
When invoked 2,341 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.02341 $0.02341
Opus 5.5 $0.00936 $0.00936
Sonnet 5.5 $0.00468 $0.00468
Haiku 4.5 $0.00234 $0.00234

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

Security

Grade A, and why

tokf CLAUDE.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 1mo 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.

CLAUDE.md · 205 lines

How it starts

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

tokf — Development Guidelines

Project Philosophy

tokf is an open source project built for the community. We are not looking for profits — this exists for open source sake. Every decision should prioritize:

  • End-user experience — whether the user is a human or an LLM, the tool should be intuitive, fast, and transparent about what it's doing.
  • Visibility — users should always understand what tokf is doing. Stderr notes, --timing, --verbose flags. Never hide behavior.
  • Transparency — clear error messages, honest documentation, no dark patterns.

Commits

Use Conventional Commits strictly:

<type>(<scope>): <description>

[optional body]

[optional footer]

Types: feat, fix, refactor, test, docs, chore, ci, perf, build

Scopes: config, filter, runner, output, cli, hook, tracking, history

Examples:

  • feat(filter): implement skip/keep line filtering
  • fix(config): handle missing optional fields in git-status.toml
  • test(filter): add fixtures for cargo-test failure case
  • ci: add clippy and fmt checks to GitHub Actions

Keep commits atomic — one logical change per commit. Don't bundle unrelated changes.

Code Quality

Testing

  • Minimum 80% coverage, target 90%.
  • Every module gets unit tests. Every filter gets integration tests with fixture data.
  • Fixture-driven: save real command outputs as .txt files in tests/fixtures/. Tests load fixtures, apply filters, assert on output. No dependency on external tools in tests.
  • Declarative filter tests: place test cases in a <stem>_test/ directory adjacent to the filter TOML (e.g. filters/git/push_test/ next to filters/git/push.toml). Each case is a TOML file with name, inline or fixture, exit_code, and [[expect]] blocks. Run with tokf verify. Every filter in the stdlib must have a _test/ suite — CI enforces this with tokf verify --require-all.
  • Run cargo test after every meaningful change. Tests must pass before committing.

Read the full file on GitHub · 205 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. 1mo ago First seen · 205 lines · 2,341 tokens per session scan A 015df1a4f3e2

Subscribe to this mod's changes

tokf CLAUDE.md is an instructions file published in the GitHub repository mpecan/tokf (199 stars, last pushed today), licensed MIT. It adds 2,341 tokens to every session, about $0.0094 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