<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ken Imoto</title>
    <description>The latest articles on DEV Community by Ken Imoto (@kenimo49).</description>
    <link>https://dev.to/kenimo49</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3800250%2F275022f6-cba9-47e3-b69e-e8faf7675a0c.jpg</url>
      <title>DEV Community: Ken Imoto</title>
      <link>https://dev.to/kenimo49</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kenimo49"/>
    <language>en</language>
    <item>
      <title>local-step-router: 324-Item Eval and Decision Tree for Qwen 35B Routing</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Wed, 02 Dec 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/local-step-router-324-item-eval-and-decision-tree-for-qwen-35b-routing-475l</link>
      <guid>https://dev.to/kenimo49/local-step-router-324-item-eval-and-decision-tree-for-qwen-35b-routing-475l</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi3zl9wapsdxbvxfsngmg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi3zl9wapsdxbvxfsngmg.png" alt="324-item eval set split: 180 positive (120 shaped + 48 PII + 12 prose) vs 144 negative (6 kinds x 24 trap items)" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A local LLM is a different machine depending on what question you ask it. Ask it to decide a whole request and it hedges. Ask it to decide a single step with a pinned type and it answers. That gap is the reason my router has a 324-item eval set and a tree of rules in front of the LLM.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/kenimo49/local-step-router" rel="noopener noreferrer"&gt;local-step-router&lt;/a&gt; is the companion code for a book I wrote on routing agent work between a local Qwen model on an RTX 4070 and Claude Code in the cloud. The number that started the whole thing: &lt;strong&gt;96 of 100 of my daily requests had to go to the frontier model&lt;/strong&gt;. A number I did not enjoy when I first printed it. Split the same work into single steps and about half of 200 could stay local. The rest of this post is what is inside the repo, not inside the book: the 324-item eval set and the decision tree that reads it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why 324 items instead of a benchmark run
&lt;/h2&gt;

&lt;p&gt;Public LLM benchmarks run on tasks. local-step-router is not trying to grade a model's coding ability. It has to answer a different question at the gate before a request reaches the frontier orchestrator: &lt;strong&gt;does this text contain a secret, named personal data, or confidential prose that should not leave the machine as-is?&lt;/strong&gt; That question has a shape, and the eval set has to match that shape.&lt;/p&gt;

&lt;p&gt;The 324 items are split 180 positive and 144 negative. Both halves are generated from &lt;code&gt;data/build_gate_set.py&lt;/code&gt; with a fixed seed, so you can rebuild them on your machine and nothing is taken from my real logs.&lt;/p&gt;

&lt;p&gt;The positives break down into three groups the gate has to stop for different reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shaped secrets&lt;/strong&gt; (120 items, 10 kinds). &lt;code&gt;ghp_&lt;/code&gt; tokens, AWS access keys, Slack bot tokens, Stripe &lt;code&gt;sk_live_&lt;/code&gt; keys, OpenAI &lt;code&gt;sk-proj-&lt;/code&gt; keys, OpenSSH private keys, JWTs, Postgres URLs with passwords, Luhn-valid card numbers, My Number IDs with the check digit. These look like themselves. A regex should catch them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personal data&lt;/strong&gt; (48 items, 4 kinds). Name + mobile + email, name + Japanese address, name + date of birth, name + bank account. These do not carry a label that says "secret." Regex alone misses most of them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prose passwords&lt;/strong&gt; (12 items). Sentences like "the initial VPN password is &lt;code&gt;xyz&lt;/code&gt;." The password itself is random, but the carrier phrase is what makes it stop-worthy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The negatives are not boring. They are the stuff a naive gate mistakes for a hit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;topic_only&lt;/code&gt;: "How should I store API keys safely?" (no secret, just a topic)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;doc_example&lt;/code&gt;: &lt;code&gt;AKIAIOSFODNN7EXAMPLE&lt;/code&gt;, &lt;code&gt;4111 1111 1111 1111&lt;/code&gt;, &lt;code&gt;user@example.com&lt;/code&gt; (exact strings from official docs)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;masked&lt;/code&gt;: &lt;code&gt;sk-proj-****&lt;/code&gt;, &lt;code&gt;ghp_xxxxxxxxxxxxxxxx&lt;/code&gt;, &lt;code&gt;${DB_PASSWORD}&lt;/code&gt;, &lt;code&gt;&amp;lt;YOUR_API_KEY&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hash_uuid&lt;/code&gt;: git SHAs, UUIDs, &lt;code&gt;sha256:...&lt;/code&gt; digests&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;number_not_pii&lt;/code&gt;: order numbers, JAN codes, company main-line phone numbers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;public_info&lt;/code&gt;: public API endpoints, published corporate addresses, public phone services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of those six kinds appears 24 times. If you only look at the positives, your gate is a sieve. The negatives are where the thresholds get set and the false-alarm rate gets paid.&lt;/p&gt;

&lt;h2&gt;
  
  
  The decision tree before the judge runs
&lt;/h2&gt;

&lt;p&gt;The repo draws a line that most "LLM as a judge" writeups blur: a rules-first decision tree sits in front of the probability judge, and most steps never reach the judge at all.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;steprouter/router.py&lt;/code&gt; is 60 lines. It holds a list of &lt;code&gt;Rule&lt;/code&gt; objects, walks them top to bottom, and returns the first match. A rule is a dict like &lt;code&gt;{"tool": "WebFetch"} -&amp;gt; local&lt;/code&gt; or &lt;code&gt;{"tool": ["Agent", "Task"]} -&amp;gt; frontier&lt;/code&gt;. The probability function is there, but it is &lt;code&gt;None&lt;/code&gt; by default. From the example &lt;code&gt;examples/routing.yaml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;match&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;tool:&lt;/span&gt; &lt;span class="s"&gt;WebFetch&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;match&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;tool:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;frontier&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;match&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;kind:&lt;/span&gt; &lt;span class="s"&gt;commit_message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;frontier&lt;/span&gt;         &lt;span class="c1"&gt;# frontier until a probability judge is added
&lt;/span&gt;
&lt;span class="na"&gt;probability&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;           &lt;span class="c1"&gt;# off until measured with the same judge model
&lt;/span&gt;&lt;span class="na"&gt;default_route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;frontier&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The order is the point. WebFetch steps settle at the first rule. Agent and Task steps settle at the second. Commit-message steps settle at the third. A local judge could plausibly handle them, but the config opts out until the judge is measured on that specific step type. Everything else falls through to the default. The probability function never fires in this config. A judge model that costs 400 to 600 ms per call is not consulted when a 20 ns dict lookup already has the answer.&lt;/p&gt;

&lt;p&gt;This is the piece a lot of "route with an LLM" posts skip. A one-line rule beat a 9B judge model on the single prompt that returns its probability, on the same eval set, consistently. The judge's probability is not useless; it is wasted on decisions a rule can make. I spent a weekend tuning the judge before I accepted the dict lookup was going to win.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two separate structures, not one
&lt;/h2&gt;

&lt;p&gt;The entrance gate in &lt;code&gt;steprouter/gate.py&lt;/code&gt; is a different beast from the step router. It runs on the full request text before the frontier orchestrator sees it. The 324-item eval set is for the gate, not the router.&lt;/p&gt;

&lt;p&gt;The gate stacks three layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Regex&lt;/strong&gt;: gitleaks for standard credential shapes, plus Japan-specific PII rules in &lt;code&gt;steprouter/jp_rules.py&lt;/code&gt; (mobile numbers, bank account formats, My Number with checksum, Luhn-valid cards, "password is..." sentences).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local judge&lt;/strong&gt;: if regex says nothing, &lt;code&gt;steprouter/judge.py&lt;/code&gt; reads a one-character answer from Ollama's native API using &lt;code&gt;logprobs: true, top_logprobs: 20&lt;/code&gt;, and returns the probability of the "Y" candidate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Threshold&lt;/strong&gt;: compare the probability to a line drawn from your own labeled data, not 0.5. &lt;code&gt;steprouter/threshold.py&lt;/code&gt; is a CLI that computes AUROC and a 5-fold CV with the "lowest P among positives × margin" rule. The default in the example config is &lt;code&gt;0.0071&lt;/code&gt;, a number that comes from the author's labels and has no meaning on yours.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If a request trips the gate, it has three exits based on the hit kind: redact the matched span and hand it to the frontier, keep the whole task local (for one-shot tasks), or return it to a human. The router at the step level is a separate structure that only starts after this gate passes.&lt;/p&gt;

&lt;p&gt;Keeping them separate matters because they fail differently. The gate's cost of a miss is a leaked secret. The router's cost of a miss is a slightly worse answer or a slightly bigger bill. One wants very high recall; the other wants a cheap default and a short rule table.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the eval set does not cover
&lt;/h2&gt;

&lt;p&gt;Three things worth naming so the 324-item number is not misread:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The values are synthetic.&lt;/strong&gt; Real &lt;code&gt;ghp_&lt;/code&gt; tokens have random payloads but real prefixes; &lt;code&gt;build_gate_set.py&lt;/code&gt; keeps the prefix and randomizes the rest. Real secrets committed by real teammates in real diffs look different enough that the regex rules sometimes stop them and sometimes do not. The book covers the gap; the repo does not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The language is Japanese + English templates.&lt;/strong&gt; The PII rules are Japan-specific. If your gate has to stop a US Social Security Number or a UK NIN, you write those rules yourself in the same shape as &lt;code&gt;jp_rules.py&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The threshold is one person's.&lt;/strong&gt; &lt;code&gt;0.0071&lt;/code&gt; comes from my qwen3.5:4b, one prompt version, and one definition of "confidential." The threshold CLI is there so you draw yours; the number on the shelf is not yours.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you ignore all three and copy-paste the config, you get a gate tuned for a different machine. The LP ships numbers so you can compare, not so you can inherit.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this routing is good at
&lt;/h2&gt;

&lt;p&gt;The shape it is built for is a Claude Code harness driving a lot of steps on an RTX 4070. For that shape, the measured outcomes in the book are: &lt;strong&gt;96% of whole requests had to go to the frontier model, half of the 200 single steps I counted could stay local, and the threshold worksheet cut missed secrets from 20 to 2&lt;/strong&gt; on my definition. The llama.cpp cpu-moe flag that gets Qwen3-35B-A3B to 34.6 tok/s on a 4070 is covered in a separate post; it is the throughput prerequisite that makes "local for half the steps" an actual option and not a theoretical one.&lt;/p&gt;

&lt;p&gt;The hour-of-day cost crossover is in &lt;a href="https://kenimoto.dev/blog/claude-code-max-vs-api-vs-qwen-hour-of-day-breakeven/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=local-step-router-324-eval" rel="noopener noreferrer"&gt;this breakeven analysis&lt;/a&gt; if the question is "which plan at which daily volume." The structural answer has three parts: rules in the front, a probability judge behind them, a gate at the very entrance. That is what local-step-router encodes. Clone it, rebuild the eval set with &lt;code&gt;data/build_gate_set.py&lt;/code&gt;, point the threshold CLI at your own labeled examples, and the numbers that come out will be yours.&lt;/p&gt;




&lt;p&gt;The full method is in the book: counting requests and steps, running the regex gate, drawing your own threshold, designing the typed return value a local worker sends back. &lt;a href="https://kenimoto.dev/books/local-llm-step-routing?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=local-step-router-324-eval" rel="noopener noreferrer"&gt;Local LLM or Claude Code?&lt;/a&gt; (Kindle Unlimited, $4.99). The companion code (MIT) is &lt;a href="https://github.com/kenimo49/local-step-router" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>opensource</category>
      <category>devops</category>
      <category>llm</category>
    </item>
    <item>
      <title>GitHub PR Templates: 5 Self-Checks CI Can't Automate (and 3 Principles)</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Tue, 01 Dec 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/github-pr-templates-5-self-checks-ci-cant-automate-and-3-principles-37pn</link>
      <guid>https://dev.to/kenimo49/github-pr-templates-5-self-checks-ci-cant-automate-and-3-principles-37pn</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqeqa22nbd69gql2gg1ju.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqeqa22nbd69gql2gg1ju.png" alt="GitHub PR template: 5 self-check items (automated gates / tests / AGENTS.md / scope separation / 300 line limit) and 3 design principles (keep it short, be specific, no overlap with CI)" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every team that has shipped a PR titled just "fix" knows the next thirty minutes. The reviewer reads the diff, reconstructs what the author was thinking, and asks three questions the description could have answered. Multiply by the number of PRs per week and the cost of that missing recipe is measured in reviewer hours, not in lines of code.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;.github/pull_request_template.md&lt;/code&gt; is how you stop paying it. Not with a long template, which gets ignored. With a short one that makes the reviewer's job human: judging the parts CI cannot. This is chapter 8 of &lt;a href="https://kenimoto.dev/books/harness-code-review?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=pr-template-5-checks" rel="noopener noreferrer"&gt;my book on systematizing AI code review&lt;/a&gt;, applied to the GitHub side of the pipeline. The whole pattern fits in three design principles and five self-check items.&lt;/p&gt;

&lt;h2&gt;
  
  
  What goes in the template
&lt;/h2&gt;

&lt;p&gt;Start concrete. This is the one I ship on new repos.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&amp;lt;!-- .github/pull_request_template.md --&amp;gt;

&lt;span class="gu"&gt;## Summary
&lt;/span&gt;&amp;lt;!-- What changed. 1-3 sentences. --&amp;gt;

&lt;span class="gu"&gt;## Why
&lt;/span&gt;&amp;lt;!-- The reason. Link the issue if there is one. --&amp;gt;
Closes #

&lt;span class="gu"&gt;## Type
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;[ ] Feature
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Bugfix
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Refactor (no behavior change)
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Tests
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Docs
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Dependencies

&lt;span class="gu"&gt;## How to review
&lt;/span&gt;&amp;lt;!-- For large PRs: which file to read first. --&amp;gt;

&lt;span class="gu"&gt;## Screenshots (UI changes)
&lt;/span&gt;&amp;lt;!-- Before / after. --&amp;gt;

&lt;span class="gu"&gt;## Self-check
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;[ ] All automated gates (lint / type check / tests) pass
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Tests added or updated
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Follows the &lt;span class="sb"&gt;`Code Direction`&lt;/span&gt; section of AGENTS.md
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Refactor and feature work not mixed in the same PR
&lt;span class="k"&gt;- &lt;/span&gt;[ ] Under 300 lines (or split rationale documented)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Five self-check items. Stop before you reach ten. The line where a checklist stops being read and starts being ticked without reading is a lot closer to ten than you think. My first template had nine. Nobody read item nine, including the person who ticked it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three principles for the checklist
&lt;/h2&gt;

&lt;p&gt;Every item in that self-check survives against three rules. If a candidate item fails any of them, it does not go in.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Keep it short
&lt;/h3&gt;

&lt;p&gt;Ten-plus items turn the checklist into performance theater. Target is five to seven. If item count creeps past that, either a rule can be automated out, or the template is being used to compensate for a weakness elsewhere (team norms, onboarding docs, the issue template). Fix the real place; the PR template is not the catch-all.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Make it specific, not abstract
&lt;/h3&gt;

&lt;p&gt;The classic failure mode is "I verified the code quality." That sentence passes code review training and does zero work in review.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bad  : - [ ] Code quality verified
Good : - [ ] All automated gates (lint / type check / tests) pass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "good" version is specific enough that an author checking it has an actual action in mind. Abstract items get ticked by default; specific items do not.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Do not duplicate what CI already owns
&lt;/h3&gt;

&lt;p&gt;If &lt;code&gt;pnpm test&lt;/code&gt; is going to run in CI on every push, do not put "tests pass" in the author's self-check. CI will tell you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Unnecessary: - [ ] All tests pass (CI will tell us)
Necessary  : - [ ] Refactor and feature work not mixed in the same PR
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second item is what makes the checklist valuable. CI cannot see mixed intent. Humans can. The whole template earns its keep by concentrating on exactly the judgments CI cannot make: separation of concerns, PR scope, alignment with the project's &lt;code&gt;Code Direction&lt;/code&gt;, and the "did you remember to screenshot the UI change" items that live outside the test suite.&lt;/p&gt;

&lt;p&gt;Apply the three principles together and the self-check lands somewhere between four and six items on most repos. On mine, five is the modal count. It fits on one screen and still carries weight.&lt;/p&gt;

&lt;h2&gt;
  
  
  Draft PRs for design feedback
&lt;/h2&gt;

&lt;p&gt;Not every PR wants a shippable review. Some want a sanity check on the approach before you spend three days finishing.&lt;/p&gt;

&lt;p&gt;GitHub's Draft PRs plus a second template file handle this. Put it at &lt;code&gt;.github/PULL_REQUEST_TEMPLATE/draft.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&amp;lt;!-- Draft PR template --&amp;gt;

&lt;span class="gu"&gt;## This is a Draft PR
&lt;/span&gt;
Design feedback wanted. Do not nitpick the code yet.

&lt;span class="gu"&gt;## What I want to discuss
&lt;/span&gt;&amp;lt;!-- The design decision I am unsure about. --&amp;gt;

&lt;span class="gu"&gt;## Approach I tried
&lt;/span&gt;&amp;lt;!-- Why I went this direction. --&amp;gt;

&lt;span class="gu"&gt;## Concerns
&lt;/span&gt;&amp;lt;!-- Problems I can already see. --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason this matters: a lot of "huge review burden" PRs are actually two PRs stacked. One is the design decision; one is the implementation. If the design decision is wrong, the implementation review is wasted work. Draft PRs let reviewers answer the design question first, cheaply, before anyone has produced a 1,400-line diff to redo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multiple templates on one repo
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;.github/PULL_REQUEST_TEMPLATE/&lt;/code&gt; is a directory (not a single file) as soon as you have more than one template. One per PR shape:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.github/
└── PULL_REQUEST_TEMPLATE/
    ├── feature.md
    ├── bugfix.md
    ├── refactor.md
    └── draft.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Appending &lt;code&gt;?template=feature.md&lt;/code&gt; to the PR URL loads that one. Point to these links from your contributing docs so authors do not have to remember. On repos with a steady mix of feature and bugfix work, this is the lowest-friction way to get the right template in front of the author without a "please use the right template" comment on every PR.&lt;/p&gt;

&lt;p&gt;The payoff is small-per-PR and large-in-aggregate. A bugfix PR without "reproduction steps" takes an extra ten minutes to review; a feature PR without "screenshots" bounces back and forth once or twice. The template catches both before they become comments.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to leave out
&lt;/h2&gt;

&lt;p&gt;The honest limit of what a PR template can do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It will not catch logic bugs.&lt;/strong&gt; CodeRabbit, Copilot, a human reviewer, and tests do that. The template shapes the review request; it does not do the review.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It cannot enforce items the author ticks without reading.&lt;/strong&gt; That is a culture problem, not a template problem. The rules above (short, specific, non-duplicative with CI) keep the ticking cost high enough that reading is cheaper.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It does not replace a design doc.&lt;/strong&gt; Draft PRs help, but for a change that affects three services, a separate design doc still carries more than a draft PR template can.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any of those three looks like a problem your template is trying to solve, the problem belongs somewhere else. A PR template stays valuable because it stays small.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape I recommend
&lt;/h2&gt;

&lt;p&gt;Five self-check items. Three design principles behind them. A separate draft template for design feedback. Change-type-specific templates when the mix justifies it.&lt;/p&gt;

&lt;p&gt;That is enough structure to remove most "where do I even start" friction from review, and small enough that nobody treats the checklist as a form to speed-click. The reviewer gets a recipe with the dish; the author gets fewer "could you explain what this PR is for" comments; CI keeps doing the parts CI is good at.&lt;/p&gt;




&lt;p&gt;The full pipeline this chapter belongs to covers how AGENTS.md drives the review, how three AI reviewers (CodeRabbit, Copilot, Claude Code) read a PR differently, and how to keep the review loop under thirty minutes per PR: &lt;a href="https://kenimoto.dev/books/harness-code-review?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=pr-template-5-checks" rel="noopener noreferrer"&gt;Systematizing AI Code Review&lt;/a&gt; (Kindle Unlimited).&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
      <category>opensource</category>
      <category>github</category>
    </item>
    <item>
      <title>Claude Code's 9-File Setup: 6 Definition Docs + 3 Memory Files (What Each One Does)</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Mon, 30 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/claude-codes-9-file-setup-6-definition-docs-3-memory-files-what-each-one-does-49dg</link>
      <guid>https://dev.to/kenimo49/claude-codes-9-file-setup-6-definition-docs-3-memory-files-what-each-one-does-49dg</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuf03loyzqe0xwdauz8gp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuf03loyzqe0xwdauz8gp.png" alt="The 9 files for a document-first Claude Code setup: 6 definition docs (PRD/APP_FLOW/TECH_STACK/FRONTEND_GUIDELINES/BACKEND_STRUCTURE/IMPLEMENTATION_PLAN) + 3 memory files (CLAUDE.md/progress.md/lessons.md)" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"Just make a nice login screen." The first pass looks fine. The second pass drifts. By the fifth round of edits, the codebase is a tangle nobody, human or model, can hold in their head. That has happened to me often enough that I now refuse to open a project directory until nine files exist.&lt;/p&gt;

&lt;p&gt;This is a pattern I built up across five projects running in parallel and wrote down in &lt;a href="https://kenimoto.dev/books/claude-code-mastery?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-9-file-setup" rel="noopener noreferrer"&gt;chapter 5 of my Claude Code book&lt;/a&gt;. It works because the failure mode of vibe coding is not model capability. It is &lt;strong&gt;the absence of structure in the prompt&lt;/strong&gt;. If you walked up to a senior engineer and said "just make a nice login screen," they would ask you five questions before they typed anything. Claude Code does not ask. It builds. And its "nice" and your "nice" are not the same shape.&lt;/p&gt;

&lt;p&gt;The nine files are the structure you would otherwise improvise over five sessions. Six of them answer &lt;em&gt;what are we building&lt;/em&gt;. Three of them answer &lt;em&gt;where were we last time&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The six definition docs
&lt;/h2&gt;

&lt;p&gt;Write these before you write code. They are not deliverables; they are context you are preloading.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;code&gt;PRD.md&lt;/code&gt;: what you are building, and what you are not
&lt;/h3&gt;

&lt;p&gt;Two sections do most of the work. "What we are building" is the easy half. "What we are &lt;strong&gt;not&lt;/strong&gt; building" is the half that stops Claude Code from adding a Slack integration you never asked for.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## In scope
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Email + password auth
&lt;span class="k"&gt;- &lt;/span&gt;Task CRUD
&lt;span class="k"&gt;- &lt;/span&gt;Labels
&lt;span class="k"&gt;- &lt;/span&gt;Due dates and reminders

&lt;span class="gu"&gt;## Out of scope (v1)
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Team sharing (v2)
&lt;span class="k"&gt;- &lt;/span&gt;Mobile app (web only for v1)
&lt;span class="k"&gt;- &lt;/span&gt;Slack / Calendar integrations
&lt;span class="k"&gt;- &lt;/span&gt;Realtime sync
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you skip the "out of scope" list, every feature you did not name becomes a judgment call the model has to make. It will make a plausible one. That is the worst outcome, because the plausible one is hard to catch in review.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;code&gt;APP_FLOW.md&lt;/code&gt;: screens and transitions
&lt;/h3&gt;

&lt;p&gt;A list of routes and the main user flows between them. Short.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Screens
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;/login
&lt;span class="k"&gt;- &lt;/span&gt;/register
&lt;span class="k"&gt;- &lt;/span&gt;/dashboard
&lt;span class="k"&gt;- &lt;/span&gt;/tasks/:id
&lt;span class="k"&gt;- &lt;/span&gt;/settings

&lt;span class="gu"&gt;## Register flow
&lt;/span&gt;Login -&amp;gt; "Sign up" -&amp;gt; Register form -&amp;gt; Validation -&amp;gt; Dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The point is not completeness. The point is that when Claude Code is halfway through building the dashboard, you can say "follow APP_FLOW.md" instead of re-explaining the navigation.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;code&gt;TECH_STACK.md&lt;/code&gt;: pinned versions, and a rule
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Frontend
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Next.js 14.2.x (App Router)
&lt;span class="k"&gt;- &lt;/span&gt;TypeScript 5.4.x (strict)
&lt;span class="k"&gt;- &lt;/span&gt;Tailwind 3.4.x
&lt;span class="k"&gt;- &lt;/span&gt;shadcn/ui

&lt;span class="gu"&gt;## Backend
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Next.js API Routes
&lt;span class="k"&gt;- &lt;/span&gt;Prisma 5.x
&lt;span class="k"&gt;- &lt;/span&gt;PostgreSQL 16

&lt;span class="gu"&gt;## Tests
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Vitest 1.x (unit)
&lt;span class="k"&gt;- &lt;/span&gt;Playwright 1.x (E2E)

&lt;span class="gu"&gt;## Rule: do not add libraries outside this list.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last line is why this file exists. Without it, Claude Code will reach for a new library every time a problem gets mildly awkward. With it, dependency sprawl stops being a thing you fight every session.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;code&gt;FRONTEND_GUIDELINES.md&lt;/code&gt;: design tokens and component conventions
&lt;/h3&gt;

&lt;p&gt;Primary color, accent color, font families, radii, spacing scale. Which components live where. Which existing components to prefer over new ones. Nothing fancy, but it is what stops the model from inventing a seventh button style.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. &lt;code&gt;BACKEND_STRUCTURE.md&lt;/code&gt;: schema and API contract
&lt;/h3&gt;

&lt;p&gt;The tables, their columns, their relations. The API routes and their shapes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## tasks
&lt;/span&gt;| column   | type         | note                 |
|----------|--------------|----------------------|
| id       | UUID         | PK                   |
| user_id  | UUID         | FK -&amp;gt; users.id       |
| title    | VARCHAR(500) |                      |
| status   | ENUM         | pending / done       |
| due_date | DATE         | nullable             |

&lt;span class="gu"&gt;## API
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;GET    /api/tasks            -&amp;gt; { data: Task[] }
&lt;span class="k"&gt;- &lt;/span&gt;POST   /api/tasks            -&amp;gt; { data: Task }
&lt;span class="k"&gt;- &lt;/span&gt;PATCH  /api/tasks/:id        -&amp;gt; { data: Task }
&lt;span class="k"&gt;- &lt;/span&gt;DELETE /api/tasks/:id        -&amp;gt; { success: boolean }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Backends are where the "it works but silently returns the wrong shape" bugs live. A table like this up front removes most of them.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. &lt;code&gt;IMPLEMENTATION_PLAN.md&lt;/code&gt;: phases with a verification gate on each
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Phase 1: foundations
&lt;/span&gt;1. Next.js scaffolding + TS config
2. Prisma + schema
3. Auth (register / login / logout)
4. VERIFY: register -&amp;gt; login -&amp;gt; logout cycle works end-to-end

&lt;span class="gu"&gt;## Phase 2: core
&lt;/span&gt;5. Task CRUD API
6. Dashboard UI
7. Task create / edit / delete UI
8. VERIFY: full task lifecycle works end-to-end

&lt;span class="gu"&gt;## Phase 3: extended
&lt;/span&gt;9. Labels
10. Due dates + reminders
11. E2E tests
12. VERIFY: integration tests pass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;VERIFY:&lt;/code&gt; lines are the cheapest quality gate you will ever write. After each phase, you check the verification works, then you give Claude Code the next phase. You never accumulate three phases of unverified work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three memory files
&lt;/h2&gt;

&lt;p&gt;Six docs tell the model what to build. The next three keep the model from losing the thread between sessions.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;code&gt;CLAUDE.md&lt;/code&gt;: project rules and the index
&lt;/h3&gt;

&lt;p&gt;This is the file Claude Code reads first. Make it the index that points at the six definition docs, plus the handful of invariant rules.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;# CLAUDE.md
&lt;/span&gt;
&lt;span class="gu"&gt;## Project
&lt;/span&gt;Next.js 14 + TS + Prisma task manager.

&lt;span class="gu"&gt;## Definitions
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Requirements: docs/PRD.md
&lt;span class="k"&gt;- &lt;/span&gt;Flow: docs/APP_FLOW.md
&lt;span class="k"&gt;- &lt;/span&gt;Stack: docs/TECH_STACK.md (do not add libraries outside this list)
&lt;span class="k"&gt;- &lt;/span&gt;Frontend: docs/FRONTEND_GUIDELINES.md
&lt;span class="k"&gt;- &lt;/span&gt;Backend: docs/BACKEND_STRUCTURE.md
&lt;span class="k"&gt;- &lt;/span&gt;Plan: docs/IMPLEMENTATION_PLAN.md

&lt;span class="gu"&gt;## Traps
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;IF a new API route is added -&amp;gt; THEN update BACKEND_STRUCTURE.md
&lt;span class="k"&gt;- &lt;/span&gt;IF a Prisma schema changes -&amp;gt; THEN run &lt;span class="sb"&gt;`npx prisma generate`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "Traps" section is the one that pays for itself fastest. Every time you catch Claude Code tripping over the same thing twice, add a one-liner here.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;code&gt;progress.md&lt;/code&gt;: the external memory
&lt;/h3&gt;

&lt;p&gt;Four sections: Done, In progress, Next, Blockers. This is the file that answers "where were we?" at the start of a session after &lt;code&gt;/clear&lt;/code&gt; or a context compaction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;# progress.md
&lt;/span&gt;
&lt;span class="gu"&gt;## Done
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;[x] Phase 1 (foundations + auth)
&lt;span class="k"&gt;- &lt;/span&gt;[x] Phase 2: Task CRUD API

&lt;span class="gu"&gt;## In progress
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;[ ] Phase 2: dashboard UI (list view done, edit modal missing)

&lt;span class="gu"&gt;## Next
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Task edit modal
&lt;span class="k"&gt;- &lt;/span&gt;Delete confirmation dialog

&lt;span class="gu"&gt;## Blockers
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;(none)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have Claude Code update this file automatically at the end of every task. Prompt: "when the task is done, update progress.md before you stop."&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;code&gt;lessons.md&lt;/code&gt;: mistakes you only want to make once
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## 2026-02-18
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Next.js App Router: &lt;span class="sb"&gt;`cookies()`&lt;/span&gt; only works in Server Components.
  In API routes, use &lt;span class="sb"&gt;`request.cookies`&lt;/span&gt; instead.

&lt;span class="gu"&gt;## 2026-02-20
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Tailwind &lt;span class="sb"&gt;`dark:`&lt;/span&gt; requires &lt;span class="sb"&gt;`darkMode: 'class'`&lt;/span&gt; in config
  when using the class strategy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A lesson here is private. When the same lesson shows up three times, promote it to &lt;code&gt;CLAUDE.md&lt;/code&gt; as a trap rule. That is the self-improvement loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a 9-file setup works where a 100-line &lt;code&gt;CLAUDE.md&lt;/code&gt; does not
&lt;/h2&gt;

&lt;p&gt;The temptation when you first try this pattern is to collapse everything into one giant &lt;code&gt;CLAUDE.md&lt;/code&gt;. Resist it. The reason is a term I use a lot and borrow from technical debt: &lt;strong&gt;cognitive debt&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Technical debt is code quality degrading until future work gets expensive. Cognitive debt is &lt;strong&gt;understanding degrading until no one, human or model, can hold the project in their head&lt;/strong&gt;. Vibe coding accrues cognitive debt faster than any pattern I have seen. One giant &lt;code&gt;CLAUDE.md&lt;/code&gt; is better than nothing, but it dilutes signal. A task that needs the backend schema gets the full design tokens too.&lt;/p&gt;

&lt;p&gt;Nine separate files let you load exactly what the current task needs. Progressive disclosure, in the Jakob Nielsen sense:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Phase 1 implementation&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Read PRD.md, TECH_STACK.md, BACKEND_STRUCTURE.md.
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Implement Phase 1 from IMPLEMENTATION_PLAN.md.

&lt;span class="c"&gt;# Dashboard UI work later&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Read APP_FLOW.md and FRONTEND_GUIDELINES.md.
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Build the dashboard screen.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude Code can follow the references in &lt;code&gt;CLAUDE.md&lt;/code&gt; on its own, but spelling it out in the prompt is more reliable. Context ends up tighter, output ends up more on-spec.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task decomposition: build by feature, not by layer
&lt;/h2&gt;

&lt;p&gt;One last piece, because it compounds everything above. When you break work into tasks, do it by feature, not by technical layer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;# Wrong: "build the backend first"
&lt;/span&gt;Step 1: whole DB
Step 2: whole API
Step 3: whole UI
&lt;span class="gu"&gt;# -&amp;gt; three big phases that only integrate at the end
&lt;/span&gt;
&lt;span class="gu"&gt;# Wrong: "build the whole app"
&lt;/span&gt;Step 1: build an e-commerce backend
&lt;span class="gu"&gt;# -&amp;gt; one phase that is impossible to verify
&lt;/span&gt;
&lt;span class="gu"&gt;# Right: by feature
&lt;/span&gt;Step 1: user registration (DB + API + UI + test)
Step 2: product listing (DB + API + UI + test)
&lt;span class="gu"&gt;# -&amp;gt; each step verifiable end-to-end at completion
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The rule I use is: &lt;strong&gt;the smallest unit I can write an integration test around&lt;/strong&gt;. That is also the largest unit I can finish before cognitive debt starts accumulating.&lt;/p&gt;

&lt;h2&gt;
  
  
  The nine files, together
&lt;/h2&gt;

&lt;p&gt;The pattern runs on one idea: write down what the model would otherwise guess. The six definition docs are what-to-build guesses. The three memory files are where-we-were guesses. When all nine exist, Claude Code is no longer improvising structure; it is executing against one.&lt;/p&gt;

&lt;p&gt;The deeper reason this works: these documents are not for the AI. They are for me. Five projects in, when I come back to a repo I last touched three weeks ago, &lt;code&gt;PRD.md&lt;/code&gt; tells me what I was building and &lt;code&gt;progress.md&lt;/code&gt; tells me where I stopped. The AI's memory and mine are the same amnesia, solved by the same files.&lt;/p&gt;




&lt;p&gt;The rest of the pattern, including the trap rules that catch Claude Code's most common misreads and the implementation-phase prompts that match each definition doc, is in &lt;a href="https://kenimoto.dev/books/claude-code-mastery?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=claude-code-9-file-setup" rel="noopener noreferrer"&gt;Practical Claude Code&lt;/a&gt; (Kindle Unlimited).&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>claudecode</category>
      <category>devops</category>
    </item>
    <item>
      <title>Kahneman + 3 Biases: Why Your Sprint Estimate Is Off Before You Type It</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Wed, 25 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/kahneman-3-biases-why-your-sprint-estimate-is-off-before-you-type-it-g33</link>
      <guid>https://dev.to/kenimo49/kahneman-3-biases-why-your-sprint-estimate-is-off-before-you-type-it-g33</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu0i6ens682as2be0708f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu0i6ens682as2be0708f.png" alt="Planning Fallacy, Optimism Bias, Anchoring: three biases that quietly add weeks to every sprint" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;"How long will this take?"&lt;/p&gt;

&lt;p&gt;It is the question engineers are worst at answering, and the one we answer most often. Every sprint planning. Every quarterly roadmap. Every scoping conversation with a product manager who needs a number before lunch.&lt;/p&gt;

&lt;p&gt;The reason we are bad at it is not a skill issue. Kahneman and Tversky documented the first of the three culprits in 1979, and the pattern has reproduced in every follow-up study since. Your brain is running a specific kind of distortion when it predicts time and cost. You can know the distortion is there, and still have your next estimate come out short.&lt;/p&gt;

&lt;p&gt;Below are the three biases that account for most of the damage, with the mechanism for each and the countermeasure engineers can actually run. This is the estimation half of cognitive bias; code review has its own set and belongs in a separate post.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Planning fallacy: your past misses don't update your next guess
&lt;/h2&gt;

&lt;p&gt;Planning fallacy, named by Kahneman and Tversky in 1979 and formalized in Buehler, Griffin, and Ross's 1994 paper, is the systematic tendency to underestimate the time and cost a task will take. The uncomfortable specific finding: the bias does not shrink as you accumulate past experiences of underestimation. You can miss your last ten sprint estimates and the eleventh will still feel accurate as you write it down.&lt;/p&gt;

&lt;p&gt;The reason is in the shape of the mental model you use when estimating. You imagine the task going well. The design lands on the first attempt. The PR gets one round of review. CI passes. Nobody calls in sick. Each individual "things go well" assumption has a decent probability. The catch is that estimation requires &lt;em&gt;all&lt;/em&gt; of them to hold at once, and the joint probability of 8 independent "90% likely" events is 43%, not 90%. Your brain does not multiply those correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  How this hits engineers specifically
&lt;/h3&gt;

&lt;p&gt;Four patterns show up over and over in estimates that blow out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Only the "writing code" portion gets estimated.&lt;/strong&gt; Design, test writing, PR back-and-forth, documentation, deployment all get folded into a mental "that's quick" bucket that turns out not to be.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The first version is assumed to work.&lt;/strong&gt; Debugging time is not line-itemed. If the function is "an afternoon," the debugging is implicitly zero.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependent work is treated as instant.&lt;/strong&gt; The API team's delivery date, the design review, the security sign-off are all assumed to arrive the day you ask for them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context-switch cost is zero in the plan and real in the day.&lt;/strong&gt; Two hours in the morning plus two hours in the afternoon is not four hours of coding. Meetings, Slack interrupts, and the 20 minutes to re-page in the problem eat half of it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Countermeasure: reference-class forecasting
&lt;/h3&gt;

&lt;p&gt;Kahneman's own recommendation for planning fallacy is reference-class forecasting. The move is to stop estimating from the inside (task-detail-first) and start estimating from the outside (prior-cases-first):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;List the last 6 months of tickets that resemble this one.&lt;/li&gt;
&lt;li&gt;Take the &lt;strong&gt;median&lt;/strong&gt; actual time, not the mean. Medians are robust to the one disaster ticket that dragged the mean.&lt;/li&gt;
&lt;li&gt;Adjust the median by at most ±20% for task-specific factors. If you think it needs more, your reference class is probably wrong.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The pre-work this requires is logging both estimates and actuals. If your ticket tracker records only estimates, you have no reference class to pull from. Starting the log today is a small change with a 6-month lag before it pays off.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Optimism bias: "this one won't hit the usual problems"
&lt;/h2&gt;

&lt;p&gt;Optimism bias is the broader cousin of planning fallacy. Kahneman's description: humans predict their own future outcomes as better than base rates suggest they will be. It applies to estimation, but it also applies to risk assessment, which is where it quietly causes more damage than the 3-week-becomes-6-week miss.&lt;/p&gt;

&lt;p&gt;The engineer version shows up in sentences that feel reasonable when you're typing them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"This refactor doesn't touch the auth path, so it won't affect production."&lt;/li&gt;
&lt;li&gt;"The library upgrade is a minor version bump, no breaking changes."&lt;/li&gt;
&lt;li&gt;"Staging behaves the same as prod; we're fine."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each one is a risk estimate dressed up as a factual claim. Optimism bias shifts the base rate you're implicitly using toward the outcome you prefer, and the shift happens before you notice you're estimating a probability at all.&lt;/p&gt;

&lt;p&gt;The effect compounds. Once the premise "this probably won't go wrong" has entered the plan, downstream decisions follow from it. Rollback procedures get thinner. Testing budgets get cut. Buffer time gets reallocated to the next feature. The optimism is not in the one sentence; it's in every decision that sentence spawned.&lt;/p&gt;

&lt;h3&gt;
  
  
  Countermeasure: pre-mortem
&lt;/h3&gt;

&lt;p&gt;Psychologist Gary Klein proposed the pre-mortem as a structural counter to optimism bias. The format inverts the usual retrospective:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Before the project starts, assume it has already failed.&lt;/li&gt;
&lt;li&gt;As a team, spend 20 minutes listing the reasons it failed.&lt;/li&gt;
&lt;li&gt;Convert each reason into a prevention step with an owner.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The inversion matters. "List what could go wrong" runs into optimism bias immediately; your brain minimizes each risk as it surfaces. "We failed; why?" is a story-completion task, and your brain is excellent at story completion. The same risks come out, but they come out faster and with more specificity, because you're answering a different question.&lt;/p&gt;

&lt;p&gt;A pre-mortem adds maybe 30 minutes to the start of a project. A missed risk adds weeks.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Anchoring: the first number in the room owns the conversation
&lt;/h2&gt;

&lt;p&gt;Anchoring is the oldest of the three biases to be formalized (Tversky and Kahneman, 1974), and in estimation contexts it is the most visible. The claim is simple: once a number is in the conversation, everyone's subsequent estimate clusters around it, even when the anchor is clearly arbitrary.&lt;/p&gt;

&lt;p&gt;In sprint planning, the anchor is usually the first estimate someone states out loud. "I think it's about 3 days." The engineer who would otherwise have said "a week" now says "5 days." The engineer who would have said "half a day" now says "2 days." The variance in the room collapses toward the anchor and the group feels converged on a number they're actually pulled toward.&lt;/p&gt;

&lt;p&gt;There are three channels anchoring runs through in real teams:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The PM or stakeholder's expectation.&lt;/strong&gt; "Can we get this out in a month?" is an estimation question in form and an anchor in function. You start thinking about how to make the month work before you've checked whether a month is realistic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prior-ticket precedent.&lt;/strong&gt; "The similar feature last quarter took 2 weeks." The stack has changed, the team has changed, the requirements have changed, but the 2-week number stays glued to your current estimate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Story-point scale shape.&lt;/strong&gt; Fibonacci-style pointing (1, 2, 3, 5, 8, 13) has deliberate gaps, and the gaps become their own anchors. When you're torn between a 5 and an 8, the ticket you pointed yesterday owns the tiebreaker.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Countermeasure: planning poker, run strictly
&lt;/h3&gt;

&lt;p&gt;Planning poker's actual value is not that groups average to better numbers. It's that simultaneous reveal prevents anchoring. If everyone writes down their estimate before any number is spoken, the first person's answer cannot become the anchor.&lt;/p&gt;

&lt;p&gt;Planning poker fails when teams get loose about the rule. "Just tell me your number, then we'll compare" collapses the whole point of the exercise. So does "let's hear from the lead engineer first." Both reintroduce the exact anchoring the format was designed to prevent.&lt;/p&gt;

&lt;p&gt;If you run planning poker, run it with the reveal step intact. Otherwise you have the overhead of the ritual without the mechanism that makes the ritual worth doing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three biases compound in one meeting
&lt;/h2&gt;

&lt;p&gt;In a real sprint planning, the three stack on top of each other inside two minutes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The PM opens with "we need this out in 2 weeks." → &lt;strong&gt;Anchoring&lt;/strong&gt; sets the range.&lt;/li&gt;
&lt;li&gt;The engineer thinks "I can probably make 2 weeks work if things go well." → &lt;strong&gt;Optimism bias&lt;/strong&gt; picks the best-case path.&lt;/li&gt;
&lt;li&gt;The engineer estimates based on the best-case path. → &lt;strong&gt;Planning fallacy&lt;/strong&gt; ignores the probability of any of the fail paths firing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The output is a 2-week number that was pre-decided by the PM's opener and rubber-stamped by the two downstream biases. The ticket ships in 4 weeks. Nobody in the room was lying; the room was running three distortions in sequence.&lt;/p&gt;

&lt;p&gt;A rough heuristic that falls out of the planning-fallacy literature: if your gut says 2 weeks, plan for 4. This is not elegant. It is also closer to actual outcomes than the number your gut produced.&lt;/p&gt;

&lt;h2&gt;
  
  
  Estimation is unfinished work, not a prediction
&lt;/h2&gt;

&lt;p&gt;The point of knowing these three biases is not to get your estimate right the first time. That is not a thing that is going to happen. The point is to know which direction your estimate is wrong, so you can budget around the error instead of being surprised by it.&lt;/p&gt;

&lt;p&gt;An estimate you can't defend against anchoring, a plan you built without a pre-mortem, and a ticket you scoped without a reference class is a sprint commitment with three known holes in it. Filling the holes is cheap. Being surprised by them in week 3 is not.&lt;/p&gt;




&lt;p&gt;This piece draws on the estimation chapter of a book on cognitive biases engineers should know. If you want the rest of the set (framing, availability, confirmation bias, and the review-specific biases) the full book is here: &lt;a href="https://kenimoto.dev/books/engineer-psychology-tricks?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=kahneman-3-estimation-biases" rel="noopener noreferrer"&gt;&lt;strong&gt;Cognitive Bias for Software Engineers&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>devops</category>
      <category>webdev</category>
      <category>career</category>
    </item>
    <item>
      <title>GPT-4o vs Claude 3.5 vs Sonnet 4 vs LLaVA 7B: 480 Color Tests Reveal AI Blue</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Tue, 24 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/gpt-4o-vs-claude-35-vs-sonnet-4-vs-llava-7b-480-color-tests-reveal-ai-blue-2f7p</link>
      <guid>https://dev.to/kenimo49/gpt-4o-vs-claude-35-vs-sonnet-4-vs-llava-7b-480-color-tests-reveal-ai-blue-2f7p</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvlm5g51hacb4cubacycc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvlm5g51hacb4cubacycc.png" alt="GPT-4o, Claude 3.5, Claude Sonnet 4, LLaVA 7B, 40 colors × 480 observations, pixel sample shows 95.4% blue-purple concentration" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every AI-generated UI looks like the last one. Same cool blue background. Same purple accent. Same slightly-too-smooth gradient. If you've used three UI generators this year you already know the shape of their output before the first token streams in.&lt;/p&gt;

&lt;p&gt;The reflex explanation is that the models were trained on a lot of Dribbble-era SaaS marketing sites and that aesthetic leaked in. That explanation is partly true. But the stronger explanation shows up once you stop asking the models to design UIs and start asking them to &lt;em&gt;see color&lt;/em&gt; at all.&lt;/p&gt;

&lt;p&gt;Below is what came out of a 4-model, 40-color, 480-observation experiment. The dataset is open on Zenodo (DOI &lt;a href="https://doi.org/10.5281/zenodo.19159702" rel="noopener noreferrer"&gt;10.5281/zenodo.19159702&lt;/a&gt;) and the code is on &lt;a href="https://github.com/kenimo49/ai-blue-color-bias" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. If you want to reproduce the runs end-to-end, start there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Four vision-capable models under test: &lt;strong&gt;GPT-4o&lt;/strong&gt;, &lt;strong&gt;Claude 3.5 Sonnet&lt;/strong&gt;, &lt;strong&gt;Claude Sonnet 4&lt;/strong&gt;, and &lt;strong&gt;LLaVA 7B&lt;/strong&gt; (open-source, run locally for the control arm). Each model was shown 40 named color swatches, three times each, and asked a single question: &lt;em&gt;what is the HEX code of this color?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That's 4 models × 40 colors × 3 trials = 480 observations. The ground-truth HEX was known on every swatch, so the error is measurable in CIELAB ΔE, not vibes.&lt;/p&gt;

&lt;p&gt;The design is deliberately boring. No prompt engineering, no chain-of-thought, no multi-turn clarification. The weakness you want to measure is &lt;em&gt;perceptual&lt;/em&gt;, and the moment you let the model talk itself into an answer you've measured something else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 1: pure colors are easy, named mid-tones break
&lt;/h2&gt;

&lt;p&gt;Red, blue, green, yellow, the handful of colors with unambiguous single-word names, land within a few ΔE of the ground truth for the three commercial models. (LLaVA 7B nails red, green, and yellow but misses blue by roughly 18 ΔE on average, so the pattern is strongest on frontier models.) These are the colors the training distribution has seen most often, in captions, in alt-text, in CSS discussions, in the whole internet's worth of "color: red" examples.&lt;/p&gt;

&lt;p&gt;Shift to mid-tones with less common names (teal, lime green, mauve, chartreuse) and accuracy collapses by several multiples. The collapse is not evenly distributed. Models tend to round the named mid-tone back toward the nearest unambiguous primary. A teal swatch becomes "a kind of blue." A chartreuse swatch becomes "a yellow-green" and the returned HEX leans toward one or the other, never settling in the middle.&lt;/p&gt;

&lt;p&gt;The mechanism is lexical. "red" and "blue" occur all over the web in prose. "chartreuse" and "mauve" are terms you encounter on paint-store sites and in art-school glossaries, not in captions. A model that has learned color through co-occurrence with words rather than through calibrated perception is going to over-weight the frequent names and under-represent the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 2: pastels and desaturated colors are the worst
&lt;/h2&gt;

&lt;p&gt;Within any hue family, dropping the saturation makes the error worse. High-chroma reds are fine. Pale pinks are not. Vivid teal is fine. Washed-out sea-foam is not. The error in ΔE grows by roughly 2 to 3 times as you walk from the saturated version of a color toward its pastel version within the dataset.&lt;/p&gt;

&lt;p&gt;The uncomfortable part is which colors modern UI designers actually use. Dashboards, admin tools, mobile apps, marketing sites from the last five years: the palette is almost entirely low-saturation. Neutral grays warmed with a hint of blue. Muted sages. Dusty mauves. The exact band of the color space where the four models tested are worst is the band where professional UI work lives.&lt;/p&gt;

&lt;p&gt;The models are most reliable in the color zone designers least use, and least reliable in the zone designers use every day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 3: 95.4% of generated UI pixels are blue-purple
&lt;/h2&gt;

&lt;p&gt;When the experiment was extended from "what color is this swatch" to "what colors does the model produce when asked to design a UI," the output was analyzed at the pixel level. The hue bucket centered on &lt;strong&gt;240°&lt;/strong&gt; (the blue-to-purple band of the hue wheel) accounted for &lt;strong&gt;95.4%&lt;/strong&gt; of all pixels. Everything else, the entire rest of the hue wheel, accounted for 4.6%.&lt;/p&gt;

&lt;p&gt;That number is not a style choice. If four professional designers each got a brief for "a modern SaaS dashboard" and you measured their output, you would get a hue distribution with real variance in it. A lot of blue, yes, but also warm neutrals, accent reds, sage greens, some use of orange for calls-to-action. The AI-generated distribution is a spike, not a palette.&lt;/p&gt;

&lt;p&gt;The spike lines up with Pattern 1: blue is one of the handful of unambiguous color names the models recognize most accurately. The hue the model is most confident naming is the hue the model is most comfortable producing. The output collapses toward the model's own perceptual floor.&lt;/p&gt;

&lt;h2&gt;
  
  
  The self-reinforcing loop
&lt;/h2&gt;

&lt;p&gt;The three patterns above describe a closed loop that gets tighter each generation:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Vision-language models perceive pure, high-saturation primaries most accurately, and blue most accurately of those.&lt;/li&gt;
&lt;li&gt;When generating UIs, the models default to the colors they can name confidently, producing blue-purple-heavy output.&lt;/li&gt;
&lt;li&gt;That output enters the training data of the next generation of multimodal models (scraped screenshots, Dribbble shots, Behance exports, every "built with [AI UI tool]" showcase site).&lt;/li&gt;
&lt;li&gt;The next generation is trained on an increasingly blue-purple visual corpus, which reinforces the perceptual bias.&lt;/li&gt;
&lt;li&gt;Return to step 1.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each lap of the loop concentrates the hue distribution further. The AI UI aesthetic doesn't converge because designers like blue. It converges because the models that generate it can't reliably work outside the hue band where their recognition accuracy is highest, and their outputs become the training floor for their successors.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a design team can do about it
&lt;/h2&gt;

&lt;p&gt;The fix is not a prompt. Asking "please use varied colors" produces output that still skews 90%+ toward 240°; the model is nodding at the instruction and then defaulting to the hue it's most confident with.&lt;/p&gt;

&lt;p&gt;The controls that actually hold are structural:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Specify colors as HEX, not as names.&lt;/strong&gt; &lt;code&gt;#F97316&lt;/code&gt; is unambiguous. "A warm orange" is not. The named-color pipeline is where the bias enters, and bypassing it with HEX removes the main failure path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin a design-token palette and validate against it.&lt;/strong&gt; If your spec says the accent is &lt;code&gt;#F97316&lt;/code&gt;, the generated output should match that token. Any pixel outside the token palette is a hallucination to be corrected, not a creative contribution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visually review any mid-tone or pastel the model produces.&lt;/strong&gt; These are exactly the colors it is worst at. Don't accept them without comparing to the intended swatch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deliberately choose a non-blue accent on at least one surface per project.&lt;/strong&gt; This is the smallest intervention that breaks the loop in one direction: a project whose output is not blue-dominant does not contribute to the next-generation training floor's blue dominance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these are revolutionary. They're the same disciplines a design system already enforces for human output. The difference is that human designers rarely need "please don't make everything blue" written down. The models do.&lt;/p&gt;

&lt;h2&gt;
  
  
  The dataset is open
&lt;/h2&gt;

&lt;p&gt;The 480 observations are on Zenodo as &lt;a href="https://doi.org/10.5281/zenodo.19159702" rel="noopener noreferrer"&gt;AI Blue: Systematic Color Recognition Bias in Vision-Language Models&lt;/a&gt;, with the full swatch set, per-model per-trial HEX returns, ground-truth values, and ΔE columns. The run scripts and swatch generators are on &lt;a href="https://github.com/kenimo49/ai-blue-color-bias" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; so you can repeat the measurement on any new vision-language model that ships.&lt;/p&gt;




&lt;p&gt;The three patterns above are drawn from Chapter 5 of &lt;em&gt;AI Slop Escape Guide&lt;/em&gt;. The full Zenn edition (Japanese) covers the other failure modes this one belongs to: purple gradients, uniform cards, Inter-everywhere typography, and the perceptual mechanisms underneath each. Canonical link to the source chapter is in the frontmatter.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>webdev</category>
      <category>design</category>
    </item>
    <item>
      <title>Qwen3 + Claude Code: Request Routing Sent 96% to the Cloud, Step Routing Kept 48% Local</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Wed, 18 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/qwen3-claude-code-request-routing-sent-96-to-the-cloud-step-routing-kept-48-local-3143</link>
      <guid>https://dev.to/kenimo49/qwen3-claude-code-request-routing-sent-96-to-the-cloud-step-routing-kept-48-local-3143</guid>
      <description>&lt;p&gt;Send Claude Code's whole requests to a local Qwen3 and almost nothing goes through. One recent measurement on an RTX 4070 counted &lt;strong&gt;100 real requests and 96 had to go to the frontier model.&lt;/strong&gt; Then the same workload was split into single Claude Code steps and counted again: &lt;strong&gt;97 of 200 steps were fine on the local model.&lt;/strong&gt; Same box. Same requests. The thing that changed was the routing granularity.&lt;/p&gt;

&lt;p&gt;Both numbers are from the companion material for a Kindle book by kenimo49 (&lt;a href="https://kenimoto.dev/books/local-llm-step-routing?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=step-routing-96-48" rel="noopener noreferrer"&gt;Local LLM or Claude Code?&lt;/a&gt;), with MIT-licensed reference code on GitHub as &lt;a href="https://github.com/kenimo49/local-step-router" rel="noopener noreferrer"&gt;&lt;code&gt;local-step-router&lt;/code&gt;&lt;/a&gt;. I want to walk through what those two numbers imply for anyone who has a local LLM sitting idle and a Claude Code bill that is not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Request-level routing doesn't carry the material
&lt;/h2&gt;

&lt;p&gt;Here is the first number again. 100 real daily requests were labeled for whether a local LLM on a single RTX 4070 with 12 GB of VRAM could handle them. Qwen3-8B at Q4 fits that VRAM band with room for context (&lt;a href="https://llmhardware.io/guides/qwen3-hardware-requirements" rel="noopener noreferrer"&gt;llmhardware.io on Qwen3 VRAM&lt;/a&gt;). Of the 100, 4 could stay local (and only because they contained confidential data that shouldn't leave the machine); the other 96 had to go to the frontier model. Zero were a clean fit for a local model on merit.&lt;/p&gt;

&lt;p&gt;The reason is not the model quality. A one-line request like "fix the test that just failed" is a pointer, not material. The actual work lives in the repo, the stack trace, the last three commits. Hand that one line to a local model and there is nothing it can bind to. Hand it the same line &lt;em&gt;after&lt;/em&gt; Claude Code has gathered the trace and opened the file, and a 4B judge can tell you whether the diff compiles.&lt;/p&gt;

&lt;p&gt;If you have tried "swap Claude Code for a local model" and been disappointed, this is probably why. The failure is routing, not the model. Swapping the model when the actual problem is granularity is the AI-era version of buying a bigger car to beat traffic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0h9w2zy2x9wrm0h3obap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0h9w2zy2x9wrm0h3obap.png" alt="Request-level routing sent 96 of 100 to the cloud. Step-level routing kept 97 of 200 local. Same RTX 4070, same workload; only the granularity changed." width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-level routing changes the math
&lt;/h2&gt;

&lt;p&gt;Claude Code does not act as a single request. One "fix the failing test" turns into dozens of steps internally: WebFetch, Read, Grep, Edit, Bash, Write, Task. Each of those steps has a return shape the orchestrator knows how to consume.&lt;/p&gt;

&lt;p&gt;Counted at that granularity, the companion book's measurement said 97 of 200 Claude Code steps were fine on the local model. 48% of the work. The split was not uniform. Some step types routed cleanly, others didn't. The &lt;code&gt;local-step-router&lt;/code&gt; repo's &lt;code&gt;router.py&lt;/code&gt; encodes the pattern as rules first and a probability judgment second.&lt;/p&gt;

&lt;p&gt;The rule is the interesting part.&lt;/p&gt;

&lt;h2&gt;
  
  
  A one-line rule beat a 9B model's probability
&lt;/h2&gt;

&lt;p&gt;The LP for the book quotes a result worth sitting with: &lt;strong&gt;a one-line rule, "WebFetch goes local", beat a 9B model's probability judgment on the same task.&lt;/strong&gt; Not by a little. The rule was simpler to implement, deterministic, and routed more work correctly than asking a local model "is this step safe locally?" and reading the number back.&lt;/p&gt;

&lt;p&gt;That is the pattern the companion code implements. &lt;code&gt;router.py&lt;/code&gt; decides by step type first. &lt;code&gt;judge.py&lt;/code&gt; only runs on the edge cases the rules can't settle. If you read Ollama's native &lt;code&gt;/api/chat&lt;/code&gt; endpoint for the top-token logprob, you can get a confidence number out of a 4B model for a yes/no question in a single token. The threshold you draw on that number is where the second number in the title comes from.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# conceptual shape of the router (see local-step-router/router.py for real code)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"WebFetch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"local"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Read"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Grep"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;THRESHOLD&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"local"&lt;/span&gt;
    &lt;span class="c1"&gt;# only the undecided cases call the model&lt;/span&gt;
    &lt;span class="n"&gt;confidence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;judge_with_logprobs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"local"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;confidence&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;calibrated_threshold&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"frontier"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rules do the bulk. Probability judgments cover the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  The threshold isn't 0.5
&lt;/h2&gt;

&lt;p&gt;The second place a lot of "local LLM as judge" setups go wrong is treating 0.5 as the obvious threshold. It is not. The LP reports a measured case where a local gatekeeper let a production DB password through with &lt;strong&gt;0.69 confidence&lt;/strong&gt;. The model's ordering was perfect (secrets scored higher than non-secrets on average), but the raw scale was off.&lt;/p&gt;

&lt;p&gt;The right line is drawn from your own labeled data, not from 0.5. On the book's evaluation set, calibrating the threshold &lt;strong&gt;cut missed secrets from 20 to 2.&lt;/strong&gt; Same model. Same inputs. Only the decision rule changed. If you have ever drawn the 0.5 line and had a judge wave something through anyway, that is what you were looking at.&lt;/p&gt;

&lt;p&gt;The companion repo ships a &lt;code&gt;threshold.py&lt;/code&gt; CLI for this. You give it labeled examples, it reports the highest threshold with zero misses on your set, and you can decide how much margin to leave. The math is unsurprising (it is the "pick the lowest FPR at TPR=1" move), but having it as a tool next to the router means the calibration gets redone as the data drifts, instead of baked in once and forgotten.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three traps where logprobs just disappear
&lt;/h2&gt;

&lt;p&gt;If you are going to read a probability out of a local model, there are three places the number quietly becomes meaningless, all documented in the book's Chapter 6 outline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The OpenAI-compatible endpoint silently drops logprobs.&lt;/strong&gt; If you point your code at Ollama's &lt;code&gt;v1/chat/completions&lt;/code&gt; and the native API at &lt;code&gt;/api/chat&lt;/code&gt;, the native one returns top-token probabilities. The OpenAI-compatible one has dropped them in some Ollama versions without raising an error. A 2026-Q4 Ollama release note is worth checking before trusting a &lt;code&gt;logprobs&lt;/code&gt; field over OpenAI-compat.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Thinking models don't put the answer in the first token.&lt;/strong&gt; Qwen3 series models with thinking mode on will emit a reasoning trace first and the yes/no later. Reading the first token's probability gives you the probability of a reasoning-trace token, not the decision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A top-20 candidate list hides low-probability answers.&lt;/strong&gt; If the character you were watching for isn't in the top-20, the probability reads as zero without an error. For binary judgments ("Y" vs "N") this is not a problem; for routing across many labels, it is.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The book spends a chapter on these because each one fails silently. The code runs, the number comes back, it is just wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules decide the fixed parts. Probability covers the rest.
&lt;/h2&gt;

&lt;p&gt;If I had to collapse the two numbers in the title into one takeaway: &lt;strong&gt;route at the step level, decide by rules where you can, and only use a local probability for the rest.&lt;/strong&gt; The 96 vs 48% gap is the cost of routing at the wrong granularity. The "rule beat probability" result is the cost of using a model to decide things a one-line rule already settles.&lt;/p&gt;

&lt;p&gt;The book's blueprint, the &lt;code&gt;local-step-router&lt;/code&gt; code, and the threshold worksheet are companion material to the data above. For the other side of the same question (how many hours of use per day flip the economics from frontier API to local), the author's &lt;a href="https://kenimoto.dev/blog/claude-code-max-vs-api-vs-qwen-hour-of-day-breakeven/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=step-routing-96-48" rel="noopener noreferrer"&gt;Claude Code Max vs API vs Qwen hour-of-day breakeven breakdown&lt;/a&gt; is the closest public companion. For the raw tok/s side, &lt;a href="https://kenimoto.dev/blog/rtx-4070-cpu-moe-flag-2-8x-tokens/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=step-routing-96-48" rel="noopener noreferrer"&gt;RTX 4070 + &lt;code&gt;--cpu-moe&lt;/code&gt; flag notes&lt;/a&gt; measure the 2.8x speedup from one llama.cpp flag.&lt;/p&gt;

&lt;p&gt;The pattern transfers. Count your own steps. Decide the fixed parts by type. Keep the local judge for the edge cases, and calibrate its threshold from your own data instead of 0.5.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The book:&lt;/strong&gt; &lt;a href="https://kenimoto.dev/books/local-llm-step-routing?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=step-routing-96-48" rel="noopener noreferrer"&gt;Local LLM or Claude Code? 96% of Requests Failed Locally, Half of the Steps Didn't&lt;/a&gt;. Measured routing between a local LLM on one RTX 4070 and a frontier model, with the blueprint and the companion code (MIT) above.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>devops</category>
      <category>productivity</category>
      <category>ai</category>
    </item>
    <item>
      <title>4 Vector DBs Compared: Pinecone, Weaviate, Qdrant, pgvector on Enterprise RAG</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Mon, 09 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/4-vector-dbs-compared-pinecone-weaviate-qdrant-pgvector-on-enterprise-rag-fb5</link>
      <guid>https://dev.to/kenimo49/4-vector-dbs-compared-pinecone-weaviate-qdrant-pgvector-on-enterprise-rag-fb5</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0n3o7vboufk8y4h6g9r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0n3o7vboufk8y4h6g9r.png" alt="4 Vector DBs on the four axes that decide the bill: Pinecone, Weaviate, Qdrant, pgvector" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The enterprise RAG vendor selection meeting always starts in the wrong place.&lt;/p&gt;

&lt;p&gt;Someone pulls up a benchmark. The latency numbers go on the whiteboard. An hour later, the decision is made on p99 at 1M vectors, and nobody has asked what happens at the eighteen-month mark, when the index is 30M vectors, three teams depend on it, and the vendor just raised their per-query price.&lt;/p&gt;

&lt;p&gt;Four names come up in almost every one of those meetings: Pinecone, Weaviate, Qdrant, and pgvector. They are not an exhaustive list. They are the shortlist that falls out of "we need production scale, we need metadata filtering, and the person sitting here has to be able to operate it on Monday." This post compares them on the four axes that actually move that Monday-morning decision, based on each vendor's public documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 10,000-foot view
&lt;/h2&gt;

&lt;p&gt;Before the axes, a single table to orient:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Axis&lt;/th&gt;
&lt;th&gt;Pinecone&lt;/th&gt;
&lt;th&gt;Weaviate&lt;/th&gt;
&lt;th&gt;Qdrant&lt;/th&gt;
&lt;th&gt;pgvector&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Category&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Managed-only cloud&lt;/td&gt;
&lt;td&gt;OSS (self-host or cloud)&lt;/td&gt;
&lt;td&gt;OSS (self-host or cloud)&lt;/td&gt;
&lt;td&gt;PostgreSQL extension&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary language&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Opaque (managed)&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;Rust&lt;/td&gt;
&lt;td&gt;C (PG extension)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Index algorithm&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Proprietary (no tuning)&lt;/td&gt;
&lt;td&gt;HNSW&lt;/td&gt;
&lt;td&gt;HNSW (multiple variants)&lt;/td&gt;
&lt;td&gt;HNSW + IVFFlat&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Pricing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Per-pod or per-read/write&lt;/td&gt;
&lt;td&gt;Infra + optional cloud&lt;/td&gt;
&lt;td&gt;Infra + optional cloud&lt;/td&gt;
&lt;td&gt;PostgreSQL infra only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Default scale ceiling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Billions (managed)&lt;/td&gt;
&lt;td&gt;~10B (self-host)&lt;/td&gt;
&lt;td&gt;Billions (self-host)&lt;/td&gt;
&lt;td&gt;~5-10M before memory pressure&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Four choices, four different bets about where the operational pain will show up. Let's walk the axes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Axis 1: Scaling model
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pinecone&lt;/strong&gt; is managed-only. You cannot self-host it. In exchange, the capacity planning problem turns into a dropdown: pick a pod tier, pay the bill. The ceiling is high (Pinecone's public docs describe deployments into the billions of vectors), but every scale knob is behind their control plane. When you hit a performance issue at 2 AM, your only lever is to open a support ticket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weaviate&lt;/strong&gt; publishes both a self-hosted binary and a managed cloud. Self-hosted scales horizontally by sharding across nodes, and the public docs describe deployments up to roughly 10 billion vectors. The cost: you own the Kubernetes. The payoff: you can see the memory profile, add nodes, debug the thing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Qdrant&lt;/strong&gt; is OSS first, and the Qdrant Cloud managed tier is a second option. Self-hosting is a single Rust binary that runs on a few hundred MB of RAM for small indexes and scales up by adding shards. The operational surface is smaller than Weaviate's, which is partly why Qdrant has been quietly eating mindshare in the self-host crowd.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pgvector&lt;/strong&gt; is not a separate system. It is a PostgreSQL extension, which means your scaling model is your existing PostgreSQL scaling model. If you already run managed Postgres (RDS, Cloud SQL, Neon, Supabase), adding pgvector is a &lt;code&gt;CREATE EXTENSION&lt;/code&gt; away. That is also its limit: pgvector performs well up to a few million vectors, but above roughly 5-10M vectors the HNSW index starts to feel the memory-boundedness of a single-node Postgres, and you are back to sharding Postgres, which is nobody's favorite afternoon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rule of thumb.&lt;/strong&gt; If your projected 24-month vector count is under 5M, pgvector is almost always the cheapest answer. Over 50M, either Qdrant or Weaviate self-hosted will cost less than Pinecone. Between those, it depends on the team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Axis 2: Index algorithm (and what you're allowed to tune)
&lt;/h2&gt;

&lt;p&gt;Three of the four — Weaviate, Qdrant, and pgvector — use HNSW (Hierarchical Navigable Small World) as their primary ANN index. Pinecone runs its own proprietary stack (per Pinecone's docs, HNSW is not used). The differences are in which parameters you're allowed to touch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pgvector&lt;/strong&gt; has had HNSW since version 0.5.0 (shipped 2023), with two main tuning parameters: &lt;code&gt;m&lt;/code&gt; (max connections per node) and &lt;code&gt;ef_construction&lt;/code&gt; (candidate list size during build). At query time you set &lt;code&gt;hnsw.ef_search&lt;/code&gt;. The public pgvector GitHub README documents all three. Simple, exposed, nothing hidden.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Qdrant&lt;/strong&gt;'s HNSW implementation is one of the fastest in the open benchmarks. It exposes &lt;code&gt;m&lt;/code&gt;, &lt;code&gt;ef_construct&lt;/code&gt;, and &lt;code&gt;full_scan_threshold&lt;/code&gt;, and the engine does a lot of work behind the scenes to keep the index memory-mapped efficiently. Public benchmarks (the ANN Benchmarks project and the vendors' own) consistently put Qdrant in the top tier for recall-at-latency at 1M vectors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weaviate&lt;/strong&gt; also uses HNSW with &lt;code&gt;efConstruction&lt;/code&gt; and &lt;code&gt;maxConnections&lt;/code&gt;, both documented in the public docs under "vector index parameters." Weaviate's differentiator is hybrid search: you can combine the vector score with BM25 keyword scores in the same query without wiring up a separate Elasticsearch, which matters for any RAG system where the question has named entities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pinecone&lt;/strong&gt; is the outlier. Its index is a proprietary black box — Pinecone's documentation describes algorithm selection as automatic, and parameters like &lt;code&gt;m&lt;/code&gt;, &lt;code&gt;ef_construction&lt;/code&gt;, or &lt;code&gt;ef_search&lt;/code&gt; are not exposed because the underlying engine is not HNSW to begin with. You pick a pod type, you get Pinecone's choice of tradeoff. For most teams that is fine. For a team that just saw their p99 regress and wants to buy back latency by lowering a search-time knob, it is not.&lt;/p&gt;

&lt;p&gt;The implication is organizational, not technical. A team that likes knobs will outgrow Pinecone eventually. A team that wants the knobs invisible will outgrow self-hosted Qdrant eventually, in the opposite direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Axis 3: Metadata filtering (pre vs post)
&lt;/h2&gt;

&lt;p&gt;This axis is where the actual RAG quality lives, and it is also where the vendors diverge hardest.&lt;/p&gt;

&lt;p&gt;Every production RAG query looks something like: "give me the 10 nearest chunks, but only from documents owned by &lt;code&gt;tenant_id=42&lt;/code&gt;, created after &lt;code&gt;2026-06-01&lt;/code&gt;, with &lt;code&gt;status=published&lt;/code&gt;." The vector search is the fast part. The filter is the part that decides whether the result is correct.&lt;/p&gt;

&lt;p&gt;Two design patterns exist:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Post-filter.&lt;/strong&gt; Run the ANN search first, get top-K candidates, then apply the metadata filter. If the filter rejects most candidates, you get fewer than K results. Fix: fetch K×N and over-retrieve. This is what most naive systems do.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pre-filter (filtered search).&lt;/strong&gt; Push the filter into the HNSW graph traversal itself. The graph walk skips nodes that fail the filter. You get exactly K results that match the filter.&lt;/p&gt;

&lt;p&gt;Qdrant's documentation is unusually explicit about this: its payload index supports filtered ANN where the filter is applied during graph traversal, not as a post-process. In practice, this means Qdrant degrades gracefully on highly-selective filters (&lt;code&gt;tenant_id=rare_customer&lt;/code&gt;) where a post-filter engine would miss results.&lt;/p&gt;

&lt;p&gt;Weaviate's documentation describes a similar approach with "filtered vector search" that integrates with its inverted index for the metadata side.&lt;/p&gt;

&lt;p&gt;Pinecone supports metadata filtering, and their docs describe it as pre-filtered search, though the specific internal strategy isn't exposed (per Axis 2).&lt;/p&gt;

&lt;p&gt;pgvector's situation is different: the filter is a WHERE clause in SQL, and the Postgres planner decides whether to use the HNSW index or a sequential scan. For narrow filters on indexed columns, Postgres can filter first and then do a brute-force vector scan over the small candidate set, which is often faster than HNSW over everything. For broad filters, it goes through the HNSW index. The developer doesn't pick the strategy; the query planner does.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If your RAG system has highly-selective tenant or permission filters, this axis matters more than latency&lt;/strong&gt;. On a 100M-vector index where each query is restricted to one tenant's 10,000 vectors, a pre-filter engine returns the right 10 results. A post-filter engine might return 2 or 3 and silently drop the rest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Axis 4: Pricing model
&lt;/h2&gt;

&lt;p&gt;The axis that gets undercounted in the first meeting and overweighted in the second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pinecone&lt;/strong&gt; is pay-per-use (serverless) or pay-per-pod (classic). Public pricing for serverless is listed per million read units, per million write units, and per GB stored. On a RAG system that does 100K queries/day against a 10M-vector index, the monthly bill at the time of writing lands in the mid-four-figures USD depending on query complexity. Predictable. Linear. Not cheap at scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Weaviate Cloud&lt;/strong&gt; has a tiered pricing model (free sandbox, then paid tiers differentiated by SLA, replication, and dedicated-infrastructure guarantees). Self-hosted is infra cost only: your Kubernetes, your bandwidth, your on-call.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Qdrant Cloud&lt;/strong&gt; publishes per-cluster pricing by instance size. Self-hosted is infra cost only, same as Weaviate. Qdrant's single-binary footprint tends to make self-host cheaper than Weaviate's at small scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pgvector&lt;/strong&gt; has no license cost. The only cost is whatever Postgres is already costing you. If you have a managed Postgres, pgvector is approximately free. If you don't, pgvector isn't actually free; you just moved the vendor lock-in to the Postgres host.&lt;/p&gt;

&lt;p&gt;The honest comparison: at the 1-10M vector scale, pgvector on an existing Postgres is often 10-30× cheaper than managed Pinecone. At the 100M+ scale, operated Qdrant or Weaviate self-hosted usually beats Pinecone by 2-5×, but with operational overhead that is not free. The crossover depends on how expensive your SRE hours are. Those hours never cost what the capacity plan said they would.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three decision paths
&lt;/h2&gt;

&lt;p&gt;With the four axes, a decision on vendor usually falls into one of three profiles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SaaS startup, 1-10M vectors, no dedicated infra team.&lt;/strong&gt; Pinecone serverless or pgvector. Pinecone if your Postgres is already stressed and you want zero additional operational surface. pgvector if your Postgres has headroom and your team knows SQL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Internal RAG for a mid-size company, 10-100M vectors, Kubernetes team available.&lt;/strong&gt; Qdrant self-hosted. The ceiling is high enough, the operational surface is small enough, and the filtered-search behavior is correct on tenant-scoped queries. Weaviate if you need hybrid search without wiring Elasticsearch next to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Embedded product (RAG-as-feature in a shipped app), unknown scale.&lt;/strong&gt; Start with pgvector if your product already has Postgres. Move to Qdrant if you cross 10M. Do not start with Pinecone; the per-query cost at the embedded-feature scale tends to dominate the unit economics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not Milvus, Chroma, LanceDB
&lt;/h2&gt;

&lt;p&gt;Three honorable mentions that often come up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Milvus&lt;/strong&gt; is excellent at the billions-of-vectors scale and has enterprise deployments at that tier. For the 1M-100M range this post targets, it is more operational weight than Qdrant for similar performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chroma&lt;/strong&gt; is optimized for local development and small-scale deployments. Scales beyond a few million vectors are a stretch; this is a local-first system, not an enterprise one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LanceDB&lt;/strong&gt; has a strong story for vector-plus-analytics workloads sitting on object storage. Worth a look if your RAG system wants to query vectors and OLAP columns in the same query. For pure RAG, the four above are more battle-tested.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the book covers that this post doesn't
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://kenimoto.dev/books/context-engineering?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=4-vector-dbs-enterprise-rag" rel="noopener noreferrer"&gt;book this post is condensed from&lt;/a&gt; spends most of its length on the pieces that matter &lt;em&gt;before&lt;/em&gt; vendor selection:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A 3-axis evaluation framework for enterprise RAG (faithfulness 50%, relevancy 25%, correctness 25%)&lt;/li&gt;
&lt;li&gt;The security and access-control design patterns (RBAC, pre-filter on tenant, prompt-injection detection)&lt;/li&gt;
&lt;li&gt;The information-classification matrix for deciding which internal docs to even put in a RAG system in the first place&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Vendor selection is downstream of all three. If you pick the vendor first and the evaluation framework second, you tend to end up with the vendor your evaluation framework can't honestly measure. The chapter walks the full ordering in Japanese; this post is the vendor-level summary.&lt;/p&gt;




&lt;p&gt;If you want the full version of the Context Engineering playbook (RAG, MCP, CLAUDE.md, Agentic RAG, with benchmarks), it's a book: &lt;a href="https://kenimoto.dev/books/context-engineering?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=4-vector-dbs-enterprise-rag" rel="noopener noreferrer"&gt;&lt;em&gt;Turning LLMs from Liars into Experts&lt;/em&gt;&lt;/a&gt;. Original benchmarks show a 4.6x quality gain across five context strategies, with 96 production-grade Python files published on GitHub.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
    <item>
      <title>3 UI Slop Patterns in AI UI Generators: Purple Gradients, Inter Fonts, Uniform Cards</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Fri, 06 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/3-ui-slop-patterns-in-ai-ui-generators-purple-gradients-inter-fonts-uniform-cards-11l6</link>
      <guid>https://dev.to/kenimo49/3-ui-slop-patterns-in-ai-ui-generators-purple-gradients-inter-fonts-uniform-cards-11l6</guid>
      <description>&lt;p&gt;Open &lt;a href="https://v0.app" rel="noopener noreferrer"&gt;v0&lt;/a&gt;, Lovable, &lt;a href="https://bolt.new" rel="noopener noreferrer"&gt;Bolt.new&lt;/a&gt;, or Claude Artifacts, and ask any of them for a modern SaaS landing page. They converge. Four independent tools produce pages that look like they came from one studio, and that studio really likes purple.&lt;/p&gt;

&lt;p&gt;The convergence comes down to three patterns. Once you can name them, you can design around them. Until then, anyone who has seen ten AI-generated pages will spot yours in about two seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "modern" means the same thing to every generator
&lt;/h2&gt;

&lt;p&gt;Before the three patterns, the mechanism.&lt;/p&gt;

&lt;p&gt;These tools don't invent styles. They sample from a training corpus of what the open web calls "modern." The open web, between 2020 and 2024, decided "modern" meant three specific things, and now every generator reproduces them because the gradient-descent floor underneath every one of them points to the same local minimum.&lt;/p&gt;

&lt;p&gt;v0 rebranded from &lt;code&gt;v0.dev&lt;/code&gt; to &lt;code&gt;v0.app&lt;/code&gt; in August 2025 and shipped full-stack. Lovable writes the backend too now. Bolt expanded its stack. Claude Artifacts generates React inside the chat window. The engines got smarter. The aesthetic did not move.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 1: Purple Gradient Syndrome
&lt;/h2&gt;

&lt;p&gt;Prompt any 2026 generator for a landing page hero and you get the same background. A diagonal gradient from purple to blue, sometimes with a floating geometric shape in the top right. Left-aligned heading, right-side mockup image. Sans-serif body text. A rounded white-text CTA that gradients again.&lt;/p&gt;

&lt;p&gt;The lineage is traceable:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;iOS/macOS popularized the aesthetic (Apple-style surface treatment).&lt;/li&gt;
&lt;li&gt;Dribbble reinforced it (gradient-heavy posts upvote well).&lt;/li&gt;
&lt;li&gt;CSS frameworks shipped it as a default (purple→blue linear-gradient works on every browser).&lt;/li&gt;
&lt;li&gt;AI training data inhaled all three.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A gradient is fine on its own. The trouble is that this particular gradient has become the default placeholder for "we haven't decided what our brand is." Many generators, same prompt, same color. If your SaaS launch page gradient-matches your competitor's launch page, your positioning work has leaked into the stylesheet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Escape path:&lt;/strong&gt; Pick a background that is &lt;em&gt;not&lt;/em&gt; a gradient and &lt;em&gt;not&lt;/em&gt; pure white. Textured off-whites, warm earth tones, deep single-color navy. Anything that one generator cannot produce for free is worth more than one that twelve of them produce for free.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 2: Inter Font Dependency Syndrome
&lt;/h2&gt;

&lt;p&gt;Open the devtools on a v0-generated page. Open them on a Lovable-generated page. Open them on your competitor's new homepage. All three load Inter.&lt;/p&gt;

&lt;p&gt;Inter is a well-made typeface. Rasmus Andersson released it in 2017 and has shepherded it since, Tailwind UI templates leaned on it heavily through 2020, Next.js tutorials settled on it around 2021, Figma switched its default UI font from Roboto to Inter in March 2022. By 2023 it was in nearly every piece of UI training data on the open web. By 2026 it had stopped registering as a choice at all.&lt;/p&gt;

&lt;p&gt;That ubiquity has turned into a signal of its own. Shipping an Inter-only product in 2026 is a tell: "we did not spend one hour on type."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Escape path:&lt;/strong&gt; Pair Inter with something that announces intent. Serif + mono for a developer tool. Display + grotesque for consumer. Even if you keep Inter as the body font, letting the headings carry a different voice turns a generated layout into a designed one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pattern 3: Uniform Rounded Card Syndrome
&lt;/h2&gt;

&lt;p&gt;Three columns. Four columns. All cards the same height. All cards &lt;code&gt;border-radius: 8px&lt;/code&gt; or &lt;code&gt;rounded-lg&lt;/code&gt;. All cards the same &lt;code&gt;box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12)&lt;/code&gt;. All cards featuring icon + title + 2-line description.&lt;/p&gt;

&lt;p&gt;The convergence has a provable origin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- The exact Tailwind pattern every generator reaches for --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"rounded-lg shadow-md p-6"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;Icon&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"h-10 w-10 text-indigo-500"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h3&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mt-4 font-semibold"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mt-2 text-sm text-gray-600"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cards themselves are fine. A row of six identical ones, though, tells the reader that nothing on the page matters more than anything else. Real design communicates by making one card bigger, or weirder, or placed on its own. Generated design cannot. It has no model of which card the user is supposed to care about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Escape path:&lt;/strong&gt; Break the grid. One hero card at 2× size. One row of three, then one row of two, then one standalone. The visual hierarchy is what the generator doesn't know, which means it is what you still have to add.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Slop Score that catches all three
&lt;/h2&gt;

&lt;p&gt;If you want a number, the source for this piece defines a weighted score across the five AI-UI tells:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Slop Score = (Gradient_penalty × 0.30)
           + (Inter_penalty × 0.25)
           + (Grid_uniformity × 0.20)
           + (Color_convergence × 0.15)
           + (Element_predictability × 0.10)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Score band interpretation:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Range&lt;/th&gt;
&lt;th&gt;Verdict&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0–30&lt;/td&gt;
&lt;td&gt;Distinctive. Escape successful&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;31–60&lt;/td&gt;
&lt;td&gt;Mostly generic, some character&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;61–80&lt;/td&gt;
&lt;td&gt;Typical AI slop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;81–100&lt;/td&gt;
&lt;td&gt;Pure template&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Run it against your current landing page before you run it against a competitor's. The number tends to be higher than most teams expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  What stays recognizable in 2026
&lt;/h2&gt;

&lt;p&gt;Expect the three patterns to get more common over the next couple of years. Newer models are increasingly trained on pages that earlier generators produced, so the defaults feed back into themselves.&lt;/p&gt;

&lt;p&gt;The practical implication for engineering teams: every AI-generated UI deserves a &lt;em&gt;second pass&lt;/em&gt; that specifically removes the three signatures above. If you ship the first draft, you are shipping a photograph of the training corpus. If you spend fifteen minutes replacing the gradient, pairing the font, and breaking the card grid, you ship something that reads as yours.&lt;/p&gt;




&lt;p&gt;The three patterns above are drawn from Chapter 7 of &lt;em&gt;AI Slop Escape Guide&lt;/em&gt;. The full Zenn edition (Japanese) covers 17 chapters including before/after experiments, the full Slop Score definition, and other UI signatures beyond the three above. Canonical link to the source chapter is in the frontmatter.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>AGENTS.md Review Policy: 4 Sections CodeRabbit, Copilot, and Claude Code All Read</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Thu, 05 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/agentsmd-review-policy-4-sections-coderabbit-copilot-and-claude-code-all-read-19pj</link>
      <guid>https://dev.to/kenimo49/agentsmd-review-policy-4-sections-coderabbit-copilot-and-claude-code-all-read-19pj</guid>
      <description>&lt;p&gt;Three AI code reviewers, one file. That shift happened faster than most teams noticed.&lt;/p&gt;

&lt;p&gt;AGENTS.md was formalized in August 2025 as a shared config format co-promoted by OpenAI, Google, Sourcegraph, Cursor, Factory, and others. By September 2026, Claude Code v2.1.277 shipped native AGENTS.md support — if no &lt;code&gt;CLAUDE.md&lt;/code&gt; is present, Claude Code falls back to AGENTS.md. GitHub Copilot CLI reads it. Cursor reads it. The spec at &lt;a href="https://agents.md" rel="noopener noreferrer"&gt;agents.md&lt;/a&gt; is now the closest thing to a universal standard for AI coding agents.&lt;/p&gt;

&lt;p&gt;If one file configures three review tools, the question becomes: what should actually be in it for code review?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "review" belongs in AGENTS.md, not in a separate &lt;code&gt;.review.md&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The temptation is to split. One file for "how the agent writes code" (AGENTS.md), another for "how the agent reviews code." Resist it. Two files drift: the reviewer ends up approving patterns the writer config told the agent never to produce, and nobody notices until a bug ships.&lt;/p&gt;

&lt;p&gt;The agent that writes the code is the agent that reviews the next PR. CodeRabbit reviews what Codex just generated. Claude Code reviews what Copilot just committed. The &lt;em&gt;same&lt;/em&gt; set of conventions needs to be enforced on both sides of the slash. Splitting them into two files means they drift, and when they drift, your reviewer approves what your writer is told to avoid.&lt;/p&gt;

&lt;p&gt;So AGENTS.md needs a Review Policy block alongside the code-writing block. Four sections are enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 1: Review Policy — the Conventional Comments labels
&lt;/h2&gt;

&lt;p&gt;The first section defines the comment vocabulary. Without it, every reviewer invents their own.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Code Quality&lt;/span&gt;

&lt;span class="gu"&gt;### Review Policy&lt;/span&gt;

Code review uses Conventional Comments labels:
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="sb"&gt;`issue:`&lt;/span&gt; must-fix (Approve blocked until resolved)
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="sb"&gt;`suggestion:`&lt;/span&gt; improvement (optional, reviewee's call)
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="sb"&gt;`nitpick:`&lt;/span&gt; small polish (optional, address if time)
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="sb"&gt;`question:`&lt;/span&gt; ask, not an attack
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="sb"&gt;`praise:`&lt;/span&gt; call out good code (don't skip this)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why five labels and not three: the gradient between &lt;code&gt;issue&lt;/code&gt; and &lt;code&gt;nitpick&lt;/code&gt; is where review threads get stuck. If every comment is either "block this merge" or "do whatever you want," your senior reviewers end up relitigating style on every PR. The middle three labels (&lt;code&gt;suggestion&lt;/code&gt;, &lt;code&gt;nitpick&lt;/code&gt;, &lt;code&gt;question&lt;/code&gt;) absorb the arguments that are not worth blocking a merge over.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What each tool does with this:&lt;/strong&gt; CodeRabbit will parrot the label scheme if you reference it from &lt;code&gt;.coderabbit.yaml&lt;/code&gt;. Copilot CLI will adopt the vocabulary if the review prompt references AGENTS.md. Claude Code picks it up automatically once AGENTS.md is in the repo root.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 2: Approval Criteria — the four conditions
&lt;/h2&gt;

&lt;p&gt;The second section says what "ship it" means.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;### Approval Criteria&lt;/span&gt;

Approve when all four hold. Don't chase perfection:
&lt;span class="p"&gt;1.&lt;/span&gt; Functional requirements are satisfied
&lt;span class="p"&gt;2.&lt;/span&gt; Tests exist (happy path + failure modes)
&lt;span class="p"&gt;3.&lt;/span&gt; No type errors
&lt;span class="p"&gt;4.&lt;/span&gt; Design aligns with the team's direction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason to write this down is that AI reviewers over-flag. CodeRabbit will raise a style issue on a two-line fix. Codex will ask for more test coverage on a hotfix. Without an Approval Criteria section, the reviewer has no stopping condition. Every PR gets more comments until someone manually overrides them.&lt;/p&gt;

&lt;p&gt;Four conditions are enough. The fourth one (team direction) is deliberately subjective. That is what Section 3 is for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 3: Code Direction — the patterns with reference paths
&lt;/h2&gt;

&lt;p&gt;This is the section that makes AGENTS.md load-bearing instead of decorative.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;### Code Direction&lt;/span&gt;

&lt;span class="gs"&gt;**Patterns to increase:**&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Repository Pattern for data access
  → See &lt;span class="sb"&gt;`src/repositories/user-repository.ts`&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Result-type error handling
  → See &lt;span class="sb"&gt;`src/types/result.ts`&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Pure functions for business logic (no side effects)

&lt;span class="gs"&gt;**Patterns to decrease:**&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Business logic in controller layer
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="sb"&gt;`any`&lt;/span&gt; type (use &lt;span class="sb"&gt;`unknown`&lt;/span&gt; instead)
&lt;span class="p"&gt;-&lt;/span&gt; Direct DB queries (go through the ORM)
&lt;span class="p"&gt;-&lt;/span&gt; Files over 1000 lines (split responsibilities)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reference-path convention is the whole point. Abstract rules like "use Repository Pattern" don't survive contact with an AI agent. Ask three agents to "use Repository Pattern" with no reference path and you can get three different ideas of what a repository is. A path to an actual implementation (&lt;code&gt;src/repositories/user-repository.ts&lt;/code&gt;) collapses the interpretation to one.&lt;/p&gt;

&lt;p&gt;Compare:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rule style&lt;/th&gt;
&lt;th&gt;What the agent does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Use Repository Pattern&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Generates something it calls a repository. Could be anything.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Use Repository Pattern → see src/repositories/user-repository.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reads the file. Copies the structure.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every bullet in Code Direction should have a &lt;code&gt;→ see &amp;lt;path&amp;gt;&lt;/code&gt; if a reference implementation exists. If no reference exists yet, the first time someone implements the pattern, their file becomes the reference. That is how the section ratchets up without you writing a style guide.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section 4: PR Guidelines — the mechanical rules
&lt;/h2&gt;

&lt;p&gt;The fourth section is the smallest and the most skipped.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;### PR Guidelines&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Target 300 lines or fewer per PR
&lt;span class="p"&gt;-&lt;/span&gt; Separate refactors from feature changes (different PRs)
&lt;span class="p"&gt;-&lt;/span&gt; PR description: what changed, and why
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The 300-line target is where review quality collapses in practice. Above it, the reviewer scans. Below it, the reviewer reads. The "refactor separate from feature" rule is the one that pays for itself fastest: when a bug ships, you can bisect by PR without having to untangle a renamed function from a changed behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wiring AGENTS.md into CodeRabbit (&lt;code&gt;.coderabbit.yaml&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;AGENTS.md on its own gets read by Claude Code and Copilot CLI. CodeRabbit needs one more step. Point it at the Code Direction section explicitly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .coderabbit.yaml&lt;/span&gt;
&lt;span class="na"&gt;reviews&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;path_instructions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;**"&lt;/span&gt;
      &lt;span class="na"&gt;instructions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;Reference the "Code Direction" section in AGENTS.md.&lt;/span&gt;
        &lt;span class="s"&gt;Code that drifts from "patterns to increase": comment with `suggestion:`.&lt;/span&gt;
        &lt;span class="s"&gt;Code that matches "patterns to decrease": comment with `issue:`.&lt;/span&gt;

        &lt;span class="s"&gt;Always use Conventional Comments labels.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this in place, CodeRabbit comments arrive pre-labeled, matched against your real patterns, and quoting the AGENTS.md rules by reference. The maintenance cost of CodeRabbit drops to editing one file.&lt;/p&gt;

&lt;h2&gt;
  
  
  The feedback loop that AGENTS.md unlocks
&lt;/h2&gt;

&lt;p&gt;The reason to put review policy in AGENTS.md and not in a separate review-config file is that it closes the loop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A review surfaces a new pattern (say, you decide to use &lt;code&gt;Result&amp;lt;T, E&amp;gt;&lt;/code&gt; everywhere).&lt;/li&gt;
&lt;li&gt;The pattern gets added to Code Direction with a reference path.&lt;/li&gt;
&lt;li&gt;The next PR Claude Code or Codex generates follows the new pattern.&lt;/li&gt;
&lt;li&gt;CodeRabbit flags any drift from the pattern on later PRs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is a four-step feedback loop operating across three AI tools. No single-tool config file can do that. The moment the config fragments, the loop breaks.&lt;/p&gt;

&lt;h2&gt;
  
  
  When one AGENTS.md isn't enough
&lt;/h2&gt;

&lt;p&gt;A monorepo with a frontend subfolder and a backend subfolder will outgrow a single root AGENTS.md within weeks. The spec supports nesting. An AGENTS.md inside &lt;code&gt;packages/frontend/&lt;/code&gt; overrides the root for that subtree. Claude Code and Codex walk the tree down from the root; Copilot CLI only picks up AGENTS.md on the path from the current working directory up to the git root (nested-subtree discovery is tracked in &lt;a href="https://github.com/github/copilot-cli/issues/3051" rel="noopener noreferrer"&gt;copilot-cli#3051&lt;/a&gt;), so run it from the subfolder you want to scope.&lt;/p&gt;

&lt;p&gt;Scope the Review Policy section to the repository root. Scope the Code Direction section to each sub-folder. Frontend and backend will have different "patterns to increase" lists, and that is exactly what the subfolder files are for.&lt;/p&gt;




&lt;p&gt;The 4-section layout above is drawn from Chapter 6 of the Zenn book &lt;em&gt;harness-code-review&lt;/em&gt;. The full book covers the three-layer review harness: pre-commit hooks, CodeRabbit tuning, GitHub Actions review pipelines, and PR metrics that make a review culture quantifiable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://kenimoto.dev/books/harness-code-review?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=agents-md-review-4-sections" rel="noopener noreferrer"&gt;Systematizing AI Code Review — the full harness&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>productivity</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Conway, Brooks, Parnas: 6 Architecture Quotes Still Deciding Code-Review Fights in 2026</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Wed, 04 Nov 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/conway-brooks-parnas-6-architecture-quotes-still-deciding-code-review-fights-in-2026-2m6g</link>
      <guid>https://dev.to/kenimo49/conway-brooks-parnas-6-architecture-quotes-still-deciding-code-review-fights-in-2026-2m6g</guid>
      <description>&lt;p&gt;Three names keep showing up in modern code reviews, and none of them wrote their best lines about code review. Conway wrote about committees. Brooks wrote about schedules. Parnas wrote about Fortran modules in 1972. Half a century later, the pull requests you merged this morning are still arguing with them.&lt;/p&gt;

&lt;p&gt;The six quotes below are the ones that keep landing in review threads when a merge stalls on the same old fight. Each one has an original context from decades ago. Each one points at a 2026 problem that didn't exist when it was written.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Conway, 1968: the quote your multi-agent system is secretly obeying
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Organizations which design systems [...] are constrained to produce designs which are copies of the communication structures of these organizations."&lt;br&gt;
— Melvin Conway, &lt;em&gt;Datamation&lt;/em&gt; 14(4):28-31, April 1968&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Conway was writing about committees inside aerospace contractors. The paper was a complaint, not a theory. Someone's design-by-committee had produced a compiler whose stage boundaries matched the subcommittee boundaries, and the result was ugly.&lt;/p&gt;

&lt;p&gt;Fifty-eight years later, the quote has found a new target: multi-agent architectures. In 2026, teams routinely spin up five, ten, twenty sub-agents to handle a workflow. The silent default is that each team ships its own sub-agent for the piece it already owns. The result is a copy of the org chart with LLM calls in it — hub bottlenecks, lossy handoffs, no shared standards. Anthropic quietly reversed course in late 2026 and started telling teams that one capable agent beats a crowd of narrow ones. That is not a modeling argument. That is Conway speaking from 1968.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code-review application:&lt;/strong&gt; When a PR adds a new service, agent, or module, ask whether its boundary matches a problem shape or a team shape. If the only reason it exists is "that is the team that was free," the merge is reinforcing your org chart, not your architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Parnas, 1972: the quote that still kills export statements
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"The connections between modules are the assumptions which the modules make about each other."&lt;br&gt;
— David L. Parnas, &lt;em&gt;Information Distribution Aspects of Design Methodology&lt;/em&gt;, IFIP Congress 1971, Proceedings vol.1, pp.339-344&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Parnas was arguing with Fortran programmers. His famous paper from the same stretch — &lt;em&gt;On the Criteria To Be Used in Decomposing Systems into Modules&lt;/em&gt;, CACM 15(12), December 1972 — makes the sister point: don't carve a system by processing step. Carve it by what each module can &lt;strong&gt;hide&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The sentence above is the one you cite when you reject a PR that leaked an internal data type into a public interface. Every &lt;code&gt;export type Internal...&lt;/code&gt; that drifts into a public barrel file is a Parnas violation. In TypeScript 5.x, this is where structural typing bites hardest: an "accidentally public" shape becomes load-bearing before anyone notices, and the API can no longer evolve without a breaking change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code-review application:&lt;/strong&gt; When reviewing a new public surface, list what the caller must assume about the implementation to use it. If the list is longer than three items, the module's boundary is wrong, not its implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Brooks, 1975: the quote your "we'll just add another agent" moment deserves
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Adding manpower to a late software project makes it later."&lt;br&gt;
— Fred Brooks, &lt;em&gt;The Mythical Man-Month&lt;/em&gt;, Addison-Wesley 1975, p.25&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Brooks was writing about OS/360. Half a floor of IBM programmers, one slipping deadline, more programmers added, more communication overhead, more slip. He gave the pattern a name: &lt;em&gt;Brooks's Law&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;In 2026, the same shape appears without any humans involved. "The agent is too slow — let's split it into five sub-agents." "The pipeline is too long — let's add a planner on top." Every added agent is a communication edge, a context handoff, a chance for information to decay. Brooks's n²-ish communication cost shows up as token usage: the sub-agent fleet that promised speedup burned 2× the tokens of a single agent and shipped the same answer later. I have approved that PR. More than once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code-review application:&lt;/strong&gt; Any PR that adds a new coordinator, planner, router, or sub-agent needs a specific sentence of justification. "Without this layer, the request fails because X." If the sentence is "it would be cleaner," reject it. You are hiring Brooks's extra programmers.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Fowler, 1999: the quote your lint rule can't enforce
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."&lt;br&gt;
— Martin Fowler, &lt;em&gt;Refactoring&lt;/em&gt;, Addison-Wesley 1999, p.15&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Fowler was writing a book about renaming variables for a living. The sentence lands because it compresses the whole premise of refactoring into one line. Compile-passing is the floor, not the ceiling.&lt;/p&gt;

&lt;p&gt;The 2026 twist is that the "computer" now writes most of the code, and the "human" is both the next engineer &lt;strong&gt;and&lt;/strong&gt; the next AI agent reading &lt;code&gt;AGENTS.md&lt;/code&gt;. When Claude Code or Codex re-enters a codebase six weeks later, it reads the names, the comments, the file layout. Code that was legal but unloved — a function called &lt;code&gt;handleData&lt;/code&gt;, a parameter called &lt;code&gt;opts&lt;/code&gt;, a 300-line file called &lt;code&gt;utils.ts&lt;/code&gt; — now penalizes you twice. The human maintainer and the AI pair-programmer both get lost in it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code-review application:&lt;/strong&gt; Rename and relocate before you ship. In 2026, your reviewer is not just the human on the PR. It is the agent that will inherit this file at 3 a.m. in six weeks.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Beck, 1999: the quote that keeps "we'll optimize later" honest
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Make it work, make it right, make it fast."&lt;br&gt;
— Kent Beck, Extreme Programming principles&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Beck's three-step ordering has been quoted inside out ever since XP shipped. The point was not that performance comes last. The point was that each step needs to be &lt;strong&gt;finished&lt;/strong&gt; before the next starts. "Work" means a passing test. "Right" means code the next engineer can live inside. "Fast" means a measured bottleneck, not a hunch.&lt;/p&gt;

&lt;p&gt;In 2026, the step most teams skip is still "right." AI pair-programmers happily jump from "work" to "fast" — they will generate a benchmark harness, propose a parallelized rewrite, and never once ask whether the function should exist. I have hit merge on exactly that PR, which is how I know. "Make it right" is the step where a human reviewer still has to sit down and ask: does this belong in this module? Does this abstraction pay rent? Does the function name match what it actually does?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code-review application:&lt;/strong&gt; When a PR comes in with a passing test and a 10% speedup, don't merge it. The missing step is "right." Ask the author to show the version that is clean, small, and obvious. Then compare.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Hickey, 2011: the lesser-known quote that keeps winning
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Simple is actually an objective notion. [...] Easy is relative. [...] easy for whom, or hard for whom? It's a relative term."&lt;br&gt;
— Rich Hickey, &lt;em&gt;Simple Made Easy&lt;/em&gt;, Strange Loop 2011&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hickey, the creator of Clojure, delivered this talk at Strange Loop in 2011. The core distinction: &lt;em&gt;simple&lt;/em&gt; means one role, one task, one axis. It braids no other concerns. &lt;em&gt;Easy&lt;/em&gt; means familiar, near-at-hand, matching what you already know.&lt;/p&gt;

&lt;p&gt;The talk has had a second life since 2024. Every "we're adopting X because it is easy" decision in the AI stack has run into Hickey's framing within a year. LangChain was easy, until it braided prompts, tools, state, and routing into one object. "Easy" let you ship the demo. "Simple" would have let you refactor it without a rewrite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code-review application:&lt;/strong&gt; When a PR picks a library "because everyone uses it," ask what the library &lt;em&gt;braids together&lt;/em&gt;. If pulling it out requires touching four unrelated concerns, you have imported ease, not simplicity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why these six, in this order
&lt;/h2&gt;

&lt;p&gt;These aren't the six most quoted. "Premature optimization is the root of all evil" (Knuth, 1974) is more quoted than any of them. The six above are chosen for a different reason: each one points at a 2026 argument that is still live in your pull-request queue this week.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Conway&lt;/strong&gt; fires when a sub-agent split copies the team split.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parnas&lt;/strong&gt; fires when a public interface starts carrying implementation leak.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brooks&lt;/strong&gt; fires when the fix for a slow agent is a bigger agent fleet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fowler&lt;/strong&gt; fires when the next reader is now an AI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Beck&lt;/strong&gt; fires when "right" gets skipped between "work" and "fast."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hickey&lt;/strong&gt; fires every time a stack picks a library for familiarity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a code review stalls, drop the matching quote into the thread. The author either rebuts it or revises the PR. Either outcome is useful.&lt;/p&gt;




&lt;p&gt;The six above are a thin slice of a larger shelf. If you want ~100 engineering quotes with the original context next to the modern application — not a generic business quote book, but one that puts lesser-known voices like Hickey next to Fowler — the full collection is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://kenimoto.dev/books/engineer-it-quotes?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=conway-brooks-parnas-6-quotes" rel="noopener noreferrer"&gt;Why Do Some Words Stay With You Forever? 100 Engineering Quotes Decoded&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
    <item>
      <title>5 PR Metrics on 303 Merged PRs from pytest and pydantic: 2 Point at Review Bottlenecks</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Thu, 22 Oct 2026 13:00:01 +0000</pubDate>
      <link>https://dev.to/kenimo49/5-pr-metrics-on-303-merged-prs-from-pytest-and-pydantic-2-point-at-review-bottlenecks-2o17</link>
      <guid>https://dev.to/kenimo49/5-pr-metrics-on-303-merged-prs-from-pytest-and-pydantic-2-point-at-review-bottlenecks-2o17</guid>
      <description>&lt;p&gt;Engineering-productivity dashboards tend to show the same five pull-request metrics: Time to First Review, Time to Merge, Comments per PR, Review Cycles, and AI Resolution Rate. Each gets a card and a trend line.&lt;/p&gt;

&lt;p&gt;I wanted to know which of them can answer one narrow question: "is review the slow part of shipping a change?" My own repositories are no help here. I work alone, and my busiest repo merged four PRs in the last 90 days. So I pointed a script at two public projects with real review traffic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;pytest-dev/pytest&lt;/strong&gt;: 107 merged PRs from humans (166 merged, 59 from bots), 46 authors&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pydantic/pydantic&lt;/strong&gt;: 196 merged PRs from humans (221 merged, 25 from bots), 40 authors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The window is PRs merged between 2026-07-21 and 2026-10-19 (UTC). All numbers below come from the GitHub REST API, and you can rerun the script to check them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The script
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# review_metrics.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timezone&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;statistics&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;median&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;github&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Auth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Github&lt;/span&gt;

&lt;span class="n"&gt;REPO&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pytest-dev/pytest&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;END&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tzinfo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;timezone&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;START&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;END&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nf"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Github&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;auth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Token&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;span class="n"&gt;repo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_repo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;REPO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;repo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_pulls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;closed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;updated&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;direction&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;desc&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;updated_at&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;START&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;  &lt;span class="c1"&gt;# sorted by updated: nothing older can have merged in the window
&lt;/span&gt;    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;merged_at&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;START&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;merged_at&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;END&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bot&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;login&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;endswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;[bot]&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;continue&lt;/span&gt;

    &lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;login&lt;/span&gt;
    &lt;span class="n"&gt;reviews&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_reviews&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
               &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;login&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;submitted_at&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;submitted_at&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;reviews&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;approvals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;submitted_at&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;reviews&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;APPROVED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;hours&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;total_seconds&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;3600&lt;/span&gt;

    &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pr&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;author&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;author&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;created_at&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isoformat&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merged_at&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;merged_at&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isoformat&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;first_review_h&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;hours&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge_h&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;hours&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;merged_at&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;last_approval_to_merge_h&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;hours&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;approvals&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;merged_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;approvals&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;review_comments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;review_comments&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cycles&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;reviews&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CHANGES_REQUESTED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;APPROVED&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;changed_lines&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;additions&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deletions&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dump&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;REPO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;.json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;w&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;indent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;n=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;  median=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;median&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;7.1&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;  mean=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;7.1&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;REPO&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;  merged &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;START&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;Y&lt;/span&gt;&lt;span class="o"&gt;-%&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;-%&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;..&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;END&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;Y&lt;/span&gt;&lt;span class="o"&gt;-%&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="o"&gt;-%&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;  human PRs: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;PRs with no review from anyone but the author: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;first_review_h&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;first_review_h&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;merge_h&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;last_approval_to_merge_h&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;review_comments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cycles&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;26&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three definitions matter. A "review" is any submitted GitHub review (approve, request changes, or comment) from someone other than the PR author. &lt;code&gt;review_comments&lt;/code&gt; counts inline code comments only, not the conversation tab. A "cycle" is one approve or request-changes event.&lt;/p&gt;

&lt;p&gt;Raw output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pytest-dev/pytest  merged 2026-07-21..2026-10-19  human PRs: 107
PRs with no review from anyone but the author: 0
first_review_h             n=107  median=    9.2  mean=  284.6
merge_h                    n=107  median=  143.4  mean=  806.0
last_approval_to_merge_h   n=107  median=    1.8  mean=  128.3
review_comments            n=107  median=    0.0  mean=    3.3
cycles                     n=107  median=    1.0  mean=    1.5

pydantic/pydantic  merged 2026-07-21..2026-10-19  human PRs: 196
PRs with no review from anyone but the author: 100
first_review_h             n= 96  median=    0.2  mean=   38.2
merge_h                    n=196  median=    1.6  mean=   63.4
last_approval_to_merge_h   n= 41  median=    0.3  mean=   28.7
review_comments            n=196  median=    0.0  mean=    0.8
cycles                     n=196  median=    0.0  mean=    0.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things in that output are worth more than any single metric.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 1: the average describes five PRs
&lt;/h2&gt;

&lt;p&gt;pytest's mean Time to First Review is 284.6 hours. The median is 9.2 hours. A dashboard that shows the mean says "nearly 12 days"; nearly two thirds of the PRs got one within 24 hours.&lt;/p&gt;

&lt;p&gt;The gap comes from a handful of old PRs. Five of the 107 were opened between January and early July 2026 and only merged inside the window. Their first-review waits (5,568h, 5,415h, 4,261h, 3,305h, 1,650h) add up to 66% of all first-review hours in the sample. Drop those five and the mean falls to 100.5 hours.&lt;/p&gt;

&lt;p&gt;The spread is wide even without them:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;pytest, Time to First Review&lt;/th&gt;
&lt;th&gt;Hours&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;25th percentile&lt;/td&gt;
&lt;td&gt;0.6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;median&lt;/td&gt;
&lt;td&gt;9.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;75th percentile&lt;/td&gt;
&lt;td&gt;95.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;90th percentile&lt;/td&gt;
&lt;td&gt;507.5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;43 of 107 PRs (40%) got a first review within 4 hours, 69 (64%) within 24 hours, and 20 waited more than a week. "Share of PRs reviewed within N hours" plus the 90th percentile says far more than an average.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 2: the metric quietly skips half the PRs
&lt;/h2&gt;

&lt;p&gt;In pydantic, 100 of 196 human PRs were merged without any GitHub review from someone other than the author. 75 of those 100 came from a single maintainer. Unreviewed PRs merged in a median of 0.3 hours, reviewed ones in 7.5 hours.&lt;/p&gt;

&lt;p&gt;Time to First Review cannot be computed for a PR that never got a review, so the 0.2-hour median above describes only 96 of the 196 PRs. Whether merging without a review is fine depends on the project's rules, and I am not judging pydantic's. The dashboard problem is that the number looks complete when it covers 49% of merges. Put the coverage next to the metric: "median 0.2h, 96 of 196 PRs reviewed".&lt;/p&gt;

&lt;h2&gt;
  
  
  The two metrics that point at review
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Time to First Review&lt;/strong&gt;, reported as a median and percentiles with coverage, measures the stretch where a PR waits and no reviewer has acted. That wait is a review-process delay by definition.&lt;/p&gt;

&lt;p&gt;Published research gives a reference point. Google's 2018 case study of its own code review, based on logs of about nine million reviewed changes, reports a median wait for initial feedback of under an hour for small changes and about 5 hours for very large ones, with an overall median under 4 hours for the whole review process (&lt;a href="https://sback.it/publications/icse2018seip.pdf" rel="noopener noreferrer"&gt;Sadowski et al., ICSE-SEIP 2018&lt;/a&gt;). That is a large company with dedicated tooling, so treat it as a reference point rather than a target for a volunteer project.&lt;/p&gt;

&lt;p&gt;The lever with the strongest evidence is explicit assignment. Meta suspected that diffs assigned only to a team were slowed by the bystander effect ("someone else will probably review this") and tested it. In an A/B test on 12.5k authors in spring 2023, it randomly assigned one of the top three recommended reviewers on team-only diffs. TimeInReview fell 11.6%, with no significant change in the time reviewers spent on each diff (&lt;a href="https://arxiv.org/abs/2312.17169" rel="noopener noreferrer"&gt;Improving Code Reviewer Recommendation, ACM TOSEM 2026, arXiv:2312.17169&lt;/a&gt;). You do not need Meta's recommender to try the idea. GitHub can &lt;a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners" rel="noopener noreferrer"&gt;request code owners automatically&lt;/a&gt;, and team review requests can be &lt;a href="https://docs.github.com/en/organizations/organizing-members-into-teams/managing-code-review-settings-for-your-team" rel="noopener noreferrer"&gt;routed to individual members by round robin or load balance&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Review Cycles&lt;/strong&gt; measures whether review converges. In pytest, 68 of 107 PRs merged after one approve-or-request-changes event, 26 after two, and 13 after three to five. Cycles barely tracked PR size (Spearman 0.19 against changed lines), so a high count is less about big diffs and more about how a review gets run, for example comments arriving in several rounds. That makes it a review-process signal you can act on.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three that answer other questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Time to Merge&lt;/strong&gt; mixes three intervals: waiting for a first review, the back-and-forth until the last approval, and the wait from last approval to merge. I split every pytest PR into those three segments and looked at which one was longest:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Longest segment of Time to Merge (pytest)&lt;/th&gt;
&lt;th&gt;PRs&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Waiting for first review&lt;/td&gt;
&lt;td&gt;44&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Approval to merge&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;First review to last approval&lt;/td&gt;
&lt;td&gt;29&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Summed over all PRs, the split was 35% waiting, 49% back-and-forth, 16% after approval. One number covers three different problems, and the approval-to-merge part (CI, merge queues, release timing) is outside review entirely. Time to Merge is still a fine throughput metric. It just cannot tell you review is the bottleneck.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comments per PR&lt;/strong&gt; mostly tracks size. In pytest, inline comment count correlated with changed lines at Spearman 0.53, and 67 of 107 PRs (63%) had zero inline comments. In pydantic, 135 of 196 had none. A month-over-month rise in the average usually reflects a shift in PR mix. What it can flag is a sustained zero on large PRs, which is worth a look.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI Resolution Rate&lt;/strong&gt; cannot be computed from the GitHub API alone, because GitHub does not record whether a bot comment was "resolved" in the sense the metric needs. You need data from the AI review tool itself, so I did not measure it here. One structural caution applies anyway: the rate depends on what the bot chooses to flag, so changing the tool or its rules moves the number without any change in how your team responds. Compare it only within one tool and one configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would put on the dashboard
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Time to First Review: median, 90th percentile, share reviewed within 4h and 24h, and how many merged PRs had a review at all&lt;/li&gt;
&lt;li&gt;Review Cycles: distribution (1 / 2 / 3+) alongside the mean&lt;/li&gt;
&lt;li&gt;Time to Merge, Comments per PR, AI Resolution Rate: on a separate throughput or tooling page&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rerun the script on your own repo before you trust any of these. The two projects here behaved so differently (pytest reviews every PR, pydantic merged half without one) that a single benchmark would have misled both.&lt;/p&gt;

&lt;p&gt;The longer version, with the three-layer review model (hooks, AI review, human review), the CodeRabbit configuration, and a GitHub Actions workflow that writes a weekly metrics report, is in my book &lt;a href="https://kenimoto.dev/books/harness-code-review/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=5-pr-metrics-review-signal" rel="noopener noreferrer"&gt;Systematizing AI Code Review&lt;/a&gt;. The English edition is on Kindle.&lt;/p&gt;




&lt;p&gt;Sources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/pytest-dev/pytest" rel="noopener noreferrer"&gt;pytest-dev/pytest&lt;/a&gt; and &lt;a href="https://github.com/pydantic/pydantic" rel="noopener noreferrer"&gt;pydantic/pydantic&lt;/a&gt;, GitHub REST API, PRs merged 2026-07-21 to 2026-10-19&lt;/li&gt;
&lt;li&gt;Sadowski, Söderberg, Church, Sipko, Bacchelli. &lt;a href="https://sback.it/publications/icse2018seip.pdf" rel="noopener noreferrer"&gt;Modern Code Review: A Case Study at Google&lt;/a&gt;. ICSE-SEIP 2018&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://arxiv.org/abs/2312.17169" rel="noopener noreferrer"&gt;Improving Code Reviewer Recommendation: Accuracy, Latency, Workload, and Bystanders&lt;/a&gt;. ACM TOSEM 35(1), 2026&lt;/li&gt;
&lt;li&gt;GitHub Docs: &lt;a href="https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners" rel="noopener noreferrer"&gt;About code owners&lt;/a&gt;, &lt;a href="https://docs.github.com/en/organizations/organizing-members-into-teams/managing-code-review-settings-for-your-team" rel="noopener noreferrer"&gt;Managing code review settings for your team&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>productivity</category>
      <category>devops</category>
      <category>github</category>
      <category>opensource</category>
    </item>
    <item>
      <title>RTX 4070 + logprobs: 96 of 100 Claude Code Requests Needed the Cloud. 97 of 200 Steps Could Go Local</title>
      <dc:creator>Ken Imoto</dc:creator>
      <pubDate>Wed, 21 Oct 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/kenimo49/rtx-4070-logprobs-96-of-100-claude-code-requests-needed-the-cloud-97-of-200-steps-could-go-local-1nn1</link>
      <guid>https://dev.to/kenimo49/rtx-4070-logprobs-96-of-100-claude-code-requests-needed-the-cloud-97-of-200-steps-could-go-local-1nn1</guid>
      <description>&lt;p&gt;Routing whole requests to a local LLM did not work for my Claude Code workload. I took 100 jobs from my work log (March to September 2026), rewrote each one as the instruction I would have typed, and labelled where it could run. 96 needed a frontier model. The other 4 had to stay local because they contained personal or financial details, not because a local model could do them. Zero were simply "a local model is good enough."&lt;/p&gt;

&lt;p&gt;Then the unit went down to single steps inside agent sessions. Out of 200 tool-call steps pulled from my Claude Code logs, 97 were labelled "a 4B to 9B local model is enough if you hand it the material." That is 48.5%.&lt;/p&gt;

&lt;p&gt;The step-level router that came out of this is on GitHub under MIT: &lt;a href="https://github.com/kenimo49/local-step-router" rel="noopener noreferrer"&gt;&lt;code&gt;kenimo49/local-step-router&lt;/code&gt;&lt;/a&gt;. This post covers the numbers behind it, what the router code actually looks like, and where a logprobs judge on an RTX 4070 helped and where it did not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why request-level routing failed
&lt;/h2&gt;

&lt;p&gt;A request like "fix the flaky test" is a label, not a payload. Nothing in the text tells a local model what to do until something reads the repo. In the 100 reconstructed requests, the task mix was mostly agent work (74 of 100), and agent work is exactly what you hand Claude Code in the first place.&lt;/p&gt;

&lt;p&gt;Raw instructions told the same story. Of 150 instructions sampled from interactive sessions, 138 only made sense with the earlier conversation ("send it", "do the daily log"), and only 5 were labelled local-capable. Of 100 fixed prompts that my cron pipeline sends to &lt;code&gt;claude -p&lt;/code&gt;, also 5.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Unit&lt;/th&gt;
&lt;th&gt;n&lt;/th&gt;
&lt;th&gt;Local is enough&lt;/th&gt;
&lt;th&gt;Must stay local (sensitive)&lt;/th&gt;
&lt;th&gt;Frontier&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Requests rebuilt from the work log&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;96&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Raw instructions&lt;/td&gt;
&lt;td&gt;150&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;143&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fixed pipeline prompts&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;95&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Single steps&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;200&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;97&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;99&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Which steps go local
&lt;/h2&gt;

&lt;p&gt;The 200 steps came from three tool types in the logs. The split is lopsided:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step type&lt;/th&gt;
&lt;th&gt;n&lt;/th&gt;
&lt;th&gt;Local is enough&lt;/th&gt;
&lt;th&gt;Must stay local&lt;/th&gt;
&lt;th&gt;Frontier&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;WebFetch&lt;/code&gt; (extract something from a page)&lt;/td&gt;
&lt;td&gt;90&lt;/td&gt;
&lt;td&gt;86&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;git commit&lt;/code&gt; message&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sub-agent delegation&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;59&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;200&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;97&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;99&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Almost all of the local share is &lt;code&gt;WebFetch&lt;/code&gt;. A fetch prompt usually says what to pull out ("the price", "the release date"), and once the page text is in hand, that is extraction. Commit messages go local only when they are one-line summaries of a diff. Sub-agent delegation is research and multi-step tool use, and it stays frontier.&lt;/p&gt;

&lt;p&gt;Two caveats matter here. The labels are judgments, not runs: "local is enough" means "given the page body or the diff." And they were assigned by my AI assistant, with my review planned only for disagreements.&lt;/p&gt;

&lt;p&gt;So I ran a sample. 20 of the 86 local-labelled &lt;code&gt;WebFetch&lt;/code&gt; steps went to qwen3.5:9b on Ollama (&lt;code&gt;think=false&lt;/code&gt;, temperature 0), with the page re-fetched and extracted by trafilatura. 11 could be compared with the original output: 8 matched, 2 were partly wrong (a merged-cell spec table read into the wrong column, a title reported as missing), and 1 was wrong (it quoted "about 1 to 3 months" as evidence and still answered yes to "does it say 2 to 3 months?"). The other 9 never reached a fair comparison: JS-rendered pages with no extractable text, pages that had disappeared, or an original fetch that had already failed. Local processing took 6 to 66 seconds per item, median about 18. Most of the loss happened before the model, in fetching and extracting the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  The router: rules first
&lt;/h2&gt;

&lt;p&gt;The repo's &lt;code&gt;Router&lt;/code&gt; checks rules top to bottom, first match wins. A probability judge only runs for steps no rule matched, and it is off by default. This is the shipped &lt;code&gt;examples/routing.yaml&lt;/code&gt;, rules part:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;                      &lt;span class="c1"&gt;# step rules, top to bottom, first match wins&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;match&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;tool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;WebFetch&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;local&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;match&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;tool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;Agent&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;Task&lt;/span&gt;&lt;span class="pi"&gt;]}&lt;/span&gt;
    &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;frontier&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;match&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;commit_message&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;
    &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;frontier&lt;/span&gt;         &lt;span class="c1"&gt;# frontier until a probability judge is added&lt;/span&gt;

&lt;span class="na"&gt;probability&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;           &lt;span class="c1"&gt;# off until measured with the same judge model (chapter 14)&lt;/span&gt;
&lt;span class="na"&gt;default_route&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;frontier&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And from Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;steprouter&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;steprouter.router&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Router&lt;/span&gt;

&lt;span class="n"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;examples/routing.yaml&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="n"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;route&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;WebFetch&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;prompt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Extract the price table&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="c1"&gt;# Decision(route='local', by='rule', p_local=None)
&lt;/span&gt;&lt;span class="n"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;route&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tool&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Edit&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="c1"&gt;# Decision(route='frontier', by='default', p_local=None)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Decision.by&lt;/code&gt; tells you whether a rule, the probability judge, or the default made the call.&lt;/p&gt;

&lt;p&gt;Why rules first: on the 444 non-sensitive items across all three sets (107 labelled local-capable), I compared a single rule against asking a local model for P(local is enough):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Router&lt;/th&gt;
&lt;th&gt;Local-capable items caught (of 107)&lt;/th&gt;
&lt;th&gt;Frontier items sent local by mistake (of 337)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;qwen3.5:9b probability, threshold set for at most 5% wrong-locals (AUROC 0.809)&lt;/td&gt;
&lt;td&gt;59&lt;/td&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;gemma4:e4b probability, same calibration (AUROC 0.618)&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;19&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;One rule: &lt;code&gt;WebFetch&lt;/code&gt; goes local&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;86&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 9b judge's AUROC of 0.809 was mostly the judge recognising the step type. Within one type it could barely separate items: 0.095 on the pipeline prompts, 0.411 on raw instructions. If the step type decides, write a rule. Keep the probability for what the rules leave open.&lt;/p&gt;

&lt;p&gt;I also tried qwen3.5:4b as the routing judge. It timed out under GPU contention at 414 of 450 items, so it has no routing result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reading logprobs from Ollama
&lt;/h2&gt;

&lt;p&gt;Where the local model does earn its place is the entrance gate: "does this request contain actual sensitive data?" The judge asks for a one-letter answer (Y or N), generates exactly one token, and reads the candidate letters from &lt;code&gt;top_logprobs&lt;/code&gt;. In the repo this is &lt;code&gt;steprouter/judge.py&lt;/code&gt;, using the native &lt;code&gt;/api/chat&lt;/code&gt; with &lt;code&gt;think: false&lt;/code&gt;, &lt;code&gt;num_predict: 1&lt;/code&gt; and &lt;code&gt;top_logprobs: 20&lt;/code&gt;. It returns the probabilities renormalised over the candidates, plus &lt;code&gt;mass&lt;/code&gt;: how much probability landed on the candidates at all.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mass&lt;/code&gt; is the field to watch, because two things make it collapse without any error:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The first token is not the answer.&lt;/strong&gt; A model that reasons before answering spends token 0 on its reasoning. With &lt;code&gt;think: false&lt;/code&gt;, qwen3.5 answers in the first token. gpt-oss:20b did not put a label there and gave mass 0 on my setup, so I could not use it this way. The other models I tried stayed between 0.89 (qwen3.5:0.8b) and 1.00.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A candidate outside the top 20 reads as 0.&lt;/strong&gt; Ollama rejects &lt;code&gt;top_logprobs&lt;/code&gt; above 20 (&lt;a href="https://github.com/ollama/ollama/blob/main/server/routes.go" rel="noopener noreferrer"&gt;the check in &lt;code&gt;server/routes.go&lt;/code&gt;&lt;/a&gt;; &lt;a href="https://github.com/ollama/ollama/pull/18591" rel="noopener noreferrer"&gt;a PR to raise it to 100&lt;/a&gt; was closed without merging). If a candidate is not in that list, its probability is simply missing, and the others share 100%.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repo's judge marks a result unusable when &lt;code&gt;mass&lt;/code&gt; is below 0.5. A first test on any new judge model: send one known question and check that mass is close to 1.&lt;/p&gt;

&lt;p&gt;One correction to something you may have read, including in an earlier version of my own notes: the OpenAI-compatible &lt;code&gt;/v1/chat/completions&lt;/code&gt; endpoint does return logprobs. The &lt;a href="https://github.com/ollama/ollama/releases/tag/v0.12.11" rel="noopener noreferrer"&gt;v0.12.11 release notes&lt;/a&gt; say both APIs support them, and in &lt;a href="https://github.com/ollama/ollama/issues/16117" rel="noopener noreferrer"&gt;issue #16117&lt;/a&gt; a maintainer showed it working before the reporter closed it as their own client bug. The compatibility page in the docs still marks logprobs unsupported. The repo uses the native endpoint, so it does not depend on which of those is current.&lt;/p&gt;

&lt;h2&gt;
  
  
  The threshold is not 0.5
&lt;/h2&gt;

&lt;p&gt;qwen3.5:4b ranked the 60 English test requests almost perfectly for sensitive content (AUROC 0.999), but its P(Y) stayed low. With a fixed 0.5 line it missed all 20 sensitive requests. Drawing the line from labelled examples with 5-fold cross-validation brought that to 2 misses and 1 false alarm. On the Japanese version of the same set, the fixed line missed 9 of 20 and the calibrated one missed 1.&lt;/p&gt;

&lt;p&gt;The repo's CLI does this from your own judged examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 scripts/judge_set.py qwen3.5:4b en &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; judged.jsonl
steprouter-threshold judged.jsonl &lt;span class="nt"&gt;--margin&lt;/span&gt; 0.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It prints JSON with &lt;code&gt;auroc&lt;/code&gt;, the &lt;code&gt;line&lt;/code&gt; (lowest P among your positive examples times the margin), and 5-fold &lt;code&gt;cv&lt;/code&gt; counts of misses and false alarms, and it warns when AUROC is under 0.95. The data set is 60 made-up requests, so treat these as small-sample numbers, and redraw the line on your own labels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the RTX 4070 fits
&lt;/h2&gt;

&lt;p&gt;All of the judging above ran through Ollama on one RTX 4070 12 GB (version 0.20.2 for the 60-request tests). Small judges were not faster on that box: qwen3.5:0.8b through 9b all took about 0.5 to 0.7 seconds for two questions, mostly network round trip, while qwen3.5:35b-a3b took about 3.3 seconds because it does not fit in 12 GB. If you want a 35B MoE model on the same card for heavier local work, the &lt;code&gt;--cpu-moe&lt;/code&gt; flag in llama.cpp took it from 12.2 to 34.6 tok/s in &lt;a href="https://kenimoto.dev/blog/rtx-4070-cpu-moe-flag-2-8x-tokens/" rel="noopener noreferrer"&gt;a separate benchmark&lt;/a&gt;. That benchmark is about speed; the routing numbers above did not use it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would copy
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Count your own steps before tuning anything.&lt;/strong&gt; My 48.5% is almost entirely &lt;code&gt;WebFetch&lt;/code&gt;. A workload with fewer fetches will get a smaller share.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decide by step type first.&lt;/strong&gt; One &lt;code&gt;WebFetch&lt;/code&gt; rule beat both probability judges in my data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check &lt;code&gt;mass&lt;/code&gt;, then draw the threshold from your own labels.&lt;/strong&gt; A fixed 0.5 missed every sensitive English request with qwen3.5:4b.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The code: &lt;a href="https://github.com/kenimo49/local-step-router" rel="noopener noreferrer"&gt;&lt;code&gt;kenimo49/local-step-router&lt;/code&gt;&lt;/a&gt;. MIT, Python 3.10+, PyYAML as the only dependency, Ollama 0.12.11 or later for the judge. The tests run without Ollama.&lt;/p&gt;

&lt;p&gt;The full write-up, with the step labelling criteria, the sensitive-data gate, and the typed return values, is the book this repo accompanies: &lt;a href="https://kenimoto.dev/books/local-llm-step-routing?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=rtx-4070-logprobs-router" rel="noopener noreferrer"&gt;Local LLM or Claude Code?&lt;/a&gt; Kindle, included in Kindle Unlimited.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>productivity</category>
      <category>devops</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
