# Pair ratchet

> Pair ratchet is an open-source agent skill for developer tools. Runs back-to-back pair-optimize sessions across a scope, keeping each measured win. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/ccomkhj/skills/tree/main/pair-ratchet
- **Repository:** https://github.com/ccomkhj/skills
- **GitHub stars:** 10
- **License:** MIT
- **Skill name:** pair-ratchet
- **Collection:** https://github.com/ccomkhj/skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ccomkhj/skills/tree/HEAD/pair-ratchet)
- [License: MIT](https://github.com/ccomkhj/skills/tree/HEAD/pair-ratchet)

## Features

- **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

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/pair-ratchet` to use it in all your projects:

```sh
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.

### Codex

Copy the skill folder to `~/.agents/skills/pair-ratchet` to use it in every repository:

```sh
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.

### Cursor

Copy the skill folder to `~/.cursor/skills/pair-ratchet` to use it in every project:

```sh
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.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ccomkhj/skills.git --path pair-ratchet
```

Or copy the folder to `~/.gemini/skills/pair-ratchet` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/pair-ratchet`:

```sh
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.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ccomkhj/skills.git
```

Then copy `skills/pair-ratchet` into your agent's skills folder as `pair-ratchet`. Agents that support SKILL.md read one folder per skill.

## 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.

## Alternatives

- [Pair optimize](https://ai-powered.com/skills/pair-optimize): Pair optimize is an open-source agent skill for developer tools.
- [Performance reasoning](https://ai-powered.com/skills/performance-reasoning): Performance reasoning is an open-source agent skill for developer tools.
- [Optimize loop](https://ai-powered.com/skills/optimize-loop): Optimize loop is an open-source agent skill for developer tools.
- [Autoresearch](https://ai-powered.com/skills/autoresearch): Autoresearch is an open-source agent skill for developer tools.
- [Benchmark optimization loop](https://ai-powered.com/skills/benchmark-optimization-loop): Benchmark optimization loop is an open-source agent skill for developer tools.
- [Optimize](https://ai-powered.com/skills/optimize-jasgujral): Optimize is an open-source agent skill for developer tools.
- [Dueling autoresearch](https://ai-powered.com/skills/dueling-autoresearch): Dueling autoresearch is an open-source agent skill for developer tools.
- [Rea analysis optimization](https://ai-powered.com/skills/rea-analysis-optimization): Rea analysis optimization is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/pair-ratchet
