duet-agent: Skill for Claude Code

.agents/skills/ratchet-files/SKILL.md

ratchet-files is a skill for Claude Code, Codex from dzhng/duet-agent. It costs 0 tokens per session (1,506 once invoked), scanned A, a copy of ratchet-files, Apache-2.0.

A repository skill for finding source files that are too large to read in one pass, splitting them by concept, and adding a pre-commit size check. A pre-commit check runs before a Git commit and can block files that exceed the configured limit.

In plain words
What is it for?
Use it to find long or oversized files, split a file that blocks work, and set up or maintain a file-size hook.
Why use it?
It prevents oversized files from making code harder for agents and developers to understand or change. It also keeps files from growing past the project's chosen budget.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is dzhng/duet-agent's own configuration. It tells Claude Code and Codex how to work on duet-agent 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 duet-agent configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/dzhng/duet-agent/main/.agents/skills/ratchet-files/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/dzhng/duet-agent

Made for: Claude Code, Codex.

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 ratchet-files

README.md
[![agentmods](https://agentmods.dev/badge/skills/dzhng/duet-agent/ratchet-files/github.svg)](https://agentmods.dev/skills/dzhng/duet-agent/ratchet-files)
Your own site
<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.

agentmods 80×15 button for ratchet-files

Your own site · 80×15
<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>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,506 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.00000 $0.01506
Opus 5.5 $0.00000 $0.00602
Sonnet 5.5 $0.00000 $0.00301
Haiku 4.5 $0.00000 $0.00151

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

Security

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.

Origin

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.

.agents/skills/ratchet-files/SKILL.md · 107 lines

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

  1. Run the script with --all from the repository root, passing the repository's --max-tokens if its hook sets one. Its list is the backlog.
  2. 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.
  3. 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.
  4. 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.

Read the full file on GitHub · 107 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. 7d ago First seen · 107 lines · 0 tokens per session scan A a3afd96b16b0

Subscribe to this mod's changes

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.

Related

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.

redker56/auto-harness · 40 tokens

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…

alibaba/open-code-review · 98 tokens

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…

walkinglabs/learn-harness-engineering · 142 tokens

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.

suyoumo/ClawProBench · 67 tokens

github

GitHub API integration via HTTP tool with automatic credential injection.

suyoumo/ClawProBench · 13 tokens

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.

suyoumo/ClawProBench · 36 tokens