Ratchet

A coding agent for your terminal, small enough to read in one sitting. Claude reads, searches, edits and runs commands until the task is done, and asks before it changes anything.

~/api · ratchet
› make get_user return 404 for unknown ids
▸ Read src/api/users.py
│ 58 lines
? Edit file src/api/users.py
41 user = db.get(user_id)
42 - return jsonify(user)
42 + if user is None:
43 + abort(404)
44 + return jsonify(user)
Allow this edit to users.py?
› y Allow once
a Allow file edits for the rest of this session
n Deny, and tell Claude what to do instead
default mode · ? shortcutsOpus latest (Portail) · high · 3% context

How it works

You stay in charge of every change

Give it a task. It explores, plans, edits and tests in a loop, and stops to ask when it matters.

Asks before it acts

Every edit shows as a diff and every command waits for a yes. Allow it once, allow that kind for the rest of the session, or deny it and say what to do instead.

Four modes

default asks first. accept-edits edits without asking. plan looks around and proposes without touching anything. auto runs everything. Shift+Tab cycles them.

History only moves forward

Ratchet never rewrites what it has sent. The prompt cache keeps matching and Claude's thinking stays valid from turn to turn, so long sessions stay fast and cheap.

Bring any key

Anthropic, OpenRouter, Kimi, GLM or any Anthropic-compatible API. Keys live in one file only you can read, or skip keys and link your Portail account.

Pick up where you left off

Sessions save as you go. ratchet --resume brings back the latest one for the folder, and /resume any earlier one.

Small enough to read

About 4,600 lines of Python in eleven files. Start with agent.py: the whole loop, with streaming, stop reasons and permissions, fits in one file.

With Portail

From a Portail chat to a build on your computer.

Link Ratchet to your Portail account once. It can run on your plan's credits instead of an API key, and a Portail chat can send it ideas to build. No pairing codes, no copy and paste.

  1. 1
    ratchet --linkApprove the sign-in in your browser. Ratchet keeps only a device token.
  2. 2
    Chat on Portail. When the idea is ready, tap “Build it on my computer” (Pro and Ultra).
  3. 3
    /tasksBuild it in your session, or run ratchet --watch to build each hand-off as it arrives.
Portail
Chat · build brief
hand-off
Ratchet
Your computer · builds · reports back

Pricing

Ratchet is free. The model isn't.

Ratchet is MIT licensed. Pay for the model the way that suits you.

Your own key

Pay your provider directly.

$0
  • Anthropic, OpenRouter, Kimi, GLM or any Anthropic-compatible API
  • Prompt caching and context compaction on Claude
  • Running cost in the status line
Install Ratchet

Your Portail account

One plan for chat and code.

Plan credits
  • No API key: ratchet --link and go
  • Latest Claude models, GPT-5.3-Codex, Qwen3 Coder and more
  • Hand-offs from Portail chats on Pro and Ultra
See Portail plans

Ready when you are.

Needs Python 3.10 or later on Linux or macOS.

  1. 1

    Put ratchet on your PATH

    pipx install ratchet-harness works too.
    $ uv tool install ratchet-harness
  2. 2

    Link Portail, or add an API key

    Or save a key with ratchet --set-key anthropic.
    $ ratchet --link
  3. 3

    Start it in any project

    Type /help inside for commands.
    $ cd your-project && ratchet

FAQ

Frequently asked questions

What is Ratchet?

Ratchet is a coding agent that runs in your terminal. You give it a task, and Claude reads code, searches the project, edits files and runs commands in a loop until the task is done. Edits and commands wait for your approval unless you say otherwise. It is about 4,600 lines of Python, small enough to read in one sitting.

How do I install it?

You need Python 3.10 or later on Linux or macOS. Run uv tool install ratchet-harness (or pipx install ratchet-harness), then either save an API key with ratchet --set-key anthropic or link your Portail account with ratchet --link. Start it with ratchet in any project folder.

Which models does Ratchet work with?

Claude first: Opus, Sonnet and Fable through the Anthropic API or OpenRouter. It also talks to Kimi, GLM and any other Anthropic-compatible API with your own key. Linked to Portail, it can use the models on your Portail plan, including the latest Claude models, GPT-5.3-Codex and Qwen3 Coder.

What does Ratchet have to do with Portail?

Ratchet is free and works without Portail. Linking it to your Portail account adds two things: it can run on your plan's credits instead of an API key, and on Pro and Ultra a Portail chat can hand an idea off to it. Portail turns the conversation into a build brief, and Ratchet builds it on your computer.

How much does it cost?

Ratchet itself is free and MIT licensed. With your own key you pay your provider directly. On Portail it uses your plan's credits like any chat message, and hand-offs from chat need Portail Pro or Ultra.