Skip to main content

pushback: measure how often you correct your AI coding agent, find the CLAUDE.md rules it keeps breaking, and export your corrections as preference pairs

pushback: how often do you correct your AI coding agent?

PyPI tests Python 3.10+ Works with Claude Code MIT license

Results · Quick start · How it works · Rules · Preference pairs · Privacy · Method

pushback is a command-line tool that reads your Claude Code transcripts and shows what you use your AI coding agent for, how often you correct it on each kind of work (code, writing, media, research, ops, meta), and how often a correction needs correcting again. It drafts CLAUDE.md rules from the corrections you keep repeating, shows which of your existing rules those corrections run into, and exports your corrections as preference pairs (prompt / chosen / rejected). A hand-audit step tells you how far to trust every number.

pip install pushback

Results

The author's own 1,633 messages to Claude Code:

Correction rate by task: media 43.0%, writing 24.7%, research 6.9%, code 5.9%, meta 4.7%, ops 4.5%. One in three corrections needed a second correction. One existing rule kept getting broken after it was written.

task messages share of use corrections rate 95% CI corrected again
writing 429 26% 106 24.7% 20.9%–29.0% 41% (41/99)
code 340 21% 20 5.9% 3.8%–8.9% 11% (2/18)
meta 297 18% 14 4.7% 2.8%–7.8% 36% (5/14)
ops 265 16% 12 4.5% 2.6%–7.7% 8% (1/12)
research 188 12% 13 6.9% 4.1%–11.5% 8% (1/13)
media 114 7% 49 43.0% 34.3%–52.2% 44% (20/45)

Most corrected topics (at least 5 messages each):

topic messages corrections rate corrected again
writing / social-post 135 47 35% 23/45
writing / client-message 144 26 18% 7/23
media / image 47 24 51% 10/21
media / video 36 12 33% 6/12
writing / proposal-report 26 11 42% 5/11
writing / video-script 36 10 28% 3/9
code / frontend 31 6 19% 1/6
code / debugging 27 5 19% 1/4
  • Against 91 hand-checked messages the correction labels had precision 0.97 and recall 0.80. Topic labels were spot-checked, not audited.
  • 1 in 3 corrections needed a second one. 70 of 201 fixes got corrected again (35%), 41% on writing and 44% on images.
  • 1 rule the author had already written kept getting broken: "images must not look AI-generated" was corrected 3 more times after it was written. Two other matching rules turned out to be written because of the corrections, which is why every rule now shows its evidence dates.

That's one person's logs. Run it on yours.

Quick start

pip install pushback

pushback extract            # reads ~/.claude/projects, writes ./pushback-data/
pushback label              # labels each message with Claude (resumable)
pushback audit              # hand-check 40 messages
pushback report --markdown  # the table, with the audit folded in
pushback rules              # draft CLAUDE.md rules from your recurring corrections
pushback export             # your corrections as prompt/chosen/rejected pairs

label uses the Anthropic SDK, so it picks up ANTHROPIC_API_KEY or an ant auth login profile. It defaults to claude-opus-5 at low effort; change it with --model. To send through a gateway, set ANTHROPIC_BASE_URL.

command what it does leaves your machine?
extract pulls the messages you typed, plus full agent turns, out of transcripts no
label tags each message with a task, a topic and whether it's a correction yes: to the API after asking, or through Claude Code with --prompt-file
audit shows you a stratified sample to judge by hand no
report what you use the agent for, how often you correct it per task and per topic (frontend, cli-tool, social-post, ...), how often a fix gets corrected again, with 95% intervals no
rules groups recurring corrections into CLAUDE.md rules yes, or no with --prompt-file
export writes preference pairs as JSONL, with secrets scrubbed no

How it works

How pushback works: extract messages from Claude Code transcripts, label them, audit a sample, then report correction rates, draft CLAUDE.md rules, or export preference pairs

Every message gets a task (code, writing, media, research, ops, meta) and a topic from a fixed list for that task, so results stay comparable between people:

task topics
code frontend, backend-api, cli-tool, database, tests, auth-security, integrations, data-ml, scripts-automation, agent-prompts, debugging, pr-workflow
writing social-post, client-message, email, docs-readme, video-script, proposal-report, spec-plan
media image, video, diagram, ui-design
research benchmark-experiment, data-analysis, market-leads, paper-reading, trading-analysis
ops deploy-hosting, git-github, accounts-credentials, config-settings, browser-automation, ci
meta planning, memory-context, advice, status-check

Anything that fits none of them is other.

A correction is a message where you reject, fix or redirect something the agent just did, said, wrote or proposed. New tasks, answers to its questions, picking between its options, approvals and pasted logs don't count. The full rubric is in src/pushback/prompt.py. If you change it, run audit again.

Rejected tool calls and interrupts carry no text, so they're counted separately and grouped by the action you stopped (a code edit, a shell command, and so on).

Turn recurring corrections into CLAUDE.md rules

pushback rules                                  # drafts rules into pushback-data/rules.md
pushback rules --existing CLAUDE.md notes/*.md  # also check against the rules you already have
pushback rules --prompt-file                    # no API key? writes the request to a file instead
pushback rules --from-response reply.json       # ...and reads Claude's answer back
pushback rules --runs 3                         # ask 3 times, keep only the rules that keep coming back

The model groups corrections that share a cause and drafts one CLAUDE.md instruction per group. Support is counted from the correction ids it cites, not from its own numbers, and a rule needs at least 3 real corrections.

Stable rules. A model won't write the same rules twice. With --runs 3 (or three replies passed to --from-response), pushback matches rules across runs by the corrections they cite, not by their wording, and keeps only the ones that come back in at least 2 of 3 runs. Each rule shows how many runs it appeared in, and the unstable ones are listed separately instead of vanishing.

On the author's 214 corrections, three independent runs wrote 12, 10 and 7 rules: 16 distinct rules in total. 5 came back in all three runs, 3 in two, and 8 showed up only once. A single run mixes real rules with one-offs.

When you pass your existing rule files, the output splits in two:

  • Rules you already have that these corrections hit. If the corrections came after you wrote the rule, the rule isn't working: it's too vague, or the agent doesn't read it at the right moment. pushback can't know when you wrote a rule, so check the evidence dates.
  • New rules to consider. Recurring corrections with no rule behind them.

Export your corrections as preference pairs

pushback export                                        # all pairs -> pushback-data/dpo.jsonl
pushback export --ctype writing_content tone_style     # the cleanest pairs
pushback export --minimal                              # only prompt/chosen/rejected (TRL DPO columns)

Each correction you made becomes one row:

field what it holds
prompt your message the agent was answering
rejected the agent turn you corrected
chosen the agent's reply to your correction, kept only if your next message wasn't another correction
feedback the correction itself, for critique-and-revise formats

On the author's logs, 214 corrections gave 124 pairs. The biggest loss: 70 corrections (a third) had their fix corrected too, so there was no accepted answer to pair with.

Privacy

  • extract, audit, report and export never leave your machine. report prints counts only.
  • label and rules send each message, plus the end of the agent reply before it, to the model provider. If your logs contain client work, check that provider's data policy first. Both ask before they send anything. With --prompt-file nothing is sent by pushback; Claude Code reads the files instead.
  • pushback-data/ holds your raw messages. It's in .gitignore. Keep it there.
  • Your transcripts probably contain other people's information. Keep exports local unless every conversation in them is yours to share.

How the numbers are computed

  • Rates per task come with Wilson 95% intervals.
  • audit samples half from messages the model flagged and half from the rest. The report estimates the true count as flagged × precision + unflagged × miss rate, with a range built from both strata's intervals.
  • A batch that fails stays unlabelled and is retried on the next run. It's never counted as "not a correction".
  • Message ids are session:index, so re-running extract never shifts your labels.

Limits

  • Claude Code transcripts only, for now. Codex and Cursor logs are not read yet.
  • Task type is judged from the last agent reply and your message, not the whole session.
  • The rubric was tuned on one person's logs.
  • Labels aren't perfectly stable between runs. Two independent runs on the same 60 messages agreed on correction 93% of the time, on task 70%, and on topic 76% when the task matched. Disagreements sit at fuzzy edges (writing vs meta, code vs ops), mostly short "ok do that" messages. Treat small differences between topics as noise.

Contributing

Issues and pull requests are welcome, especially readers for other agents' transcript formats. See CONTRIBUTING.md.

License

MIT © Intikhab Azam

Keywords: Claude Code analytics · AI coding agent evaluation · correction rate · CLAUDE.md rules generator · agent transcripts · human feedback · preference pairs · DPO dataset · LLM evaluation · developer productivity

Release files for pushback 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pushback 0.1.3
File Size Uploaded
pushback-0.1.3.tar.gz 40.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pushback 0.1.3
File Interpreter ABI Platform
pushback-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 72.7 kB

Release files / pushback-0.1.3.tar.gz

Download URL pushback-0.1.3.tar.gz
Size 40.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d03703dc9a13346f3bc79f335c0a459cfbc2b63247c3df4e9e767a9dce6ad254
BLAKE2b-256 checksum
How to use checksums
787dde9cffacc66ece27d9425158b86d5f64f6ff817390bc4f1e094fc34beb64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.3

Release files / pushback-0.1.3-py3-none-any.whl

Download URL pushback-0.1.3-py3-none-any.whl
Size 31.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6aa14d275d9cbb59487506ddf95e683042a877b4f4aee6f1eeedbefdaea3b904
BLAKE2b-256 checksum
How to use checksums
1f6aa163b889fd2dae462bb92bb4183594dc5d957234a0ae747b2e3f1bbe5894
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page