Borrowing it
Nothing to install: this file belongs to dzhng/duet-agent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/dzhng/duet-agent/main/.agents/skills/ratchet-files/SKILL.mdgit clone --depth 1 https://github.com/dzhng/duet-agentWrote 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.
[](https://agentmods.dev/skills/dzhng/duet-agent/ratchet-files)<a href="https://agentmods.dev/skills/dzhng/duet-agent/ratchet-files"><img src="https://agentmods.dev/badge/skills/dzhng/duet-agent/ratchet-files/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.
<a href="https://agentmods.dev/skills/dzhng/duet-agent/ratchet-files"><img src="https://agentmods.dev/badge/skills/dzhng/duet-agent/ratchet-files.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01506 |
| Opus 5.5 | $0.00000 | $0.00602 |
| Sonnet 5.5 | $0.00000 | $0.00301 |
| Haiku 4.5 | $0.00000 | $0.00151 |
Grade A, and why
ratchet-files 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 7d 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.
This is a copy
100% identical to ratchet-files — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.
name: ratchet-files description: Ratchet source file size so every file stays small enough for an agent to read whole: find every file over a token budget, split oversized files by concept, and set up the pre-commit ratchet that stops them from growing. Use when a commit is blocked because a file is over the size budget, when asked to find or split oversized/long/god files, when a file you need to change is too large to read in one pass, or when asked to add a file-size limit or hook to a repository.
Ratchet Files
A source file is over budget when it is past what an agent can read in one
pass (8,000 tokens, counted as bytes / 4, unless the repository sets
another). scripts/check-file-size.mjs owns
what counts as source, the budget, the ratchet, and the split rules; run it
with --help before anything else.
Splitting
- Run the script with
--allfrom the repository root, passing the repository's--max-tokensif its hook sets one. Its list is the backlog. - Pick the files to split: the one blocking the work in front of you, or with no blocker, the largest ones a change is about to touch.
- Split each one by the rules the script prints. A seam is a concept the file already owns, not a line count; when refactor-clean is installed, use it to find them.
- Prove the split changed no behaviour with the repository's own checks, and commit it alone, before the change that needed the room.
A file whose every split would cost more than it saves (one table or state
machine that only reads whole) may opt out instead. Put
@ratchet-files-ignore in a comment within its first 10 lines, in the
file's own comment syntax, followed by why splitting fails:
// @ratchet-files-ignore: one opcode table; split, each half reads without the other.
The check then skips the file entirely, even as it grows, so opt out only
after looking for a seam and finding none worth its cost, never to get past a
refusal. Tell the user each file you opt out and why. --all counts
opted-out files so they stay visible.
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.
- 7d ago First seen · 107 lines · 0 tokens per session scan A a3afd96b16b0
ratchet-files is a skill published in the GitHub repository dzhng/duet-agent (52 stars, last pushed 7d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,506 tokens. A static security scan graded it A with 0 findings. It is 100% identical to ratchet-files, differing in 0 lines, and is treated as a copy.
Other skills, from other repositories
generator-fix-integrator
Internal Auto-Harness generator skill for worktree-merge fix integration. Use only inside the parallel Generator integrator when it is addressing named defects from QA or retest.
open-code-review
Performs AI-powered code review on Git changes using the ocr CLI from alibaba/open-code-review. Use when the user asks to review code, review a pull request, review staged/unstaged changes, review a commit, or compare branches for code quality issues. Produces line-level review comments and can automatically apply…
harness-creator
Build, audit, and improve harnesses that make AI coding agents reliable: AGENTS.md/CLAUDE.md instruction files, feature/state tracking, verification gates, scope boundaries, session handoff, memory persistence, context budgets, tool-permission safety, and multi-agent coordination. Use this whenever a coding agent is…
parallel-pr-review
Use when asked to "review the open PRs", review a batch or stack of pull requests, or run a recurring PR-review pass on a repo — especially with many PRs, stacked branches, conflicts, or security-sensitive changes. Covers grouping, fan-out to review subagents, verdict synthesis, and posting.
github
GitHub API integration via HTTP tool with automatic credential injection.
review-readiness
PR readiness dashboard — tracks which reviews have been completed per branch and gates merge decisions. Shows code review, tests, security, QA, and linting status.