Promptbook logoptbk coder

Part of Promptbook

Your coding agents,
running your backlog.

ptbk coder drives Claude Code, OpenAI Codex, Gemini CLI and other coding agents through a queue of plain-markdown prompts. It runs your tests after every task, commits what passes and pushes it. You do not have to be at the keyboard for any of it.

bash
$ npm install ptbk
ptbk coder runsample run

Ship a backlog, not a stream of interruptions.

ptbk coder reads the PRD markdown files in prompts/ and works through them one at a time. You choose the harness and start the run. Come back to commits that already passed your tests, instead of a chat window full of questions.

No babysitting

Start the queue. Get back to your work.

Put your PRD markdown files in prompts/ and start a run. ptbk coder implements each task, runs the checks you configured, feeds every failure back to the agent, and commits before it moves to the next one.

No vendor lock-in

Keep your agent portable.

The behavior of the agent lives in a .book file you commit next to the code, not in one vendor prompt box. Change --harness and the same queue runs on Claude Code or OpenAI Codex. With opencode you point it at whatever provider you configured, local models included.

One source of truth

Let your PRD tell the truth.

When a task passes, ptbk coder writes its [x] into the PRD and puts that line in the same commit as the code it describes. Revert the commit and the checkbox goes back to [ ] together with the code.

From install to autopilot in five steps

  1. 1

    Install Promptbook

    ptbk coder ships with the ptbk package. Install it in your project (or globally with -g).

    bash
    $ npm install ptbk
  2. 2

    Initialize your project

    Creates the prompts/ queue, prompts/done/ archive, the default agents/developer.book persona, AGENTS.md project context, and the agent git identity entries in .env.

    bash
    $ ptbk coder init
  3. 3

    Write your backlog as prompts

    ptbk coder add writes one ready-to-run markdown file into prompts/ for you. Describe the task the same way you would prompt Claude Code or Codex, in plain language and as specific as you like. Pipe in a heredoc for longer descriptions, or run it with no arguments and type one interactively.

    bash
    $ ptbk coder add "Add a dark mode toggle to the settings page"
  4. 4

    Run the queue

    Pick a harness and let it work. It implements one prompt, verifies it, commits it, then starts the next one. Add --dry-run first if you only want to see what the queue would do.

    bash
    $ ptbk coder run --harness claude-code
  5. 5

    Or keep it running as a server

    ptbk coder server never stops. It watches prompts/ for new files and serves a Trello-style kanban board at localhost:4441, where you can follow progress and edit prompts in the browser.

    bash
    $ ptbk coder server --harness claude-code --model fable --thinking-level max --agent agents/developer.book --context AGENTS.md --test npm run test

Give your agent a soul, in plain text

Every run can carry an agent written in the Book language, Promptbook's human-readable language for defining AI agents. Its rules, its persona and what it knows live in one .book file, and ptbk coder compiles that file into the system message of every coding prompt.

Point ptbk coder at any agent file with --agent:

bash
$ ptbk coder run --harness claude-code --model fable --agent agents/developer.book --context AGENTS.md

ptbk coder init creates this default developer agent at agents/developer.book. Edit it like any other file in your repository to change how your agent codes.

readonly preview of agents/developer.book

📖

Bring the agent you already use

ptbk coder does not replace your coding agent. It drives it. Pick a harness with --harness, add a --model if you want one, and for the harnesses that support it a --thinking-level (low, medium, high, xhigh, max).

Claude Code

by Anthropic

The agentic CLI by Anthropic. ptbk coder drives it through your whole prompt queue, with thinking levels up to max.

Models: fable, opus, sonnet, haiku

bash
$ ptbk coder run --harness claude-code --model fable --thinking-level max

OpenAI Codex

by OpenAI

The OpenAI Codex CLI. It needs an explicit model, and it only spends credits beyond your rate limits when you pass --allow-credits.

Models (required): gpt-5.2-codex, default

bash
$ ptbk coder run --harness openai-codex --model gpt-5.6-terra

GitHub Copilot CLI

by GitHub

GitHub Copilot in your terminal. Works out of the box with your Copilot subscription and supports thinking levels.

Models: gpt-5.4

bash
$ ptbk coder run --harness github-copilot --model gpt-5.4 --thinking-level xhigh

Gemini CLI

by Google

The Google Gemini CLI. It needs an explicit model, such as one of the fast flash previews.

Models (required): gemini-3-flash-preview, default

bash
$ ptbk coder run --harness gemini --model gemini-3-flash-preview

opencode

by opencode

The open-source terminal coding agent. Bring any provider configured in your opencode installation.

Uses the models configured in the harness itself.

bash
$ ptbk coder run --harness opencode

Cline

by Cline Bot Inc.

The Cline CLI agent. Uses the models configured in your Cline setup.

Uses the models configured in the harness itself.

bash
$ ptbk coder run --harness cline

Built for unattended coding

The agent writes the code. ptbk coder does the rest: it runs your tests, commits, pulls and pushes, paces the queue against your quota window, and gives you back control the moment you press P or X. That is what keeps a run going for hours without you.

Verified by your tests

Run any test command after each prompt. When it fails, ptbk coder hands the output back to the agent, which retries until the tests pass.

bash
$ ptbk coder run --harness claude-code --test npm test

Test before coding

Run the tests before the first coding prompt. Stop on failures that were already there, or let one repair prompt fix them before the backlog starts.

bash
$ ptbk coder run --harness claude-code --test npm test --test-before yes-and-fix

Commits with its own identity

Every successful round lands under a git identity that belongs to the agent, GPG-signed if you set that up. You can always tell which commits it wrote.

bash
$ CODING_AGENT_GIT_NAME="Promptbook Coding Agent"

Autopilot git

Pull before prompts and push after commits, so a long-running queue stays in sync with your remote.

bash
$ ptbk coder run --harness claude-code --auto-pull --auto-push

Git-synced housekeeping

ptbk coder init, add, generate-boilerplates and verify all take the same --commit, --auto-push and --auto-pull switches. Setting up a project, queueing prompts and archiving finished ones leave no uncommitted work behind. Verify pulls and pushes around every single verification.

bash
$ ptbk coder init --auto-pull --commit --auto-push

Isolated worktrees

Implement every prompt in its own temporary git worktree with its own environment. Verified work lands back on your branch as one commit. If a task will not merge, ptbk coder marks it failed and keeps its worktree so you can look at it. Deeply nested repositories work on Windows too.

bash
$ ptbk coder run --harness claude-code --isolate

Kanban web UI

ptbk coder server keeps running after the queue is empty, watches for new prompt files and serves a Trello-style board where you can edit prompts in the browser.

bash
$ ptbk coder server --port 4441 --harness claude-code

Prompt priorities

Give prompts a priority and process only the range you want in the current run.

bash
$ ptbk coder run --harness claude-code --min-priority 1 --max-priority 5

Model-specific prompts

Route a prompt to a model family or harness with a backtick token on its [ ] status line, such as [ ] use model `gpt-5.5`. Other runners skip it.

bash
$ ptbk coder run --harness github-copilot --model gpt-5.5

Pacing and retries

Wait a fixed wall-clock duration between prompts. The clock keeps running through a pause and through sleep, and errors retry after a cool-down. The terminal also shows every subscription window a harness reports, with its remaining allowance and reset time. Whenever S is offered it skips whatever the coder waits for right now, down to the harness session limit that would otherwise hold the run for hours.

bash
$ ptbk coder run --harness claude-code --wait-between-prompts 30m --wait-after-error 10m

Dry run first

Preview which prompts would run. No files touched, no tokens spent.

bash
$ ptbk coder run --dry-run

Ping before you queue

ptbk coder ping sends one tiny dummy prompt to a harness and model and reports the answer, the response time and the usage. Use it to check that a harness, model and login work before you queue anything. It also opens the hourly or weekly quota window early, so the quota is already refreshing by the time you need it. It touches nothing in your project.

bash
$ ptbk coder ping --harness openai-codex --model gpt-5.6-sol --thinking-level xhigh

Keep the 5-hour window rolling

Add --period and the ping repeats until you stop it with CTRL+C. One ping every 5h holds the Claude Code 5-hour limit window open, so a queue you start at any hour already has a refreshing window waiting for it. That costs a handful of tokens per ping instead of a run you have to babysit.

bash
$ ptbk coder ping --harness claude-code --model claude-sonnet-5 --thinking-level low --period 5h

Human in the loop

Confirm each prompt yourself with --no-auto. Press P to pause a running queue, or X to end it after the current prompt. Every press is answered in the Controls panel on the next frame, so you can tell that the key landed even when it changed nothing.

bash
$ ptbk coder run --harness claude-code --no-auto

Live status in the prompt file

A prompt turns from [ ] into [^] the moment the agent picks it up, and the line names the step that is running. It only becomes [x] after the work is implemented, verified and committed. ptbk coder never reverts a [^], so if the queue is killed or crashes you can see which task was left half-done.

bash
$ [^] by OpenAI Codex `gpt-5.6-luna` - Implementation in progress

Pick up where the run stopped

A dirty working tree stops ptbk coder by default. --git-changes ignore starts anyway, and --git-changes continue resumes the one prompt left in [^] with its half-finished changes still in place. Any harness can take the work over, and the status line then names both the one that started and the one that finished it.

bash
$ ptbk coder run --harness claude-code --git-changes continue

Verify and archive

Every successful round writes the harness, model and thinking level into the prompt status line. Walk through completed prompts one by one, archive the finished ones to prompts/done/, and get a repair prompt appended for anything left incomplete. Pick the order with --order from-earliest, from-latest or random.

bash
$ ptbk coder verify --order from-latest

Many prompts per file

ptbk coder generate-boilerplates writes one prompt per file by default (--count 5*1). Use --count N*M to pack a whole backlog into fewer files: N files with M prompts each. A --- line separates the sections, every file carries one fresh emoji tag, and each section still runs as its own task.

bash
$ ptbk coder generate-boilerplates --count 10*7

Not another agent. The layer above them.

Claude Code, OpenAI Codex and opencode are agents that ptbk coder drives, so you keep the one you already use. The table is not about who writes better code. It compares what happens around a task: whether the queue runs unattended, whether the agent definition moves to another vendor, and whether git history keeps the code and its done state together. Where all three behave the same, the table says so once instead of three times.

Capabilityptbk coderby PromptbookClaude Codeby AnthropicOpenAI Codexby OpenAIopencodeby opencode
One task, side by sideSit in the terminal with the agent and steer a single task while it happens.Not availableIt drives them insteadBuilt inWhat they are built for
The whole backlog, unattendedTask files go through the agent one after another: implement, verify, commit, next one.Built inptbk coder runDo it yourselfScript one session per task
Several agents on one backlogRun more harnesses and models at once, each taking its own slice of the queue.Built in--min-priority --max-priorityNot availableNo shared queue
The same agent on another vendorThe queue and the .book behavior move to a different harness or model without a rewrite.Built in--harnessNot availableOne of the harnessesDo it yourselfAny provider, your config
Your tests gate every taskTests run before the queue starts and after every task, and failures go back to the agent until it is green.Built in--test --test-beforeDo it yourselfAsk for it, or wire a hook
Done state committed with the codeThe finished [x] lands in the same commit as the work it describes, so reverting takes both back.Built inIn every commitDo it yourselfTrack it by hand
Git kept in order around each taskCommits under the agent git identity, a pull before and a push after, and one throwaway worktree per task.Built in--auto-pull --auto-push --isolateDo it yourselfIt commits as you, when asked
Long runs that outlast a quota windowPacing between tasks, a cool-down retry after an error, and a ping that keeps the quota window refreshing.Built in--wait-between-promptsNot availableNo queue to pace
A backlog you can watch and refillA kanban board over the prompt files while the queue runs, with commands that write new ones and archive the finished.Built inptbk coder serverNot availableNo backlog to show
  • Built inBuilt in, one option or command away
  • Do it yourselfReachable, but you script and maintain it yourself
  • Not availableNo such concept in the tool

Inside a single task nothing changes. ptbk coder runs your harness as it is, with its own tools, its own sandbox and its own MCP servers. The features above explain every capability in this table in detail.