
Pair ratchet
Runs back-to-back pair-optimize sessions across a scope, keeping each measured win
Pair ratchet is an open-source agent skill for developer tools. It is available on Claude Code.
- Scripts
- None
- Platforms
- Claude Code
- GitHub stars
- 10
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Pair ratchet
Pair-ratchet is an outer loop on top of the pair-optimize skill. Instead of optimizing one target and stopping to ask, it profiles a module, hot path or pipeline, optimizes the dominant bottleneck, then moves to the next one using the residual profile left after each kept win. Every kept change becomes the baseline for the following session, so the measured gains only accumulate.
The loop tracks its own state in a separate .ratchet/ folder, archives each session's pair-optimize run, and keeps a running log of kept candidates with their numbers. It stops either after a set number of consecutive sessions with no measured win, or when a maximum session count is reached. The skill itself defines only target selection and termination; the optimization protocol, review rounds and peer handling all come from pair-optimize.
It expects pair-optimize to be installed alongside it, and it is a Claude Code orchestrator that is not loaded as a peer. Users pass a scope plus optional flags for session cap, dry-session threshold, number of rounds and model choice.
When your agent uses it
Use when the user wants to optimize a whole hot path, module, or pipeline — not one isolated query — keeping every measured win and moving to the next bottleneck until none yields a measured win. Loops pair-optimize sessions back-to-back; each session's kept win becomes the next session's baseline (a ratchet that only tightens), stopping when the well is dry or a session cap is hit. Delegates each session to pair-optimize and never restates its contract; not itself a cold-woken peer.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (7 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
Copy the skill folder to ~/.claude/skills/pair-ratchet to use it in all your projects:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/pair-ratchet &&
cp -R "$tmp/pair-ratchet" ~/.claude/skills/pair-ratchet &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/pair-ratchet inside it instead.
Copy the skill folder to ~/.agents/skills/pair-ratchet to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/pair-ratchet &&
cp -R "$tmp/pair-ratchet" ~/.agents/skills/pair-ratchet &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/pair-ratchet inside it instead.
Copy the skill folder to ~/.cursor/skills/pair-ratchet to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/pair-ratchet &&
cp -R "$tmp/pair-ratchet" ~/.cursor/skills/pair-ratchet &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/pair-ratchet inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/ccomkhj/skills.git --path pair-ratchetOr copy the folder to ~/.gemini/skills/pair-ratchet yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/pair-ratchet:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccomkhj/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/pair-ratchet &&
cp -R "$tmp/pair-ratchet" ~/.copilot/skills/pair-ratchet &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/pair-ratchet inside it instead.
Get the folder:
git clone --depth 1 https://github.com/ccomkhj/skills.gitThen copy skills/pair-ratchet into your agent's skills folder as pair-ratchet. Agents that support SKILL.md read one folder per skill.
What it does
- Sequential optimization loop
- Runs one pair-optimize session after another, each targeting the next bottleneck.
- Ratcheted baseline
- Each kept win becomes the starting point for the next session's measurements.
- Residual target selection
- Chooses the next target from the profile left after the previous win.
- Dry-run termination
- Stops after a set number of sessions that keep no measured win.
- Session cap
- Enforces a maximum number of sessions regardless of results.
- Archived run state
- Stores each session's run in a .ratchet folder with a log and final report.
Good for
- Optimize an entire data processing pipeline one bottleneck at a time
- Speed up a module by repeatedly fixing its slowest hot path
- Run a bounded optimization pass over a scope and get a final summary
- Resume an interrupted multi-session optimization run
Pair ratchet FAQ
What does pair-ratchet need to run?
It depends on the pair-optimize skill, which runs each session. Its docs describe a Claude and Codex peer setup, and the skill is installed as a symlink into the Claude Code skills folder.
When does the loop stop?
It stops after a set number of consecutive sessions with no kept wins, which defaults to one, or when the maximum session count is reached, which defaults to five.
Does Pair ratchet ask for confirmation between sessions?
No. It suppresses the per-session prompt and reads each synthesis itself, so the user gets a single final report.
Where does Pair ratchet store its state?
Outer loop state is kept in a .ratchet folder, separate from pair-optimize's .optimize folder, and the .ratchet folder is added to .gitignore.
How do I install Pair ratchet in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/pair-ratchet to use it in all your projects, or to .claude/skills/pair-ratchet in one project.
Does Pair ratchet run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Pair ratchet?
Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.
What are the best alternatives to Pair ratchet?
The closest alternatives to Pair ratchet are Pair optimize, Performance reasoning, Optimize loop, Autoresearch and Benchmark optimization loop.
Where this comes from
- Description: from the skill's own SKILL.md.
More from ccomkhj/skills

Audits AGENTS.md project memory files and proposes targeted, approved updates
- Open source
- 10 GitHub stars
- Developer tools

Builds interactive HTML lessons that teach AI, ML or science concepts through worked cases
- Open source
- 10 GitHub stars
- Education and exam prep

Runs a project and builds an interactive walkthrough from what actually executed
- Open source
- 10 GitHub stars
- Developer tools

Turns a clear improvement target into a measurable Claude Code /goal condition
- Open source
- 10 GitHub stars
- Developer tools

Races Claude against Codex in separate git worktrees until a measurable goal is met
- Open source
- 10 GitHub stars
- Developer tools

Runs a per-turn race between two coding agents and keeps the better diff
- Open source
- 10 GitHub stars
- Developer tools




