<?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: YMori</title>
    <description>The latest articles on DEV Community by YMori (@yasumorishima).</description>
    <link>https://dev.to/yasumorishima</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%2F3761588%2F10324d86-be69-483f-90af-7c8f8eb80cf1.png</url>
      <title>DEV Community: YMori</title>
      <link>https://dev.to/yasumorishima</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yasumorishima"/>
    <language>en</language>
    <item>
      <title>Reading PDFs with no extractable text from a glyph table: AI drafts it once, then every run is free and identical</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Mon, 23 Nov 2026 23:31:09 +0000</pubDate>
      <link>https://dev.to/yasumorishima/reading-pdfs-with-no-extractable-text-from-a-glyph-table-ai-drafts-it-once-then-every-run-is-free-33ek</link>
      <guid>https://dev.to/yasumorishima/reading-pdfs-with-no-extractable-text-from-a-glyph-table-ai-drafts-it-once-then-every-run-is-free-33ek</guid>
      <description>&lt;p&gt;When I analyze statistics as a hobby, the source numbers are often published only as PDFs from government offices: monthly reports that come out in the same layout every month. With a normal PDF, you can copy the numbers and paste them into a spreadsheet. But some PDFs read fine on screen and give you a string of symbols when you copy, or don't let you select any text at all.&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%2Fsz0d361sqhcsg7251ppv.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%2Fsz0d361sqhcsg7251ppv.png" alt="Same look, different inside" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They look the same, but the inside is different. A normal PDF contains data saying "the character 'S' is here." A PDF with no extractable text only says "a shape made of these lines is here"; the PDF itself does not know which character it is.&lt;/p&gt;

&lt;p&gt;To read such a PDF, you usually render the page as an image and run it through OCR, or these days hand it to an AI model. But paying for AI every time you read a monthly report, and getting slightly different results each time, is a poor fit for hobby analysis.&lt;/p&gt;

&lt;p&gt;This kind of PDF has one useful property: &lt;strong&gt;the same character is drawn with exactly the same shape every time&lt;/strong&gt;. Unlike handwriting, a "5" is always the same "5". So if you build a table that says "this shape is 5" once, you should be able to read every later issue just by looking shapes up. I call this table the glyph table.&lt;/p&gt;

&lt;p&gt;I built this method and compared it with OCR and with AI (four Claude models from Anthropic) under the same conditions. For test data I used samples I made myself and public data anyone may use (the monthly report "Population Estimates" from the Statistics Bureau of Japan).&lt;/p&gt;

&lt;p&gt;Everything I built and every result is public: &lt;a href="https://github.com/yasumorishima/document-extraction-lab" rel="noopener noreferrer"&gt;document-extraction-lab&lt;/a&gt; (&lt;code&gt;topics/glyph-table/&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Build the table from the first month only; after that, just look shapes up
&lt;/h2&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%2F7e0sabswxwvir4enbe97.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%2F7e0sabswxwvir4enbe97.png" alt="How the glyph table is built and used" width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From the first month's PDF, collect every glyph shape. Put identical shapes into one group and decide which character each group is; that gives you the glyph table. AI models answer which character each group is, and a person checks only the groups where the models disagree (more on this below).&lt;/p&gt;

&lt;p&gt;From the second month on, you only look shapes up in the table. No AI is used, so it costs nothing, nothing goes over the internet, and the same PDF always gives the same result.&lt;/p&gt;

&lt;p&gt;The rule I cared about most: &lt;strong&gt;never make up a character it does not know&lt;/strong&gt;. A shape that is not close enough to any shape in the table is not forced into a match; it comes out as "?". When different characters with similar shapes end up in the same group, that group also comes out as "?". A person who looks will notice a "?", but nobody notices a plausible wrong character.&lt;/p&gt;

&lt;h2&gt;
  
  
  I mixed in look-alike characters on purpose, the kind that fool people and AI
&lt;/h2&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%2Fd193xokul8fi54pm9ge3.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%2Fd193xokul8fi54pm9ge3.png" alt="Look-alike characters" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First I made 12 months of fictional monthly statements myself. The item-code column deliberately mixes look-alikes: capital I, small l and 1; O and 0; and in Japanese, katakana カ (ka) and the kanji 力 (power), the long-vowel mark ー and the kanji 一 (one), and so on. In the English font I used, I and l differ in height by only about 5%.&lt;/p&gt;

&lt;p&gt;I made the same statements 17 ways: different fonts, Japanese text, ruled lines, tighter letter spacing, and so on. I built the table from January alone and read February to December.&lt;/p&gt;

&lt;p&gt;What I counted is the &lt;strong&gt;silent error&lt;/strong&gt;: a character read as a different one with no warning. A "?" does not count as an error.&lt;/p&gt;

&lt;h2&gt;
  
  
  Only the glyph table had 0 silent errors over 11 months
&lt;/h2&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%2Fitzi8o7uu38qfw1kpcr7.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%2Fitzi8o7uu38qfw1kpcr7.png" alt="Silent errors on the self-made statements" width="800" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The glyph table had 0 silent errors in both English (5,259 characters) and Japanese (4,207 characters). In 16 of the 17 conditions it stayed at 0 for all 11 months.&lt;/p&gt;

&lt;p&gt;OCR made 126 errors in English, reading O as 0 and I or l as 1, among others. In one month the amount "5,583" became "5,983". In Japanese it made 249 errors, 12 of them in digits, such as reading 0 as 9.&lt;/p&gt;

&lt;p&gt;I told the AI models: "watch out for look-alikes, and you may write ? for a character you are not sure of." Even so, all four confidently picked between I and l, or between カ and 力, and got them wrong. Opus 5.5 made 11 to 15 errors in English; in Japanese every model made more than 190. When I had each model read the same page 3 times, only 0 to 2 of 11 pages came out the same all 3 times. The answer changes from read to read.&lt;/p&gt;

&lt;p&gt;On the other hand, with a font where I and l look clearly different, the AI (Opus 5.5) also made 0 errors. What AI struggles with are strings like item codes, where the surrounding text gives no hint of what the character probably is.&lt;/p&gt;

&lt;p&gt;The only errors the glyph table made, 25 characters, were in a condition built so that glyph shapes drift slightly on purpose. But in that condition, building the table already shows that "the same character does not have a consistent shape". In other words, &lt;strong&gt;you know the PDF is risky before you read it&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  On a public statistics report: 0 silent errors, but the top AI models also had 0
&lt;/h2&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%2Fripz1oh51ohll45mofgt.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%2Fripz1oh51ohll45mofgt.png" alt="Silent errors on the public report" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Testing only on samples I made myself could turn into a test that suits me. So I also tested on a real document: 12 monthly issues of the Statistics Bureau of Japan's "Population Estimates". It is packed with small-print tables mixing kanji, Latin letters and digits.&lt;/p&gt;

&lt;p&gt;These PDFs are actually normal PDFs you can copy from. So I made versions with the text information removed, leaving "only the shapes", and checked the results against the original text as the answer key. I built the table from the December issue alone and read the January to November issues of the following year, about 150,000 characters.&lt;/p&gt;

&lt;p&gt;The glyph table had 0 silent errors here too. OCR made 4,145 errors, such as reading 人 (person) as "A", ＋ as 十 (ten), and 月 (month) as "4".&lt;/p&gt;

&lt;p&gt;To be honest, &lt;strong&gt;the top AI models (Opus 5.5 and Fable 5.2) also made 0 errors on this report&lt;/strong&gt;. On an ordinary government document without confusing item codes, the glyph table does not win on accuracy.&lt;/p&gt;

&lt;p&gt;The difference is elsewhere:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt;: Opus 5.5 costs about $0.07 for every page it reads, about $690 a month for 10,000 pages. The glyph table uses AI only once, when the table is built&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Same result every time&lt;/strong&gt;: the glyph table always gives the same result for the same PDF&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Whether the document leaves your machine&lt;/strong&gt;: the glyph table reads entirely on your own computer&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  In the month the layout changed, it said "?" instead of misreading
&lt;/h2&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%2F00zoxalxl57oezrnrs3h.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%2F00zoxalxl57oezrnrs3h.png" alt="Share of &amp;quot;?&amp;quot; by month" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the January to October issues, about 3% of characters came out as "?", mostly characters that never appeared in the December issue the table was built from.&lt;/p&gt;

&lt;p&gt;In the November issue this jumped to 77%. Looking into it, the size of the digits in the tables had changed slightly. Those sizes were not in the table, so the glyph table &lt;strong&gt;marked every November digit as "?" instead of misreading it&lt;/strong&gt;. Once a person checks the new digit sizes and adds them to the table, it reads the following months again.&lt;/p&gt;

&lt;p&gt;As someone who uses the data, I would much rather be told "I don't know" than be given a silent error.&lt;/p&gt;

&lt;h2&gt;
  
  
  An AI-drafted table repeats the same mistake every month unless it is checked
&lt;/h2&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%2Fhhqfxg7wsssnz01idhge.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%2Fhhqfxg7wsssnz01idhge.png" alt="Unchecked AI drafts" width="799" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also let AI decide "which character is this group" when building the table. Each group's representative glyph is shown inside the line where it was printed, with a red box around it, and the model answers which character it is.&lt;/p&gt;

&lt;p&gt;For the 1,016 groups of the Population Estimates, Fable 5.2 answered 1,000 correctly. That is very good, but using that table without a check still gave 200 silent errors over 11 months. On the self-made statements, a single wrong entry (l answered as I) grew into 210 errors over 11 months. A wrong table repeats the same mistake every month.&lt;/p&gt;

&lt;p&gt;Checking everything by hand is a lot of work, though. So I &lt;strong&gt;had four AI models answer independently, and a person looks only at the groups where their answers split&lt;/strong&gt;. On the self-made statements, the person had to look at only 5 of 83 groups in English and 7 of 90 in Japanese, and every group where the majority vote was wrong was among them. On the Population Estimates, the person looks at 113 of 1,016 groups (about 1 in 10), and the corrected table had 0 silent errors.&lt;/p&gt;

&lt;p&gt;The key is to &lt;strong&gt;mix different kinds of AI models&lt;/strong&gt;. When I had the same model answer 3 times, it repeated the same mistake 3 times, so the answers never split and the mistake went unnoticed.&lt;/p&gt;

&lt;p&gt;There was one place, though, where all four models made the same mistake (i answered as j). That character happened not to appear in later months, so it just didn't affect the results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tilted pages are straightened before reading; strongly tilted ones go to a person
&lt;/h2&gt;

&lt;p&gt;When a page is rotated, the glyph orientations no longer match the table. When I tried reading pages turned upside down, silent errors appeared: n and u, and 6 and 9, turn into each other's exact shapes when flipped.&lt;/p&gt;

&lt;p&gt;So before reading, the method measures the page's tilt and orientation and straightens it. In addition, pages where more than 30% of characters are "?", and pages tilted by more than 10°, are not read at all and go to a person as a whole.&lt;/p&gt;

&lt;p&gt;I tested this &lt;strong&gt;after deciding and publishing "what counts as a pass" before running anything&lt;/strong&gt;, so the criteria could not be changed afterwards to suit the results. Rounds 1 and 2 partly failed; round 3 finally passed everything. On the Population Estimates, all 66 tilted or rotated pages had their orientation and tilt corrected. The records of the failed rounds are kept as they are.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Within what I tested:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using the fact that "the same character is the same shape", PDFs with no extractable text can be read for free with the same result every time. Unknown characters come out as "?", and there were 0 silent errors on 16 self-made conditions and on the public statistics report&lt;/li&gt;
&lt;li&gt;AI is better used once, to draft the table, than to read every page. Comparing the answers of different kinds of AI models cut what a person has to check to about 1 in 10&lt;/li&gt;
&lt;li&gt;On documents with few look-alikes, the top AI models are accurate enough too. The choice comes down not only to accuracy but to cost, whether the result is the same every time, and whether the document leaves your machine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope this helps anyone who collects statistics published in the same layout every month.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Terms
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Glyph table&lt;/strong&gt;: a table of glyph-shape groups → characters&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Silent error&lt;/strong&gt;: a character different from the correct one, output with no warning&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"?"&lt;/strong&gt;: a character not close enough to any shape in the table, or one in a confusable group. Not counted as an error&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OCR&lt;/strong&gt;: software that reads characters from a page image. Here OCRmyPDF 17.4.0 + Tesseract 5.3.4&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How it works (for engineers)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Reads the filled shapes in the PDF (handles &lt;code&gt;q&lt;/code&gt;/&lt;code&gt;Q&lt;/code&gt;/&lt;code&gt;cm&lt;/code&gt;) and drops long thin rectangles as ruled lines&lt;/li&gt;
&lt;li&gt;Renders each glyph as a small black-and-white bitmap and measures similarity by overlap. If the width or height differs by more than a tolerance, it is a different character. Positions shifted by 1 pixel are also tried&lt;/li&gt;
&lt;li&gt;The similarity threshold is set from the first month alone. If "the lowest similarity between same characters" is higher than "the highest similarity between different characters", the midpoint is used&lt;/li&gt;
&lt;li&gt;Python standard library only. Reading takes 0.3–1.5 s per page (self-made statements) and about 10 s (dense tables of the Population Estimates)&lt;/li&gt;
&lt;li&gt;Tilt is the median angle of the lines joining nearby glyphs of the same size&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conditions and caveats
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Everything ran in the Claude Code cloud environment (x86_64)&lt;/li&gt;
&lt;li&gt;The 17 self-made conditions: 4 fonts (Liberation Sans, Serif and Mono, DejaVu Serif), Japanese (IPAGothic), text turned into shapes by Ghostscript, each line merged into one shape, ruled lines touching glyphs, tight letter spacing, quotation marks, and 3 levels of coordinate jitter (±0.02 / ±0.05 / ±0.1 pt). Only the ±0.1 pt condition had errors&lt;/li&gt;
&lt;li&gt;Population Estimates: pages 1–5 of the December 2025 to November 2026 issues (153,247 characters). Text was turned into shapes with Ghostscript 10.02.1 &lt;code&gt;-dNoOutputFonts&lt;/code&gt;, and the original text was used as the answer key. These are not PDFs that were made of shapes to begin with. In the November issue the table digits changed from 7.5 pt to 7.14 pt and from 7.92 pt to 7.8 pt&lt;/li&gt;
&lt;li&gt;I have not measured how much glyph shapes drift in real-world PDFs&lt;/li&gt;
&lt;li&gt;The human check was simulated with the answer key. The real effort of a person checking 113 groups, and human misreads, were not measured&lt;/li&gt;
&lt;li&gt;AI: only the four Claude models (Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2); OCR: only Tesseract. The models saw 150 dpi page images with an instruction to watch for look-alikes. Costs are at list price&lt;/li&gt;
&lt;li&gt;For all 3 rounds of the tilt and orientation work, the pass criteria were committed to the repository before testing (pre-registration). The angles used for judging were 0.3°, -4°, 9°, 95°, 25° and -60°&lt;/li&gt;
&lt;li&gt;Vertical writing: one self-made condition only (0 errors, same as horizontal). Text in images embedded in the PDF is out of scope&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Data source
&lt;/h3&gt;

&lt;p&gt;Created by processing "Population Estimates" (Statistics Bureau of Japan) (&lt;a href="https://www.stat.go.jp/data/jinsui/new.html" rel="noopener noreferrer"&gt;https://www.stat.go.jp/data/jinsui/new.html&lt;/a&gt;), under the Public Data License (Version 1.0). Because the PDFs include font rights, the repository does not contain the PDFs; it holds only the download and conversion scripts and the reading results.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Japanese version: &lt;a href="https://zenn.dev/shogaku/articles/glyph-table-pdf-ocr" rel="noopener noreferrer"&gt;Zenn&lt;/a&gt;, &lt;a href="https://qiita.com/ussu_ussu_ussu/items/ad5c68cb730a2e655f85" rel="noopener noreferrer"&gt;Qiita&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>pdf</category>
      <category>ocr</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>What I checked before installing Claude Code mods</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Mon, 23 Nov 2026 02:22:33 +0000</pubDate>
      <link>https://dev.to/yasumorishima/what-i-checked-before-installing-claude-code-mods-4665</link>
      <guid>https://dev.to/yasumorishima/what-i-checked-before-installing-claude-code-mods-4665</guid>
      <description>&lt;h2&gt;
  
  
  Why I looked into this
&lt;/h2&gt;

&lt;p&gt;On October 1, 2026, Claude Code got mods: small TypeScript functions that change how Claude Code behaves and what it draws. In this post, "mods" is the feature and "a mod" is one of them.&lt;/p&gt;

&lt;p&gt;I had written one mod back in the early-access build (the function hooks you turned on with &lt;code&gt;CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1&lt;/code&gt;). After a while with no input, it compacts once and has the summary include a note on where to pick the work up again. But my sessions sometimes hit an error and crashed right after startup, so I've stopped loading it until I find the cause.&lt;/p&gt;

&lt;p&gt;Now that mods are generally available, I wanted to know what they can do and what to watch out for before turning mine back on. These are my notes.&lt;/p&gt;

&lt;p&gt;Everything here is as of November 23, 2026. I read the official announcement, the docs, and the security write-ups cited later firsthand, not through summaries. Mods are less than two months old and still change often, so some of this may already be out of date.&lt;/p&gt;

&lt;h2&gt;
  
  
  My setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Windows 11&lt;/li&gt;
&lt;li&gt;Claude Code v2.1.330&lt;/li&gt;
&lt;li&gt;Logged in with a personal Max plan. No managed settings (the settings file an organization deploys)&lt;/li&gt;
&lt;li&gt;Many hooks of my own that block risky actions, used with auto mode&lt;/li&gt;
&lt;li&gt;One mod I wrote (not loaded right now)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What mods can do
&lt;/h2&gt;

&lt;p&gt;The announcement calls mods "small TypeScript functions that change how Claude Code works." Claude Code calls a mod's functions at points like a tool call, a submitted prompt, or part of the screen being drawn, and the mod can watch, change, or take over what happens.&lt;/p&gt;

&lt;p&gt;For example, a mod can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open a pane beside the conversation or a band above the input box, with tabs, buttons, and input fields&lt;/li&gt;
&lt;li&gt;Redraw Claude Code's own UI, such as tool call rows, the spinner, or the question dialog&lt;/li&gt;
&lt;li&gt;Hold a tool call and ask you a question first, or return a result without running the tool&lt;/li&gt;
&lt;li&gt;Route a single Claude request to a different model&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;/command&lt;/code&gt; that runs your function right away, without going through Claude&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mods ship inside plugins. You list a JavaScript or TypeScript file under &lt;code&gt;modules&lt;/code&gt; in &lt;code&gt;hooks/hooks.json&lt;/code&gt;, and there's no build step. If you ask Claude, it will write the mod, install it, and reload it in your session.&lt;/p&gt;

&lt;p&gt;Some of Claude Code's own features are already mods. They're listed under Built-in in the Installed tab of &lt;code&gt;/plugin&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cc-plugin-agents-md&lt;/code&gt;: loads AGENTS.md&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cc-plugin-diff&lt;/code&gt;: handles &lt;code&gt;/diff&lt;/code&gt; in the terminal&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cc-plugin-sec-default&lt;/code&gt;: protects what your organization manages from mods that users install (can't be turned off)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cc-plugin-telemetry&lt;/code&gt;: sends usage data&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cc-plugin-you-should-know&lt;/code&gt;: points out things you might have missed (off by default)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Mods are on by default from v2.1.287 in the terminal and from v2.1.286 in the desktop app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mods run outside the sandbox, with your permissions
&lt;/h2&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%2Fgcunbkle0vsls0xi516n.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%2Fgcunbkle0vsls0xi516n.png" alt="Mods run outside permission rules and the sandbox" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of everything I read, this seemed the most important point. The announcement says: "They aren't sandboxed, and you should only install mods from sources you trust." The docs spell out what a loaded mod can do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read and write files anywhere your account can, start programs, and make network requests&lt;/li&gt;
&lt;li&gt;Read API keys from environment variables and settings files&lt;/li&gt;
&lt;li&gt;See every prompt you send and every tool call Claude makes&lt;/li&gt;
&lt;li&gt;Rewrite prompts and tool calls, and submit a prompt as if you had typed it&lt;/li&gt;
&lt;li&gt;Approve a tool call before you are asked&lt;/li&gt;
&lt;li&gt;Call a model on your plan or API key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Claude Code's sandbox only isolates the Bash commands Claude runs. A process that a mod starts runs outside it.&lt;/p&gt;

&lt;p&gt;Claude Code's existing hooks (shell commands and the like in a settings file, called "settings hooks" below) run in a separate process from Claude Code. A mod, on the other hand, is a function that Claude Code calls inside its own process. The comparison table in the docs puts it as "Functions in a plugin that Claude Code calls in its own process."&lt;/p&gt;

&lt;h2&gt;
  
  
  On a personal plan, the built-in guard doesn't load
&lt;/h2&gt;

&lt;p&gt;This was the part most relevant to my setup.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cc-plugin-sec-default&lt;/code&gt;, mentioned above, also limits some of what user-installed mods can do. But it only loads when one of these is true:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The machine has managed settings (or a &lt;code&gt;managed-mcp.json&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;You're logged in with &lt;code&gt;/login&lt;/code&gt; on a Team or Enterprise plan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm on a personal Max plan with no managed settings, so the guard isn't loaded.&lt;/p&gt;

&lt;p&gt;The permissions page of the docs describes what a mod can do in that setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Approve a call that your PreToolUse hook blocked, and some calls that a deny rule refuses&lt;/li&gt;
&lt;li&gt;Skip the confirmation (permission prompt) from an ask rule or a PreToolUse hook&lt;/li&gt;
&lt;li&gt;In auto mode, a call the mod approves can run without the classifier check&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have a lot of settings hooks that block risky actions, and I use auto mode. Installing a single mod written by someone else would let it override what my settings hooks decide.&lt;/p&gt;

&lt;p&gt;Even where the guard is loaded, the mod's own file and process calls (&lt;code&gt;$.fs&lt;/code&gt;, &lt;code&gt;$.process&lt;/code&gt;) can skip permission rules and PreToolUse hooks. The docs give the example that with &lt;code&gt;Read(.env)&lt;/code&gt; denied, a mod can still read that file with &lt;code&gt;$.fs.read&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There are exceptions. A mod can't change what the permission prompt shows. And for tools that need user interaction, such as AskUserQuestion, a mod's approval doesn't skip the confirmation (v2.1.292 and later).&lt;/p&gt;

&lt;h2&gt;
  
  
  A broken mod is skipped silently
&lt;/h2&gt;

&lt;p&gt;The troubleshooting page says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When a mod's module or one of its hooks fails, Claude Code skips it and the session continues, so a broken mod can look like one that does nothing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;If a hook throws, times out, or returns a result of the wrong shape, that hook is skipped&lt;/li&gt;
&lt;li&gt;If the hooks worker (the background process that runs mods) stops three times and Claude Code can't trace it to one mod, every mod that isn't built in is turned off for that session, including mods your organization installed. &lt;code&gt;/reload-plugins&lt;/code&gt; loads them again&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So a mod meant to block risky actions blocks nothing if it's broken.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;claude plugin validate&lt;/code&gt; shows what a mod touches
&lt;/h2&gt;

&lt;p&gt;I ran &lt;code&gt;claude plugin validate&lt;/code&gt; on my own mod. It inspects the code without running it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ ./idle-compact-memo.ts hooks: turn.start, turn.complete, session.compact, session.end
❯ ./idle-compact-memo.ts gating hook without .catch: session.compact
❯ ./idle-compact-memo.ts calls: $.clock.after (via arm), $.clock.now (via arm, fire, writeMemo),
  $.fs.exists (via writeMemo), $.fs.write (via writeMemo), $.session.compact (via fire),
  $.session.cwd (via writeMemo), $.session.id (via arm, fire), $.ui.log (via log, notice)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;According to the docs, the &lt;code&gt;hooks:&lt;/code&gt; line lists the events the mod handles and the &lt;code&gt;calls:&lt;/code&gt; line lists what it asks Claude Code to do. Mine writes files (&lt;code&gt;$.fs.write&lt;/code&gt;) and triggers a compact (&lt;code&gt;$.session.compact&lt;/code&gt;), and nothing in the list touches the network.&lt;/p&gt;

&lt;p&gt;The docs also have a list of calls worth checking. For example, &lt;code&gt;$.fs.read&lt;/code&gt; and &lt;code&gt;$.fs.write&lt;/code&gt; read and write files anywhere, &lt;code&gt;$.env.get&lt;/code&gt; reads environment variables that may hold API keys, and &lt;code&gt;$.model.complete&lt;/code&gt; calls a model on your plan or API key. Before installing someone else's mod, I plan to compare its &lt;code&gt;hooks:&lt;/code&gt; and &lt;code&gt;calls:&lt;/code&gt; lines against that list. Since the check doesn't run the code, it can miss things, so I'll read the source too.&lt;/p&gt;

&lt;p&gt;I also got a &lt;code&gt;gating hook without .catch&lt;/code&gt; warning. As far as I can tell, it means a hook that blocks actions has no handling for its own failure. A failing hook gets skipped, so I'll add a &lt;code&gt;.catch&lt;/code&gt; before turning the mod back on.&lt;/p&gt;

&lt;h2&gt;
  
  
  The early-access environment variable no longer does anything
&lt;/h2&gt;

&lt;p&gt;The docs say that if you set &lt;code&gt;CLAUDE_CODE_ENABLE_FUNCTION_HOOKS&lt;/code&gt; during early access, you should remove it. From v2.1.287, Claude Code ignores it, so setting it to &lt;code&gt;0&lt;/code&gt; doesn't turn mods off.&lt;/p&gt;

&lt;p&gt;I had removed two environment variables to stop loading my mod: this one and the one pointing to my plugin's folder. Checking again, my mod is off because I removed the folder path, not because I removed &lt;code&gt;CLAUDE_CODE_ENABLE_FUNCTION_HOOKS&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4 in 10 public mods start local processes
&lt;/h2&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%2Fdv9gio1snzvhc84vdawp.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%2Fdv9gio1snzvhc84vdawp.png" alt="4 in 10 public mods start local processes" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The security company Manifold Security looked at 6,125 mods published on GitHub. 41% start local processes, 32% see every tool call, and 29% see every prompt.&lt;/p&gt;

&lt;p&gt;They analyzed the mods listed, as of October 25, 2026 (a little over three weeks after general availability), in the largest GitHub catalog of mods they could find. Other numbers from the post:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;36% read environment variables and 35% read files. 13% can submit prompts as you, and 11% reach the network&lt;/li&gt;
&lt;li&gt;267 mods (4%) hook the permission decision itself, and 93 of them can return "allow"&lt;/li&gt;
&lt;li&gt;About 20 let an outside channel, such as a Telegram bot or a relay server, submit prompts into a live session&lt;/li&gt;
&lt;li&gt;223 mods from 63 repositories were already gone from GitHub. They may still be installed on people's machines, but nobody can check what's in them anymore&lt;/li&gt;
&lt;li&gt;At least 16 repositories read the Claude OAuth token. The ones they traced send it only to Anthropic&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Risky uses were shown before general availability
&lt;/h2&gt;

&lt;p&gt;On September 22, 2026, Pluto Security used the early-access build (v2.1.274) to show that a mod could:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt; and your prompt history and send them out&lt;/li&gt;
&lt;li&gt;Show "Hooks (0)" in &lt;code&gt;plugin details&lt;/code&gt; even though it hooks every event&lt;/li&gt;
&lt;li&gt;Draw a fake API key prompt right above the input line&lt;/li&gt;
&lt;li&gt;Swap the question text in the AskUserQuestion dialog (Claude Code restores the option labels, but generic ones like "Confirm" and "Cancel" look the same either way)&lt;/li&gt;
&lt;li&gt;Make the command that actually runs differ from the one shown in the transcript&lt;/li&gt;
&lt;li&gt;Fetch and run remote code after you install it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They also confirmed that mod code runs where &lt;code&gt;fetch&lt;/code&gt; and &lt;code&gt;require&lt;/code&gt; aren't directly available, and that a mod can't rewrite the tool-approval prompt. The post notes that it covers the pre-release implementation and that things may change. I haven't checked whether the same things work in the released version.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other plugin security issues beyond mods
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Plugin4Shell&lt;/strong&gt; (published by AIR Security on September 17, 2026, CVE-2026-86063): even when a marketplace pins a plugin to a commit SHA, an attacker can create a branch with the same name as that SHA, and git checks out the branch instead. It reportedly reaches users with no action on their part, through plugin auto-update. It affected Codex, Copilot, and Gemini CLI as well as Claude Code, and Claude Code is fixed in 2.1.179 and later&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HOOKPRY&lt;/strong&gt; (arXiv, not peer reviewed, submitted September 3, 2026): research on quietly slipping an attacker's commands into a harmless plugin as hooks in a later update. Across 1,000 runs on seven agent harnesses, it compromised all seven, with success rates of up to 92.5% per harness. Microsoft Defender reportedly flagged none of the attacks&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cursor's marketplace&lt;/strong&gt;: for about 11 hours on October 29, 2026, Cursor's extension marketplace served a tampered Claude Code extension (2.1.312 and 2.1.313, for Windows and macOS). It tried to set up an SSH backdoor. On most machines that step fails, because enabling SSH needs admin rights the extension doesn't have. Still, it added the attacker's SSH key, installed persistence, and sent host details. Cursor says the versions were not made by Anthropic and that it has no evidence the official distribution was affected&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The plugin security page in the docs also notes that when auto-update is on for a marketplace, files you reviewed can change on disk later. By default, auto-update is on for Anthropic's official marketplaces such as &lt;code&gt;claude-plugins-official&lt;/code&gt; and for marketplaces added from claude.ai, and off for all others (including the official &lt;code&gt;knowledge-work-plugins&lt;/code&gt; and &lt;code&gt;first-party-plugins&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  How I'm going to use mods
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install only mods I wrote and the built-in ones. The guard doesn't load on my machine, so I'll assume someone else's mod can get around my hooks&lt;/li&gt;
&lt;li&gt;If I want to try someone else's mod, check its &lt;code&gt;hooks:&lt;/code&gt; and &lt;code&gt;calls:&lt;/code&gt; lines with &lt;code&gt;validate&lt;/code&gt; and read the source before installing. No large packs bundling many mods&lt;/li&gt;
&lt;li&gt;Keep auto-update off for marketplaces other than the official ones&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;.catch&lt;/code&gt; to my mod and turn it back on only after I find why sessions crashed at startup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For work use, I'm also noting the managed settings that restrict mods:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;allowManagedModsOnly&lt;/code&gt; (under &lt;code&gt;cc-plugin-sec-default@builtin&lt;/code&gt; in &lt;code&gt;pluginConfigs&lt;/code&gt;): refuses mods that users install themselves. Users' settings hooks and status lines keep working&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;allowManagedHooksOnly&lt;/code&gt;: loads only your organization's mods and the built-in ones. Users' own settings hooks stop too&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;disableAllHooks&lt;/code&gt;: stops every mod and hook except the built-in mods, including your organization's. PreToolUse hooks in managed settings stop as well&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;disableSideloadFlags&lt;/code&gt;: rejects &lt;code&gt;--plugin-dir&lt;/code&gt; and similar flags at startup, and keeps mods Claude writes during a session from loading&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;prependPlugins&lt;/code&gt;: runs your organization's mods first. When it's used, &lt;code&gt;sec-default@builtin&lt;/code&gt; has to be in the list too, or the built-in guard is removed&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;strictKnownMarketplaces&lt;/code&gt;: an allowlist of marketplaces users may install from&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DISABLE_AUTOUPDATER&lt;/code&gt; (in the managed &lt;code&gt;env&lt;/code&gt; block): turns off plugin auto-update. It also stops Claude Code's own updates. To keep plugin auto-update, add &lt;code&gt;FORCE_AUTOUPDATE_PLUGINS&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://claude.com/resources/articles/claude-code-mods" rel="noopener noreferrer"&gt;Announcement (October 1, 2026)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Mods docs: &lt;a href="https://code.claude.com/docs/en/plugins/mods/overview" rel="noopener noreferrer"&gt;overview&lt;/a&gt;, &lt;a href="https://code.claude.com/docs/en/plugins/mods/admin" rel="noopener noreferrer"&gt;admin&lt;/a&gt;, &lt;a href="https://code.claude.com/docs/en/plugins/mods/troubleshoot" rel="noopener noreferrer"&gt;troubleshoot&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://code.claude.com/docs/en/plugins/security" rel="noopener noreferrer"&gt;Plugin security&lt;/a&gt;, &lt;a href="https://code.claude.com/docs/en/plugins/loading" rel="noopener noreferrer"&gt;plugin auto-update&lt;/a&gt;, &lt;a href="https://code.claude.com/docs/en/plugins/org" rel="noopener noreferrer"&gt;plugins for organizations&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.claude.com/docs/en/permissions" rel="noopener noreferrer"&gt;Permissions: precedence among rules, hooks, and mods&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.manifold.security/blog/agent-add-ons-approval-claude-code-mods" rel="noopener noreferrer"&gt;Manifold Security&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pluto.security/blog/claude-code-function-hooks-security/" rel="noopener noreferrer"&gt;Pluto Security&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.air.security/blog-posts/plugin4shell" rel="noopener noreferrer"&gt;AIR Security: Plugin4Shell&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/2609.03884" rel="noopener noreferrer"&gt;HOOKPRY (arXiv)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cursor.com/blog/claude-code-extension-security-notice" rel="noopener noreferrer"&gt;Cursor security notice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Japanese version: &lt;a href="https://qiita.com/ussu_ussu_ussu/items/d2416096c85ab0d4a13a" rel="noopener noreferrer"&gt;Qiita&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>security</category>
      <category>typescript</category>
    </item>
    <item>
      <title>The warnings from my Claude Code hooks never reached Claude</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Thu, 19 Nov 2026 12:59:14 +0000</pubDate>
      <link>https://dev.to/yasumorishima/the-warnings-from-my-claude-code-hooks-never-reached-claude-1fl</link>
      <guid>https://dev.to/yasumorishima/the-warnings-from-my-claude-code-hooks-never-reached-claude-1fl</guid>
      <description>&lt;h2&gt;
  
  
  Why I looked into this
&lt;/h2&gt;

&lt;p&gt;Claude Code has hooks: scripts that run at fixed points, such as before a tool call or before Claude ends its reply, to block risky actions or add a warning. I kept asking Claude Code to add hooks for me, and over time I ended up with 86 of them.&lt;/p&gt;

&lt;p&gt;At some point I noticed that hook warnings and errors were showing up on my screen, yet Claude carried on as if nothing had happened. The warnings reached me, but apparently not Claude. A warning that only I can see is not much use.&lt;/p&gt;

&lt;p&gt;So I checked the official docs to see which hook outputs actually reach Claude, and went back over my own hooks. This post is what I found.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;PC: Windows 11, Celeron N4500, 4 GB RAM&lt;/li&gt;
&lt;li&gt;Shell: Git Bash (every hook is a bash script)&lt;/li&gt;
&lt;li&gt;Claude Code: v2.1.327 (the month of logs I looked back over spans v2.1.304 to v2.1.327)&lt;/li&gt;
&lt;li&gt;Hooks: 86

&lt;ul&gt;
&lt;li&gt;55 PreToolUse hooks. settings.json lists one dispatcher, which runs them at most 8 at a time&lt;/li&gt;
&lt;li&gt;17 Stop, 5 SessionStart, 3 UserPromptSubmit, 6 PostToolUse / PostToolUseFailure&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every one of these hooks was written by Claude Code, after I asked it to "stop me when this happens".&lt;/p&gt;

&lt;h2&gt;
  
  
  Only four main outputs reach Claude
&lt;/h2&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%2F27ai6lsr5hfsiq7gq1rf.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%2F27ai6lsr5hfsiq7gq1rf.png" alt="Which hook outputs reach Claude" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;According to the official Hooks reference, these are the main hook outputs that reach Claude:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stderr when the hook exits 2 (except on SessionStart and a few other events)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hookSpecificOutput.additionalContext&lt;/code&gt; in JSON output&lt;/li&gt;
&lt;li&gt;the reason given when blocking (&lt;code&gt;permissionDecisionReason&lt;/code&gt; with deny, &lt;code&gt;reason&lt;/code&gt; with &lt;code&gt;decision: "block"&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;plain stdout from SessionStart and UserPromptSubmit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The ways people tend to write warnings do not reach it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A warning written to stderr with exit 0.&lt;/strong&gt; The docs say: "Claude never sees stderr from a hook that exits 0." To read it yourself, they suggest turning on debug logging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A crash with exit 1 or another code, a timeout, or JSON that can't be parsed.&lt;/strong&gt; These count as non-blocking errors. On events such as PreToolUse you see a short "hook error" notice, and the action goes ahead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plain stdout from Stop, PostToolUse and similar events.&lt;/strong&gt; Only some events, such as SessionStart and UserPromptSubmit, pass plain stdout to Claude.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;systemMessage&lt;/code&gt;.&lt;/strong&gt; It is a warning for the user.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The reason for an "ask".&lt;/strong&gt; It is shown only in the user's permission prompt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;exit 2 on SessionStart.&lt;/strong&gt; The table in the docs says "Shows stderr to user only".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many of my hooks followed the pattern "not worth blocking, so print a warning to stderr and exit 0". Left as they were, those warnings went nowhere (apart from the ones my dispatcher already forwarded).&lt;/p&gt;

&lt;h2&gt;
  
  
  Not only unseen: the checks were not running
&lt;/h2&gt;

&lt;p&gt;Going back through the session logs, most of the short "hook error" notices on my screen turned out to be hooks that did not finish in time. A hook like that tells Claude nothing, and it also never performs the check it was there for.&lt;/p&gt;

&lt;p&gt;From here on I use two words. A &lt;strong&gt;timeout&lt;/strong&gt; is when my dispatcher or my wrapper (described below) stops a hook at its own limit (logged as a non-blocking error). A &lt;strong&gt;cancellation&lt;/strong&gt; is when Claude Code stops a hook at the limit in settings.json (logged as &lt;code&gt;hook_cancelled&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 1: a build-check hook that got slower with every line
&lt;/h2&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%2Ftwecw0v93w5pjsn9c99z.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%2Ftwecw0v93w5pjsn9c99z.png" alt="Time per run vs. number of lines" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most timeouts came from a single hook. It checks that build and test commands sent to my Raspberry Pi 5 are wrapped in &lt;code&gt;peakrss&lt;/code&gt;, a small tool that records peak memory.&lt;/p&gt;

&lt;p&gt;The hook split the command on &lt;code&gt;;&lt;/code&gt;, &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;, &lt;code&gt;|&lt;/code&gt; and newlines, then ran &lt;code&gt;sed&lt;/code&gt;, &lt;code&gt;tr&lt;/code&gt; and &lt;code&gt;grep&lt;/code&gt; on each piece to find its first word. In Git Bash, starting a program is slow, and each piece started a dozen or so of them.&lt;/p&gt;

&lt;p&gt;The chart shows the time for ssh scripts with three commands per line, at different lengths (one run per length). Before the fix, 10 lines took 16 s, 50 lines took 101.5 s, and 200 lines took 292.7 s. In practice my dispatcher stops a hook at 60 s, so somewhere between 25 and 50 lines the check simply stopped happening.&lt;/p&gt;

&lt;p&gt;The fix was to do everything after the split with bash builtins only (&lt;code&gt;[[ =~ ]]&lt;/code&gt;, &lt;code&gt;BASH_REMATCH&lt;/code&gt;, parameter expansion). 200 lines now take 1.4 s. The rules did not change, and all 47 existing test cases give the same results.&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;# before: starts programs for every piece&lt;/span&gt;
&lt;span class="nv"&gt;piece&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s'&lt;/span&gt; &lt;span class="s2"&gt;"$piece"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; tr -d &lt;span class="s1"&gt;'"'&lt;/span&gt;&lt;span class="s2"&gt;"'"&lt;/span&gt;&lt;span class="s1"&gt;'`'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; sed -E &lt;span class="s1"&gt;'s/^[[:space:]]+//'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# after: bash only&lt;/span&gt;
&lt;span class="nv"&gt;piece&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;${piece//[\"\'\`]/}&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$piece&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ ^&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;:space:&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;+&lt;span class="o"&gt;(&lt;/span&gt;.*&lt;span class="o"&gt;)&lt;/span&gt;$ &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;piece&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;${BASH_REMATCH[1]}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Example 2: the hand-over note at session start rarely arrived
&lt;/h2&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%2Ff4a1keme6x0o22fdorkx.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%2Ff4a1keme6x0o22fdorkx.png" alt="Hand-over note delivered or cancelled" width="800" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At SessionStart, a hook hands Claude a note from earlier sessions listing what to do next. SessionStart fires not only when a session starts but also when a long session resumes after compaction. This hook had a 10 s limit, and the logs show it was cancelled most of the time at session startup. After compaction, only some runs were cancelled.&lt;/p&gt;

&lt;p&gt;My guess is that startup is when the PC is busiest, since Claude Code itself is starting up at the same time. Whenever the note was cancelled, Claude began the session without it.&lt;/p&gt;

&lt;p&gt;The other three hooks that run at the same moment (a check for credential files in odd places, a check for tampered agent config, and a disk check on the Raspberry Pi) were also cancelled again and again at their 15 s limit. They stay silent when they find nothing, so when they were cancelled, nothing happened apart from a short notice on my screen.&lt;/p&gt;

&lt;p&gt;The causes were starting five hooks at once on a slow PC, and limits that were too short.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example 3: 17 Stop hooks starting at once, and crashing
&lt;/h2&gt;

&lt;p&gt;There are 17 Stop hooks. As the docs say, the hooks for one event run in parallel, so all 17 start at once. On a 4 GB PC, Git Bash sometimes failed to create a process, and the logs held errors like these:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;child_copy: cygheap read copy failed
/usr/bin/bash: Resource temporarily unavailable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every failure with a readable cause was a failure to start a process (besides the two above: &lt;code&gt;EUNKNOWN&lt;/code&gt; from &lt;code&gt;uv_spawn&lt;/code&gt;, and git failing to launch, among others). Many had an empty stderr, so the logs don't say why. Either way they are non-blocking errors: nothing reaches Claude, and there is no telling whether the check ran to the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: one wrapper around every hook
&lt;/h2&gt;

&lt;p&gt;Instead of fixing hooks one by one, I wrote a wrapper, &lt;code&gt;run-hook.sh&lt;/code&gt;, and put it in front of every hook in settings.json:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"bash 'C:/Users/me/.claude/hooks/run-hook.sh' Stop 290 'C:/Users/me/.claude/hooks/block-stop-on-paid-proposal.sh'"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"timeout"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The wrapper does four things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Limits how many hooks run at once&lt;/strong&gt;: 8 across the whole machine, sharing the slots with the PreToolUse dispatcher&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retries once after a quick crash&lt;/strong&gt;: failing to create a process is transient, so it retries only when the hook died within 15 s&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;If the hook still fails or times out, tells Claude in a way Claude can see&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Turns outputs Claude can't see into ones it can&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For 3 and 4, by kind of output:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;crash or timeout → &lt;code&gt;additionalContext&lt;/code&gt; saying "this check did not run"&lt;/li&gt;
&lt;li&gt;warning on stderr with exit 0 → into &lt;code&gt;additionalContext&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systemMessage&lt;/code&gt; only → the same text also goes into &lt;code&gt;additionalContext&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;exit 2 on SessionStart → into &lt;code&gt;additionalContext&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;plain stdout from Stop or PostToolUse → into &lt;code&gt;additionalContext&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;exit 2 or a JSON decision → passed through unchanged&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The PreToolUse dispatcher got the same treatment, and it now copies the reason for an "ask" into &lt;code&gt;additionalContext&lt;/code&gt; as well, so Claude knows what I was asked to approve.&lt;/p&gt;

&lt;p&gt;The failure report looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fail_out&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  &lt;span class="c"&gt;# $1 = kind of cause, $2 = reason&lt;/span&gt;
  &lt;span class="kd"&gt;local&lt;/span&gt; &lt;span class="nv"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"[$name] HOOK FAILED ($event): $2. This check did not run; do what it would have checked yourself."&lt;/span&gt;
  report &lt;span class="s2"&gt;"$1"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; say_json &lt;span class="s2"&gt;"$msg"&lt;/span&gt;   &lt;span class="c"&gt;# say_json = {"hookSpecificOutput":{"hookEventName":..,"additionalContext":..}}&lt;/span&gt;
  &lt;span class="nb"&gt;exit&lt;/span&gt; 0
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also raised the limits: Claude Code now gives SessionStart and UserPromptSubmit hooks 60 s and Stop hooks 300 s. The wrapper stops the hook a little before that and reports the timeout itself, because once Claude Code cancels the wrapper, the wrapper can't say anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Once warnings got through, hidden ones showed up
&lt;/h2&gt;

&lt;p&gt;Right after the wrapper went in, warnings that had been invisible started reaching Claude:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bash's &lt;code&gt;warning: command substitution: ignored null byte in input&lt;/code&gt;, printed when tool output contains a NUL byte. It is informational only, so the wrapper now drops that one line&lt;/li&gt;
&lt;li&gt;a "no local code" warning that fired every time a script was written to Claude Code's temp folder. That folder is fine to treat like &lt;code&gt;/tmp&lt;/code&gt;, so it was a false alarm. While excluding it, I also found and closed a hole: a path like &lt;code&gt;claude/../../Desktop/x.py&lt;/code&gt; could get out of the folder&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only once the warnings arrived could the false alarms be fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  After a Stop notice, the next Stop counts as a continuation
&lt;/h2&gt;

&lt;p&gt;When a Stop hook returns &lt;code&gt;additionalContext&lt;/code&gt;, the conversation continues, as the docs say. What happens to &lt;code&gt;stop_hook_active&lt;/code&gt; at the next Stop? The docs only say it is "true when Claude Code is already continuing as a result of a stop hook", so I added a temporary hook that just logs it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;13:38:06 stop_hook_active=absent   &amp;lt;- first Stop (returned additionalContext here)
13:39:41 stop_hook_active=true     &amp;lt;- the Stop after the continuation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;absent&lt;/code&gt; on the first line is an artifact of how I logged it: jq's &lt;code&gt;.stop_hook_active // "absent"&lt;/code&gt; also returns &lt;code&gt;absent&lt;/code&gt; when the value is false. From the second line on I used &lt;code&gt;has()&lt;/code&gt;, and the Stop after the continuation was true. Three of my Stop hooks skipped their check whenever &lt;code&gt;stop_hook_active&lt;/code&gt; was true, so a single notice from any other hook switched them off for the next stop. I changed them to skip only when they themselves blocked the previous stop. Claude Code also has a cap: after Stop hooks have continued the turn eight times in a row, it ends the turn instead of blocking again. The count resets whenever Claude calls a tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  At Stop time, the transcript may not have the final reply yet
&lt;/h2&gt;

&lt;p&gt;The Stop section of the docs had one more thing. The transcript isn't guaranteed to include the final message at Stop time, so hooks should use &lt;code&gt;last_assistant_message&lt;/code&gt; from the input instead.&lt;/p&gt;

&lt;p&gt;All 17 of my Stop hooks read the final reply from the transcript. I logged both with a temporary hook on two stops; they matched both times on my machine, but that is not a guarantee. When I tested with a fake transcript that lagged behind, two hooks really did misjudge:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the hook that stops Claude from ending its reply with a question to me after an error: it couldn't see the final reply and let it through&lt;/li&gt;
&lt;li&gt;the hook that stops Claude from ending without reporting an error: it blocked a reply that did mention the error&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I changed the 12 hooks that read the reply's text to use &lt;code&gt;last_assistant_message&lt;/code&gt; first.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I checked
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Dispatcher: 7 fake-hook cases (crash, crash only on the first try, timeout, ask plus crash, block plus crash, warning only, nothing)&lt;/li&gt;
&lt;li&gt;Wrapper: 26 fake-hook cases&lt;/li&gt;
&lt;li&gt;Build-check hook: 53 test cases (I also fixed a miss on options that take an argument, such as &lt;code&gt;ssh -i key&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The real hooks run together: all 17 Stop hooks finished in 24 s, the 5 SessionStart hooks in 12 s&lt;/li&gt;
&lt;li&gt;In later sessions, ask reasons and PostToolUse warnings did reach Claude&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;In my setup, many of the hooks Claude Code wrote for me warned in ways Claude could not see, and on a slow PC the hooks often didn't finish at all. Either way, all that happened was a short notice on my screen, and Claude carried on without knowing.&lt;/p&gt;

&lt;p&gt;For me the biggest surprise was not that warnings went unseen, but that a check that never ran told nobody it hadn't run. I assumed the hooks were looking after me, so I didn't notice.&lt;/p&gt;

&lt;p&gt;You can check whether the same thing happens in your setup from the session logs; the appendix shows how.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Terms
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PreToolUse / PostToolUse&lt;/strong&gt;: hooks that run before / after a tool call&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop&lt;/strong&gt;: a hook that runs before Claude ends its reply. Blocking with exit 2 makes Claude keep working&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SessionStart / UserPromptSubmit&lt;/strong&gt;: hooks that run when a session starts / when the user sends a message&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;additionalContext&lt;/strong&gt;: text a hook returns in JSON for Claude. It reaches Claude as a system note&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Checking your own setup
&lt;/h3&gt;

&lt;p&gt;Claude Code keeps session logs in &lt;code&gt;~/.claude/projects/&amp;lt;project&amp;gt;/&amp;lt;session id&amp;gt;.jsonl&lt;/code&gt;, one JSON object per line. Hook results are stored as &lt;code&gt;attachment&lt;/code&gt; entries, and these three &lt;code&gt;type&lt;/code&gt; values never reached Claude:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;hook_non_blocking_error&lt;/code&gt;: non-blocking failure (exit 1, timeout)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hook_cancelled&lt;/code&gt;: cancelled by Claude Code&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;hook_system_message&lt;/code&gt;: a &lt;code&gt;systemMessage&lt;/code&gt; (warning for the user)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To count them by event and hook, I saved this filter as &lt;code&gt;count.jq&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;select(.attachment?)
| .attachment
| select(.type == "hook_non_blocking_error" or .type == "hook_cancelled" or .type == "hook_system_message")
| [ .type, (.hookEvent // ""), ((.command // .hookName // "") | split("hooks/") | last) ]
| @tsv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cat ~/.claude/projects/&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;project&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/*.jsonl \
  &lt;span class="o"&gt;|&lt;/span&gt; jq -r -f count.jq \
  &lt;span class="o"&gt;|&lt;/span&gt; sort &lt;span class="o"&gt;|&lt;/span&gt; uniq -c &lt;span class="o"&gt;|&lt;/span&gt; sort -rn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Caveats
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This is my setup (a slow PC, 86 hooks). On a faster PC or with fewer hooks, I'd expect far fewer timeouts&lt;/li&gt;
&lt;li&gt;A successful run is only logged when the hook printed something, so the logs can't tell you whether a silent hook ran to the end every time&lt;/li&gt;
&lt;li&gt;Hook behavior can change between Claude Code versions. The logs cover v2.1.304 to v2.1.327, the fixes were checked on v2.1.327, and the docs were read on 2026-11-19&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://code.claude.com/docs/en/hooks" rel="noopener noreferrer"&gt;Hooks reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://code.claude.com/docs/en/hooks-guide" rel="noopener noreferrer"&gt;Automate actions with hooks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Japanese version: &lt;a href="https://qiita.com/ussu_ussu_ussu/items/2e2517c6a9fc30f805f4" rel="noopener noreferrer"&gt;Qiita&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>bash</category>
      <category>windows</category>
    </item>
    <item>
      <title>My Claude Code SessionStart hook sent 305k characters. Almost none of it reached the conversation (the cap is 10,000)</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Thu, 12 Nov 2026 11:41:14 +0000</pubDate>
      <link>https://dev.to/yasumorishima/my-claude-code-sessionstart-hook-sent-305k-characters-almost-none-of-it-reached-the-conversation-3202</link>
      <guid>https://dev.to/yasumorishima/my-claude-code-sessionstart-hook-sent-305k-characters-almost-none-of-it-reached-the-conversation-3202</guid>
      <description>&lt;p&gt;I run several projects in parallel with Claude Code, and for each one I keep a small file with "what to do next" (I call these files pickups). A SessionStart hook passed all of them to Claude at the start of every conversation.&lt;/p&gt;

&lt;p&gt;While cleaning up my PC, I measured how big the pickups had become: about 530 KB. I remembered that hooks have an output limit, so I looked into it.&lt;/p&gt;

&lt;p&gt;Short version: a hook can put at most 10,000 characters into the conversation, and my pickups were far beyond that, so almost none of them were reaching the start of the conversation. Here is how I checked it and how I fixed it.&lt;/p&gt;

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

&lt;p&gt;A SessionStart hook is a command that runs when a conversation starts. It prints JSON, and the string in &lt;code&gt;additionalContext&lt;/code&gt; goes into the conversation's context.&lt;/p&gt;

&lt;p&gt;The old hook simply concatenated the index and every pickup file (simplified):&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;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nv"&gt;DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$HOME/.claude/memory"&lt;/span&gt;
&lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;cat &lt;span class="s2"&gt;"$DIR/pickup-queue.md"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="nv"&gt;IFS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; -r -d &lt;span class="s1"&gt;''&lt;/span&gt; f&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$content"&lt;/span&gt;&lt;span class="s1"&gt;$'\n\n'&lt;/span&gt;&lt;span class="s2"&gt;"$(cat "&lt;/span&gt;&lt;span class="nv"&gt;$f&lt;/span&gt;&lt;span class="s2"&gt;")"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;find &lt;span class="s2"&gt;"$DIR/pickup-queue"&lt;/span&gt; -maxdepth 1 -type f -name &lt;span class="s1"&gt;'*.md'&lt;/span&gt; -print0 &lt;span class="o"&gt;|&lt;/span&gt; sort -z&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s'&lt;/span&gt; &lt;span class="s2"&gt;"$content"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; jq -Rsc &lt;span class="s1"&gt;'{
  hookSpecificOutput: {hookEventName: "SessionStart", additionalContext: .}
}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  305k characters sent, only the first 2,000 get in
&lt;/h2&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%2Ftnmfjaue2jhdifhfec9g.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%2Ftnmfjaue2jhdifhfec9g.png" alt="305k characters sent, only the first 2,000 get in" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The official hooks documentation says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A hook's &lt;code&gt;additionalContext&lt;/code&gt;, &lt;code&gt;systemMessage&lt;/code&gt;, and &lt;code&gt;initialUserMessage&lt;/code&gt; strings, and its plain stdout, are capped at 10,000 characters&lt;/p&gt;

&lt;p&gt;Claude Code saves the output to a file in the session directory. It replaces the output with the file path and a preview of up to the first 2,000 characters.&lt;/p&gt;

&lt;p&gt;Unlike that Bash ceiling, this cap has no setting or environment variable to raise it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So once a hook goes over 10,000 characters, the whole output is saved to a file, and the conversation only gets the file path and a preview of up to 2,000 characters. There is no setting to raise the cap.&lt;/p&gt;

&lt;p&gt;The full text my old hook tried to send (the index plus 35 pickup files) was 305,295 characters, counted in UTF-16 units. That is about 30 times the cap. The index comes first, so even the preview would only cover the start of the index, never any project's next step.&lt;/p&gt;

&lt;p&gt;When I looked back at the start of the conversation where I was doing this investigation, I could not find anything from the pickups, not even a preview. That does not match the documentation (which says a preview is included), and I have not looked into why.&lt;/p&gt;

&lt;h2&gt;
  
  
  Over the cap as far back as my records go (May)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5y514mh7sayhdb1ve7iw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5y514mh7sayhdb1ve7iw.gif" alt="Over 10k characters as far back as my records go" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To see how long this had been going on, I used the history of the git repository where I back up my settings. For each day I took the last commit and added up the index and pickup files in UTF-16 units:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log --format=&lt;span class="s1"&gt;'%h %ad'&lt;/span&gt; --date=short &lt;span class="o"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;'!seen[$2]++'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; sort -k2 &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; h d&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="nv"&gt;files&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;git ls-tree -r --name-only &lt;span class="s2"&gt;"$h"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
          grep -E &lt;span class="s1"&gt;'^memory/pickup-queue\.md$|^memory/pickup-queue/[^/]+\.md$'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;[&lt;/span&gt; -z &lt;span class="s2"&gt;"$files"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;continue&lt;/span&gt;
  &lt;span class="nv"&gt;chars&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt; f &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nv"&gt;$files&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; git show &lt;span class="s2"&gt;"$h:$f"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
          jq -Rs &lt;span class="s1"&gt;'explode | map(if . &amp;gt; 65535 then 2 else 1 end) | add'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"$d $chars"&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the first day with a backup (May 10) it was already 14,559 characters. Backups before July 7 contain only the index and one pickup file, which is why the chart jumps in July. After that it grew as I added projects, reaching 305,295 characters on November 12.&lt;/p&gt;

&lt;p&gt;I have not checked since when Claude Code's cap has been 10,000 characters. So I can't say "it never got through"; I can only say "it was over 10,000 characters for as long as I have records."&lt;/p&gt;

&lt;h2&gt;
  
  
  Check 1: count the hook's output in UTF-16
&lt;/h2&gt;

&lt;p&gt;I measured assuming the 10,000 is a JavaScript string length, that is, UTF-16 code units. The documentation does not state the unit, so this is my assumption. Emoji count as 2 in UTF-16, so the number is a bit larger than &lt;code&gt;jq&lt;/code&gt;'s &lt;code&gt;length&lt;/code&gt; (code points).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash ~/.claude/hooks/inject-pickup-queue.sh &lt;span class="o"&gt;|&lt;/span&gt;
  jq &lt;span class="s1"&gt;'.hookSpecificOutput.additionalContext
      | [length, (explode | map(if . &amp;gt; 65535 then 2 else 1 end) | add)]'&lt;/span&gt; -c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the time of writing, the old hook (30 pickup files) printed &lt;code&gt;[275902,276362]&lt;/code&gt;: 275,902 code points, 276,362 UTF-16 units.&lt;/p&gt;

&lt;p&gt;Something I learned along the way: Git Bash's &lt;code&gt;wc -m&lt;/code&gt; counts UTF-16 units (&lt;code&gt;printf 'a😀b' | wc -m&lt;/code&gt; gives 4). I first assumed it counted code points and had to redo the numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check 2: ask a fresh conversation what it can see
&lt;/h2&gt;

&lt;p&gt;Being under the cap does not prove the text actually gets in. I opened a fresh conversation with &lt;code&gt;claude -p&lt;/code&gt; and asked whether it could see the heading that should be at the top (translated from the Japanese prompt I actually used):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude -p &lt;span class="s2"&gt;"Is there a heading 'Pickup Queue' at the start of this conversation's context? \
If so, copy the first 3 lines starting with '- ' right after it. If not, answer only 'no'. \
Do not use any tools."&lt;/span&gt; --max-turns 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the fixed hook it answered yes and copied back the 3 lines the hook had printed. I did not run this check against the old hook.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: one line per project instead of the full text
&lt;/h2&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%2F1bgxheler24rxvuq74ke.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%2F1bgxheler24rxvuq74ke.png" alt="From the full text to one line per project" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What the start of a conversation needs is not the full text, but "which projects exist and what is next for each." So the hook now takes one line from each file.&lt;/p&gt;

&lt;p&gt;How the line is chosen:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first line containing "▶▶" (skipping lines marked as old)&lt;/li&gt;
&lt;li&gt;If that line is just a short heading (under 70 characters), append up to 2 following content lines, skipping headings, horizontal rules and lines marked done, and stopping at the next heading&lt;/li&gt;
&lt;li&gt;If there is no "▶▶", a line with "▶" or "⏳"; failing that, the frontmatter &lt;code&gt;description&lt;/code&gt;; failing that, the first body line&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lines are sorted by last modified time, newest first, so recently touched projects come first. The full text stays in each file, to be read when I actually work on that project.&lt;/p&gt;

&lt;p&gt;The output looks like this (made-up examples):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Pickup Queue (auto-injected summary)
One "next" line per project, newest first (lines are trimmed). ...

- garden-sensor (11-12): ▶▶ Next: find out why the soil moisture reading jumps at night by swapping the wiring
- recipe-site (11-10): ▶▶ Next: sort search results by rating instead of creation date
- photo-backup (10-21): ⏳ Remaining: check that the first sync finished after replacing the external disk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fitting is done in &lt;code&gt;jq&lt;/code&gt; (excerpt; &lt;code&gt;header&lt;/code&gt;, &lt;code&gt;footer&lt;/code&gt; and &lt;code&gt;$limit&lt;/code&gt; are defined elsewhere). It tries per-line lengths from 400 characters downward and uses the first one at which the whole output fits the limit, counted in UTF-16. If it still does not fit, it drops the oldest lines and notes how many were dropped.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def u16: explode | map(if . &amp;gt; 65535 then 2 else 1 end) | add // 0;
def cut($n): if length &amp;gt; $n then .[0:$n] + "…" else . end;
def render($items; $n): header + ($items | map("- " + .s + " (" + .d + "): " + (.t | cut($n))) | join("\n")) + footer;
def omitted($k): if $k &amp;gt; 0 then "\n- (" + ($k|tostring) + " more omitted to fit the cap)" else "" end;
def fit($items; $k): (render($items; 20) + omitted($k)) as $o
  | if ($o | u16) &amp;lt;= $limit or ($items | length) == 0 then $o else fit($items[:-1]; $k + 1) end;

(first((400, 320, 260, 220, 180, 150, 120, 90, 60, 40, 20) as $n
       | render($items; $n) | select(u16 &amp;lt;= $limit))
 // fit($items; 0))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I set the limit to 9,500 to leave a margin below 10,000. With 30 pickup files the output is now 8,314 UTF-16 units. It went from 35 files to 30 because I archived 5 finished projects while doing this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting commands per file came close to the 10 s timeout
&lt;/h2&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%2Fp1a8z4ccwc7ll85kvihn.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%2Fp1a8z4ccwc7ll85kvihn.png" alt="Starting commands per file came close to the 10 s timeout" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My first rewrite started &lt;code&gt;basename&lt;/code&gt;, &lt;code&gt;date&lt;/code&gt; (twice), &lt;code&gt;awk&lt;/code&gt; and &lt;code&gt;tr&lt;/code&gt; for every file. It took 8.5 seconds on my machine. When I had another Claude (Opus) review it, it pointed out that settings.json gives this hook a 10-second timeout. I have not tested what happens past the timeout, but that was cutting it close.&lt;/p&gt;

&lt;p&gt;Timing just that loop gave 7.1 seconds (median of 3 runs). That is 30 files × 5 commands = 150 process starts, about 47 ms each. The original "cat everything" version takes 2.6 seconds.&lt;/p&gt;

&lt;p&gt;So I changed it so the number of processes does not grow with the number of files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;find -printf&lt;/code&gt; gets the modification times and paths in one go&lt;/li&gt;
&lt;li&gt;one &lt;code&gt;gawk&lt;/code&gt; reads all files (&lt;code&gt;BEGINFILE&lt;/code&gt; / &lt;code&gt;ENDFILE&lt;/code&gt; / &lt;code&gt;nextfile&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;one &lt;code&gt;jq&lt;/code&gt; formats and fits the result
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mapfile -t META &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;find &lt;span class="s2"&gt;"$SECTIONS_DIR"&lt;/span&gt; -maxdepth 1 -type f -name &lt;span class="s1"&gt;'*.md'&lt;/span&gt; \
                      -printf &lt;span class="s1"&gt;'%T@\t%Tm-%Td\t%p\n'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; sort -t&lt;span class="s1"&gt;$'\t'&lt;/span&gt; -k1,1nr -k3,3&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;FILES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; m &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="s2"&gt;"${META[@]}"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; FILES+=&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"${m##*$'\t'}"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;

&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"${META[@]}"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nv"&gt;LC_ALL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;C.UTF-8 gawk &lt;span class="s1"&gt;'
  BEGINFILE {
    if (ERRNO != "") { done = 1; nextfile }   # skip a file that vanished after find
    ...
  }
  FILENAME == "-" { split($0, a, "\t"); day[a[3]] = a[2]; next }   # dates arrive on stdin
  ...
'&lt;/span&gt; - &lt;span class="s2"&gt;"${FILES[@]}"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; jq -Rsc &lt;span class="s1"&gt;'...'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That brought it down to 0.46 seconds (median of 3 runs).&lt;/p&gt;

&lt;p&gt;Three things I tripped over:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;code&gt;find -printf&lt;/code&gt;, &lt;code&gt;%TM&lt;/code&gt; is minutes, not month. Month is &lt;code&gt;%Tm&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Unless the locale is UTF-8, &lt;code&gt;gawk&lt;/code&gt;'s &lt;code&gt;length&lt;/code&gt; returns bytes ("あいう" gives 9).&lt;/li&gt;
&lt;li&gt;With a &lt;code&gt;BEGINFILE&lt;/code&gt; rule, &lt;code&gt;gawk&lt;/code&gt; stops when it cannot open a file and never reads the rest. If a file disappears between &lt;code&gt;find&lt;/code&gt; and &lt;code&gt;gawk&lt;/code&gt;, every project after it disappears too. Checking &lt;code&gt;ERRNO&lt;/code&gt; and skipping fixes that.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tests with planted inputs
&lt;/h2&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%2Fr9u5zllr2bjhw0si468a.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%2Fr9u5zllr2bjhw0si468a.png" alt="The original version passes only 7 of 24 tests" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The hook has 24 tests. Against the real pickups they check "finishes within 3 seconds", "at most 9,500 UTF-16 units" and "one line per file". The rest use planted inputs in a scratch directory:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;skips old "▶▶" lines / joins a heading-only line with what follows / stops at the next heading&lt;/li&gt;
&lt;li&gt;a body that starts with a &lt;code&gt;---&lt;/code&gt; rule is not mistaken for frontmatter / reads a folded &lt;code&gt;description: &amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;ignores &lt;code&gt;_archive/&lt;/code&gt; / sorts newest first&lt;/li&gt;
&lt;li&gt;bad limit values (&lt;code&gt;abc&lt;/code&gt;, &lt;code&gt;10&lt;/code&gt;, &lt;code&gt;-5&lt;/code&gt;, empty) do not produce empty output&lt;/li&gt;
&lt;li&gt;150 files with long, emoji-heavy lines still fit the cap, including the last-resort path (dropping the oldest)&lt;/li&gt;
&lt;li&gt;a file vanishing mid-run does not drop the files after it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also checked that the cap tests are not vacuous: without the cap, the planted 150 files produce about 79k characters. The original version passes only 7 of the 24 tests, and removing just the line that skips a vanished file makes 1 test fail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code hooks can put at most 10,000 characters into the conversation. Over that, the whole output goes to a file and the conversation gets at most the first 2,000 characters. There is no setting to raise it.&lt;/li&gt;
&lt;li&gt;My hook sent the full pickup text, which had grown to 305k characters, and it was over 10,000 characters as far back as my records go (May).&lt;/li&gt;
&lt;li&gt;Switching to one line per project, newest first, trimmed to fit in UTF-16, brought it to 8,314, and a fresh conversation confirmed it can see it.&lt;/li&gt;
&lt;li&gt;On Windows Git Bash, starting commands per file came close to the hook's 10-second timeout. One &lt;code&gt;find&lt;/code&gt;, one &lt;code&gt;gawk&lt;/code&gt; and one &lt;code&gt;jq&lt;/code&gt; take 0.46 seconds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a hook of yours feeds text into the conversation, measuring its output once tells you whether it is being cut off silently. I had never measured mine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Environment: Windows 11, Git Bash (GNU bash 5.2.37), gawk 5.0.0, jq 1.8.1, GNU findutils 4.10.0, Claude Code 2.1.322, Celeron N4500 (4 GB RAM)&lt;/li&gt;
&lt;li&gt;The cap: &lt;a href="https://code.claude.com/docs/en/hooks" rel="noopener noreferrer"&gt;Claude Code hooks documentation&lt;/a&gt; (original text checked on 2026-11-12)&lt;/li&gt;
&lt;li&gt;The history chart's counts are the sum of the index and pickup bodies, without the headings the hook adds.&lt;/li&gt;
&lt;li&gt;The documentation does not say whether the 10,000 is UTF-16 units or code points, so I fit to UTF-16, the larger of the two.&lt;/li&gt;
&lt;li&gt;In the real backup history, the paths had a folder named after the PC in front of them for part of the period, and I used those; the code above leaves that out.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>claude</category>
      <category>bash</category>
      <category>jq</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Reading Paper Baseball Scorebooks with Claude Code, and Checking Them with Arithmetic</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Sun, 08 Nov 2026 08:00:53 +0000</pubDate>
      <link>https://dev.to/yasumorishima/reading-paper-baseball-scorebooks-with-claude-code-and-checking-them-with-arithmetic-2f23</link>
      <guid>https://dev.to/yasumorishima/reading-paper-baseball-scorebooks-with-claude-code-and-checking-them-with-arithmetic-2f23</guid>
      <description>&lt;p&gt;The amateur baseball team I play for posts per-game stats on its website. The source is the paper scorebook kept during the game. Typing it in by hand after every game takes time, and it is easy to misread a mark. I wondered whether the photos could be read instead, and after trying a few things, Claude Code (model: Claude Opus 5.5) now reads the photos, checks them with arithmetic, and saves the stats.&lt;/p&gt;

&lt;p&gt;I opened up the procedure, a guide to the marks, and the code, in case they help anyone else who keeps or tallies scorebooks. I am not a scoring expert; this is what I learned reading my own team's books. The scorebooks here use the Japanese scoring system.&lt;/p&gt;

&lt;h2&gt;
  
  
  The overall flow
&lt;/h2&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%2Fkm0csdllacodash5zwe6.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%2Fkm0csdllacodash5zwe6.png" alt="From photos to saved stats" width="800" height="753"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A game has two sheets: one with our batting and one with theirs. Our batting stats come from our sheet. Our pitchers' stats (hits, strikeouts and walks allowed) are written as the opponent's batting, so they come from the opponent's sheet.&lt;/p&gt;

&lt;p&gt;The scorekeeper only pastes the photos with a one-line request such as "add the result for ", and answers the few questions the paper cannot settle. Claude Code does the rest: read, check, save, and look at the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  One cell is split into four zones, one per base
&lt;/h2&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%2Frn43mrmruebvo3gbfsq2.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%2Frn43mrmruebvo3gbfsq2.png" alt="How to read one cell" width="800" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each cell, where a lineup row meets an inning column, is one plate appearance. A small diamond is printed in the middle, and the four zones around it stand for the bases. The batter's result goes bottom right (first base); the top right, top left and bottom left (second, third, home) say how the runner got to that base.&lt;/p&gt;

&lt;p&gt;For example, &lt;code&gt;/8&lt;/code&gt; bottom right is a hit to center, &lt;code&gt;6-3&lt;/code&gt; is a groundout from short to first, and &lt;code&gt;B&lt;/code&gt; is a walk. &lt;code&gt;(5)&lt;/code&gt; in the second-base zone means "reached second during the No. 5 hitter's plate appearance", and &lt;code&gt;S&lt;/code&gt; means a stolen base. The roman numeral in the middle is the out number in the inning, written in the cell of the player who was out, even when a batter reached base and was put out later as a runner.&lt;/p&gt;

&lt;p&gt;Different scorekeepers write very differently. One writes the third out as IV or II; one skips the third out when a runner made it; one writes hits in red; one, when the team bats around and the inning's column runs out, carries on in the next column and renumbers the printed inning headers by hand. I collected what I met while transcribing 33 sheets cell by cell in a &lt;a href="https://github.com/yasumorishima/baseball-scorebook-ocr-docs/blob/main/notation.md" rel="noopener noreferrer"&gt;notation guide&lt;/a&gt; (Japanese).&lt;/p&gt;

&lt;h2&gt;
  
  
  Plate appearances = outs + runs + left on base, exactly
&lt;/h2&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%2Ften6wmaawyso66edwuzj.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%2Ften6wmaawyso66edwuzj.png" alt="Plate appearances equal outs plus runs plus left on base" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every plate appearance ends in exactly one of three ways: an out, a run, or stranded on base when the inning ends. (When an inning ends on a runner's out or when time runs out, the batter who was still at the plate does not get a plate appearance.) A batter who reached base and was later caught stealing or forced out counts as an out. So, per inning and per game, plate appearances equal outs + runs + left on base.&lt;/p&gt;

&lt;p&gt;The figure is a recent 6-inning game, called for time with two out in the bottom of the 6th. We had 28 plate appearances: 18 outs, 5 runs, 5 left on base. They had 25: 17 outs, 1 run, 7 left on base. In a game cut short, the outs are not 3 × innings, so you match against the outs you actually counted.&lt;/p&gt;

&lt;p&gt;The check is simply sorting each plate appearance by how it ended and counting.&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;# Plate appearances as read: (inning, lineup slot, how it ended), ending is "out" / "run" / "lob"
&lt;/span&gt;&lt;span class="n"&gt;pas&lt;/span&gt; &lt;span class="o"&gt;=&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="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;out&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;out&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&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="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;lob&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&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="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;out&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
       &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;out&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;lob&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;   &lt;span class="c1"&gt;# in practice, every PA in the game
&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;collections&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Counter&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;inning&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&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;p&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pas&lt;/span&gt;&lt;span class="p"&gt;}):&lt;/span&gt;
    &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Counter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pas&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;inning&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="n"&gt;inning&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;PA&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="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;= outs&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;out&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;+ runs&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;run&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;+ LOB&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;lob&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;I keep reading until this and the other checks agree: the line score adds up to the final score, the pitchers' runs allowed add up to the opponent's runs, and so on. In this game, the out number in the 5th-inning cell of the leadoff batter looked like III on the whole photo. Zoomed in, it was a II with serifs. Had it been III, the inning would have ended with him, and the No. 5 hitter's groundout later in the inning would have been a fourth out. When the shape of a mark is in doubt, arithmetic like this decides.&lt;/p&gt;

&lt;p&gt;The rest of the checks, and how to settle what the paper cannot (two players with the same surname, the inning a pitcher was replaced, innings pitched in a game called for time), are in the &lt;a href="https://github.com/yasumorishima/baseball-scorebook-ocr-docs/blob/main/stats-from-scorebook.md" rel="noopener noreferrer"&gt;stats guide&lt;/a&gt; (Japanese).&lt;/p&gt;

&lt;h2&gt;
  
  
  Over 90% per cell, but the line score is fully right on 25 of 33 sheets
&lt;/h2&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%2Fina4pmgdlvlrs717udzt.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%2Fina4pmgdlvlrs717udzt.png" alt="Per-cell accuracy is high, but the whole line score is right on 25 of 33 sheets" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This figure is why the checks and the scorekeeper's confirmation stay in the loop. I built a tool that reads the photos automatically (&lt;a href="https://github.com/yasumorishima/baseball-scorebook-reader" rel="noopener noreferrer"&gt;baseball-scorebook-reader&lt;/a&gt;) and measured it on 33 sheets that have reference transcriptions. It finds the grid with OpenCV, cuts out each inning column, asks Claude about each column (is there a plate appearance in each cell, what was the result, did the batter score), and assembles a batting line for each lineup slot.&lt;/p&gt;

&lt;p&gt;Per cell, "did the batter score" matched the transcription 99% of the time (913/923) and the plate-appearance result 91% (859/941). But one sheet has about 30 plate appearances, so a few misread cells are enough to throw off the line score. The whole line score matched on 25 of the 33 sheets.&lt;/p&gt;

&lt;p&gt;When the same photo is read twice, the cells where the two reads disagree are wrong 61% of the time (versus 6% where they agree). The tool shows those cells as "please check".&lt;/p&gt;

&lt;h2&gt;
  
  
  Given nothing, Claude matched my CV pipeline fed the true facts
&lt;/h2&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%2F4o7xmcmpiizfgty8sl00.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%2F4o7xmcmpiizfgty8sl00.png" alt="Claude given nothing matched the classic computer-vision pipeline given the true facts" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before Claude, I built a reader that uses no generative AI, on a Raspberry Pi 5. It subtracts a blank form to isolate the pencil, reads the marks in each base zone by their distance to templates, and solves them together with baseball rules: a runner's advance number can only be a batter who came up after him, one runner per base, no passing.&lt;/p&gt;

&lt;p&gt;On the 396 base-zone marks of the 33 sheets (such as the lineup number of the batter during whose plate appearance the runner advanced), the classic pipeline got 71% (283/396) with nothing given, and 92% (366/396) when given all the true facts (plate appearances, reaches and out numbers). Claude, given no examples and no answers for this comparison, got 93% (370/396). That run took 429 calls and cost about 3.8 US dollars.&lt;/p&gt;

&lt;p&gt;The reference transcriptions were originally made with Claude's help, so if both made the same misreading, agreement would be inflated. I therefore cut out 47 marks from the original photos, zoomed in and checked them, including the 21 where only Claude and the transcription agreed. All 21 matched what is written on the paper. The check also found 4 misreadings in the transcriptions.&lt;/p&gt;

&lt;p&gt;In case it helps anyone reading the notation or the solver, that code is open too (&lt;a href="https://github.com/yasumorishima/baseball-scorebook-reader/tree/main/cv" rel="noopener noreferrer"&gt;cv/&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  How I do it in Claude Code
&lt;/h2&gt;

&lt;p&gt;After each game I don't run the tool; I have Claude read the photos in a Claude Code session.&lt;/p&gt;

&lt;h3&gt;
  
  
  The steps live in a skill
&lt;/h3&gt;

&lt;p&gt;Claude Code lets you write a fixed procedure down as a "skill". Recording a game result is a skill, so every game goes in the same order without skipping anything: look up the opponent and venue from the schedule, then the result and line score, the scorebook images, batting and pitching stats, the checks and read-back, and finally the site. Once the session saved only the result and forgot the individual stats. Since then a hook (a check that runs automatically at a set point) stops the session from finishing if images were uploaded but no stats were saved. I also published a &lt;a href="https://github.com/yasumorishima/baseball-scorebook-ocr-docs/blob/main/claude-code/scorebook-stats/SKILL.md" rel="noopener noreferrer"&gt;skill template&lt;/a&gt; (Japanese) that any team can adapt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Zoom in before reading
&lt;/h3&gt;

&lt;p&gt;On the whole photo, small marks get misread. The photo is turned to landscape, and the lineup column and each inning column are cut out and enlarged 2–4× before Claude reads them.&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;PIL&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;

&lt;span class="n"&gt;im&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Image&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sheet.jpg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;rotate&lt;/span&gt;&lt;span class="p"&gt;(&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;expand&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# portrait photo -&amp;gt; landscape
&lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;im&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;crop&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1150&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1760&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;                   &lt;span class="c1"&gt;# just the 5th-inning column
&lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resize&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;col&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LANCZOS&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;inning5.png&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;h3&gt;
  
  
  Show a table, then write
&lt;/h3&gt;

&lt;p&gt;The readings go to the scorekeeper as a table. Only what the paper cannot settle, such as which of two players with the same surname it was, is asked through Claude Code's question prompt. After the go-ahead, the result, batting and pitching are written in one SQL statement, and the totals are read back and compared with the checks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;plate_appearances&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;at_bats&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;ab&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hits&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;walks_hbp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;bb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strikeouts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;game_player_batting&lt;/span&gt; &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;game_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;the game just saved&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;-- pa = 28, ab = 21, h = 3, bb = 7, k = 7 ... same as the checks?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The database key is not on the PC that runs Claude Code. It sits on a small server at home, and the scripts run there.&lt;/p&gt;

&lt;h3&gt;
  
  
  Corrections become rules
&lt;/h3&gt;

&lt;p&gt;When the scorekeeper corrects something, the rule goes into Claude Code's memory and the repository's instructions file (CLAUDE.md). This time, for example, I followed the official rule that a starter must pitch five innings to get the win, and gave the win to the reliever. The scorekeeper corrected me: "it's amateur ball, we don't use that minimum; the win goes to the starter." It is now written down as a team rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I opened up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/yasumorishima/baseball-scorebook-ocr-docs/blob/main/notation.md" rel="noopener noreferrer"&gt;Notation guide&lt;/a&gt; (Japanese): how to read a cell, how results and advances are written, and how scorekeepers differ&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/yasumorishima/baseball-scorebook-ocr-docs/blob/main/stats-from-scorebook.md" rel="noopener noreferrer"&gt;Stats guide&lt;/a&gt; (Japanese): the flow, the checks, how to settle what the paper cannot, the data model&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/yasumorishima/baseball-scorebook-ocr-docs/blob/main/claude-code/scorebook-stats/SKILL.md" rel="noopener noreferrer"&gt;Claude Code skill template&lt;/a&gt; (Japanese): edit the team rules and use it&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/yasumorishima/baseball-scorebook-reader" rel="noopener noreferrer"&gt;baseball-scorebook-reader&lt;/a&gt;: the Claude-based reader (&lt;code&gt;scorebook/&lt;/code&gt;) and the reader without generative AI (&lt;code&gt;cv/&lt;/code&gt;), MIT licensed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Player names in the transcriptions, the scorebook images, the actual stats and the database key are not public.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Within what I measured:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plate appearances equal outs + runs + left on base, exactly, which makes it a strong way to catch misreadings&lt;/li&gt;
&lt;li&gt;Read automatically, cells are over 90% right, but the whole line score is right on 25 of 33 sheets, so the checks and the scorekeeper's confirmation are still needed&lt;/li&gt;
&lt;li&gt;On base-zone marks, Claude given nothing read 93%, about the same as the CV pipeline I spent a long time on, given the true facts (92%)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many teams still keep paper scorebooks. I would be glad if these reading tips and checks save someone a little time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Terms&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plate appearance (PA): each time a batter comes to the plate. At-bats are PA minus walks, hit-by-pitches, sacrifices and similar&lt;/li&gt;
&lt;li&gt;Left on base (LOB): runners stranded when the inning ends&lt;/li&gt;
&lt;li&gt;Zone: one of the four quarters of a cell. Bottom right = first, top right = second, top left = third, bottom left = home&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conditions and caveats&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One printed form, written by a few scorekeepers of one team. Other forms and habits will give different results&lt;/li&gt;
&lt;li&gt;The tool's numbers are on the 33 development sheets (October 2026). Claude was given no examples or answers when reading, but the tool's design (how to crop, what to ask) was decided while looking at these 33 sheets&lt;/li&gt;
&lt;li&gt;The transcriptions were made with Claude's help; 47 marks were checked against the original photos&lt;/li&gt;
&lt;li&gt;The agree/disagree numbers come from reading the same photo a second time, and they move a little from run to run (line score 25 → 26 sheets)&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>baseball</category>
      <category>claude</category>
      <category>opencv</category>
      <category>python</category>
    </item>
    <item>
      <title>Two players, pick one on last season's numbers: how often is it right? MLB 2026, checked against rules fixed in advance</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Mon, 05 Oct 2026 10:09:48 +0000</pubDate>
      <link>https://dev.to/yasumorishima/two-players-pick-one-on-last-seasons-numbers-how-often-is-it-right-mlb-2026-checked-against-2bla</link>
      <guid>https://dev.to/yasumorishima/two-players-pick-one-on-last-seasons-numbers-how-often-is-it-right-mlb-2026-checked-against-2bla</guid>
      <description>&lt;p&gt;When players are compared, "his average was higher last year" or "his ERA was lower" often comes up first. There are also plenty of numbers that try to take the luck out of the results: xwOBA, FIP, K−BB% and so on. If one of two players has to be chosen, which of last season's numbers most often picks the one who does better the next season? I had long wondered about that.&lt;/p&gt;

&lt;p&gt;So I used public MLB data to repeat "pick one of two players on last season's numbers" hundreds of thousands of times, and counted how often each number picked right. For 2026, I wrote down the method and the reading rule and froze them in a repository before checking the result. I have no experience inside the game; this is just an analysis of public data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data and method
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Season stats for hitters and pitchers&lt;/strong&gt;: tables built from the MLB Stats API and Baseball Savant, 2015-2026. I used the player-season tables of my public &lt;a href="https://huggingface.co/datasets/yasumorishima/mlb-stats" rel="noopener noreferrer"&gt;Hugging Face dataset&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The method:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Take every player with at least 100 plate appearances (hitters) or 100 batters faced (pitchers) in both a season (year 1) and the next season (year 2)&lt;/li&gt;
&lt;li&gt;Pair up &lt;strong&gt;every two players&lt;/strong&gt; of the same season (pitchers only with the same role: starters with starters, relievers with relievers)&lt;/li&gt;
&lt;li&gt;Pick one of the two on a year-1 number: for hitters the higher one, for pitchers the lower ERA, FIP or xERA, or the higher K−BB%&lt;/li&gt;
&lt;li&gt;The pick is right if the picked player did better in year 2: higher wOBA for hitters, lower ERA for pitchers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A pair that a rule cannot split (equal year-1 numbers) counts as half right. A share of 50% means the rule does no better than a coin flip.&lt;/p&gt;

&lt;p&gt;Scoring the pairs looks like this in Python (simplified; the real code also filters the players and computes the intervals):&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;# x: year-1 number (oriented so that higher is better), y: year-2 result (higher is better)
&lt;/span&gt;&lt;span class="n"&gt;dx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:]&lt;/span&gt;          &lt;span class="c1"&gt;# year-1 difference for every pair
&lt;/span&gt;&lt;span class="n"&gt;dy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[:,&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:]&lt;/span&gt;          &lt;span class="c1"&gt;# year-2 difference for every pair
&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dx&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dx&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dy&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;   &lt;span class="c1"&gt;# right if the pick is also ahead in year 2
&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dy&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eye&lt;/span&gt;&lt;span class="p"&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;x&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;dtype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# drop year-2 ties and self-pairs
&lt;/span&gt;&lt;span class="n"&gt;share&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The numbers compared (definitions in the appendix):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hitters&lt;/strong&gt;: wOBA, xwOBA, wRC+, and a blend of five numbers (xwOBA carries the most weight)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pitchers&lt;/strong&gt;: ERA, FIP, xERA, K−BB%, and a blend of the four&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The blends were fitted only on pairs whose year 1 is 2015-2024 (year 2 up to 2025).&lt;/p&gt;

&lt;h3&gt;
  
  
  What was fixed in advance
&lt;/h3&gt;

&lt;p&gt;I built the method on 2015-2024 (dropping the seasons where year 1 or year 2 is the 60-game 2020), then &lt;strong&gt;picked on 2025 numbers and scored on 2026 results&lt;/strong&gt;. Before reading the 2026 results, I froze the rule in the repository: "for the 2025→2026 pairs, report each number's share picked right and its difference from the base number (wOBA for hitters, ERA for pitchers). If the whole 95% interval of the difference is above 0, the number picks right more often; if it is wholly below 0, it picks right less often; if it crosses 0, the two are indistinguishable." In fact the pitcher version was scored first; the hitter version was written in the same form and frozen after I had seen the pitcher result, then scored. The intervals come from 2,000 resamples of players with replacement. The same player sits in hundreds of pairs, so resampling pairs instead of players would make the intervals far too narrow.&lt;/p&gt;

&lt;p&gt;The 2026 test has 353 hitters (62,126 pairs) and 359 pitchers (32,122 pairs).&lt;/p&gt;

&lt;h2&gt;
  
  
  Hitters: last season's xwOBA picked right 65% of the time, wOBA 61%
&lt;/h2&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%2Fyc99k16vszzfhkdubzlk.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%2Fyc99k16vszzfhkdubzlk.png" alt="Hitters: last season's xwOBA picked right 65% of the time, wOBA 61%" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Picking on last season's wOBA was right 61.4% of the time. xwOBA was right 65.1% and the blend 65.4%. wRC+ was 61.6%, about the same as wOBA.&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%2Fhfvzguso7j5iysrtgvcc.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%2Fhfvzguso7j5iysrtgvcc.png" alt="Hitters: xwOBA and the blend beat wOBA. Pitchers: none separable from ERA" width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Against wOBA, xwOBA was +3.7 points (95% interval +1.3 to +6.1) and the blend +3.9 points (+1.9 to +6.1); both intervals are above 0, so by the rule fixed in advance both pick right more often than wOBA. wRC+ was +0.2 points (−0.3 to +0.6): indistinguishable.&lt;/p&gt;

&lt;p&gt;Note that wRC+ adjusts for park and league, while the outcome here (next season's wOBA) is not adjusted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pitchers: 56-58% whichever number, none separable from ERA
&lt;/h2&gt;

&lt;p&gt;Picking pitchers on last season's ERA was right 55.8% of the time. FIP was 57.1%, xERA 58.1%, K−BB% 58.4% and the blend 58.5%. All are a little above ERA, by 1.2 to 2.6 points, but every 95% interval of the difference crosses 0 (FIP −1.7 to +4.2, xERA −0.8 to +5.5, K−BB% −1.1 to +6.4, blend −1.0 to +6.5 points), so by the rule all four are indistinguishable from ERA.&lt;/p&gt;

&lt;p&gt;"Indistinguishable" does not mean "no difference". It means one season of pairs was not enough to tell a difference of this size apart.&lt;/p&gt;

&lt;h2&gt;
  
  
  2026 came out in roughly the same order as the development seasons
&lt;/h2&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%2F60ilt3qw4jbajypfbt5l.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%2F60ilt3qw4jbajypfbt5l.png" alt="2026 came out in roughly the same order as the development seasons" width="800" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here 2026 sits next to 2015-2024, the seasons the method was built on (486,143 hitter pairs, 259,065 pitcher pairs). White is that period, blue is 2026.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hitters' wOBA fell from 63.8% to 61.4%, while xwOBA barely moved (65.8% to 65.1%), so the gap widened in 2026 (+2.0 to +3.7 points)&lt;/li&gt;
&lt;li&gt;Pitchers' ERA was 55.8% both times. The other numbers were 0.9 to 1.6 points lower in 2026, so their gap to ERA shrank&lt;/li&gt;
&lt;li&gt;In 2015-2024, FIP, xERA and K−BB% did beat ERA for pitchers (+2.9 to +3.6 points, intervals clear of 0). The case that these numbers pick pitchers better than ERA rests on that period&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When wOBA and xwOBA disagree, xwOBA was right 59% of the time
&lt;/h2&gt;

&lt;p&gt;In most pairs every number picks the same player. The choice of number only matters in the pairs where two numbers point at different players, so here are those pairs alone.&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%2F3hghfj8yyw9g8owje7jm.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%2F3hghfj8yyw9g8owje7jm.png" alt="When wOBA and xwOBA disagree, xwOBA was right 59% of the time" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;wOBA and xwOBA pointed at different hitters in 12,195 of 62,126 pairs (about a fifth); xwOBA was right in 59% of them and wOBA in 41%. ERA and K−BB% pointed at different pitchers in 11,028 of 32,122 pairs (about a third); K−BB% was right in 54% and ERA in 46%. The 95% interval of the difference is +6.9 to +30.1 points for hitters (xwOBA minus wOBA, +18.7), clear of 0, but −3.2 to +18.9 for pitchers (K−BB% minus ERA, +7.4), which crosses 0: one season cannot separate them. In 2015-2024 the figures were 56% for xwOBA and 56% for K−BB%.&lt;/p&gt;

&lt;h3&gt;
  
  
  One pair at a time
&lt;/h3&gt;

&lt;p&gt;Here are a few pairs where the numbers disagree sharply.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hitters: Harrison Bader and Salvador Perez&lt;/strong&gt; (2025)&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;wOBA&lt;/th&gt;
&lt;th&gt;xwOBA&lt;/th&gt;
&lt;th&gt;PA&lt;/th&gt;
&lt;th&gt;2026 wOBA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Harrison Bader&lt;/td&gt;
&lt;td&gt;.346&lt;/td&gt;
&lt;td&gt;.297&lt;/td&gt;
&lt;td&gt;501&lt;/td&gt;
&lt;td&gt;.238&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Salvador Perez&lt;/td&gt;
&lt;td&gt;.311&lt;/td&gt;
&lt;td&gt;.357&lt;/td&gt;
&lt;td&gt;641&lt;/td&gt;
&lt;td&gt;.285&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;wOBA picks Bader, xwOBA picks Perez. Bader's results were .049 better than his quality of contact predicted, Perez's .046 worse. In 2026 Perez was ahead: xwOBA was right. Note, though, that Bader had only 111 PA in 2026.&lt;/p&gt;

&lt;p&gt;Nor is xwOBA always right. Pairing the same Perez with Jacob Wilson (2025 wOBA .348, xwOBA .304, 523 PA), Wilson had .301 in 2026 and Perez .285: wOBA was right.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pitchers: Brayan Bello and Dylan Cease&lt;/strong&gt; (2025, both starters)&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;ERA&lt;/th&gt;
&lt;th&gt;K−BB%&lt;/th&gt;
&lt;th&gt;FIP&lt;/th&gt;
&lt;th&gt;xERA&lt;/th&gt;
&lt;th&gt;Batters faced&lt;/th&gt;
&lt;th&gt;2026 ERA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Brayan Bello&lt;/td&gt;
&lt;td&gt;3.35&lt;/td&gt;
&lt;td&gt;9.3%&lt;/td&gt;
&lt;td&gt;4.19&lt;/td&gt;
&lt;td&gt;4.48&lt;/td&gt;
&lt;td&gt;700&lt;/td&gt;
&lt;td&gt;4.33&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dylan Cease&lt;/td&gt;
&lt;td&gt;4.55&lt;/td&gt;
&lt;td&gt;19.9%&lt;/td&gt;
&lt;td&gt;3.56&lt;/td&gt;
&lt;td&gt;3.46&lt;/td&gt;
&lt;td&gt;722&lt;/td&gt;
&lt;td&gt;2.40&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;ERA picks Bello, K−BB% picks Cease. Cease struck out many more than he walked yet had a 4.55 ERA; in 2026 his ERA was 2.40. K−BB% was right.&lt;/p&gt;

&lt;p&gt;On the other hand, with Clay Holmes (2025 ERA 3.53, K−BB% 8.9%) and Jack Flaherty (ERA 4.64, K−BB% 18.9%), Holmes had 3.29 in 2026 and Flaherty 4.48: ERA was right.&lt;/p&gt;

&lt;p&gt;Hand-picked pairs alone prove nothing, so here are all such pairs counted together. Among pitcher pairs where both faced 500+ batters and the one with the ERA lower by more than 1.00 was not the one with the K−BB% higher by more than 6 points, there were 38 pairs and K−BB% was right in 55% (21); with only 38 pairs, that cannot be told apart from a coin flip. Among hitter pairs where both had 500+ PA and the one with the wOBA higher by more than .025 was not the one with the xwOBA higher by more than .025, there were 56 pairs and xwOBA was right in 35 of them (62.5%). Both counts were made after the results were read, for reference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hitters picked on xwOBA had a next-season wOBA .019 higher, over all pairs
&lt;/h2&gt;

&lt;p&gt;The share picked right does not say how far apart the picked and the unpicked player end up the next season. Here is the mean next-season gap between the player picked and the one left (wrong picks count as negative).&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%2F3rfpyqxkq4zrtgh29pcx.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%2F3rfpyqxkq4zrtgh29pcx.png" alt="Hitters picked on xwOBA had a next-season wOBA .019 higher, over all pairs" width="799" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For hitters, picking on wOBA gave a next-season wOBA .014 higher on average, xwOBA .019. For pitchers, picking on ERA gave a next-season ERA 0.23 lower, K−BB% 0.37 lower. In both cases picking on xwOBA or K−BB% gives the bigger gap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Hitters: xwOBA takes out the luck on batted balls
&lt;/h3&gt;

&lt;p&gt;wOBA is computed from the actual result of each plate appearance. xwOBA replaces each batted ball with the value expected mostly from its exit velocity and launch angle. The difference between the two contains batted-ball luck: whether the same ball goes straight to a fielder or finds a gap.&lt;/p&gt;

&lt;p&gt;In my &lt;a href="https://dev.to/yasumorishima/does-a-pitchs-performance-carry-over-to-next-season-whiff-rate-vs-run-value-on-8022-mlb-pairs-bj"&gt;previous article&lt;/a&gt; on pitch-level results, batted-ball luck hardly carried over to the next season either. For hitters too, plotting last season's wOBA and xwOBA against next season's wOBA, xwOBA gives the clearer upward slope.&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%2Fn8w7ytc5v4nk92kudmpg.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%2Fn8w7ytc5v4nk92kudmpg.png" alt="Last season's xwOBA tracks next season's wOBA more closely" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Over the 353 hitters of the 2026 test, the correlation with next season's wOBA is 0.32 for wOBA and 0.42 for xwOBA.&lt;/p&gt;

&lt;h3&gt;
  
  
  How hard the outcome itself is: same-season numbers get about 80%
&lt;/h3&gt;

&lt;p&gt;To see why the numbers were harder to tell apart for pitchers, I measured how hard the outcome itself is to pick. What if the 2026 ERA is picked using the &lt;strong&gt;same season's&lt;/strong&gt; 2026 FIP? Same pairs, same scoring as the picks on last season's numbers. It is a reference value that could never be used in practice, and it is not part of the method fixed in advance.&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%2F14z0kx3q0so7w7zn9yx2.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%2F14z0kx3q0so7w7zn9yx2.png" alt="Same-season numbers picked right about 80% of the time (reference)" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even knowing the same season's FIP, the lower ERA was picked 77% of the time (xERA 76%, K−BB% 67%). For hitters, the same season's xwOBA picked the higher wOBA 82% of the time. Even with same-season numbers, around a fifth of pairs come out the other way. For hitters, xwOBA and wOBA differ only in the results of batted balls (out, single, extra-base hit), so that is where the reversals come from. For pitchers, ERA also depends on whether hits come with runners on and on the fielders behind them, which FIP leaves out.&lt;/p&gt;

&lt;p&gt;Picking on last season's numbers, hitters land 11 points (wOBA) or 15 points (xwOBA) above a coin flip, pitchers 6 points (ERA) or 8 points (K−BB%). For pitchers no number gets far from a coin flip, and the numbers differ from each other by only 1 to 3 points. One season's intervals are ±3 to 4 points wide, too wide to separate gaps of that size. Pooling the eight seasons of 2015-2024 narrows the intervals to about ±1 point, and gaps of the same size then clear 0.&lt;/p&gt;

&lt;h3&gt;
  
  
  By plate appearances, xwOBA had the higher share in every band
&lt;/h3&gt;

&lt;p&gt;I split the pairs into three bands by the smaller of the two hitters' 2025 PA. The pre-registration lists this as reported only, not used for conclusions.&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%2Fol9hwhi7jkkp0p7k7qvm.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%2Fol9hwhi7jkkp0p7k7qvm.png" alt="In every PA band, xwOBA had the higher share picked right (reported only)" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;xwOBA had the higher share in every band, but in the 500+ PA band the interval of the difference crosses 0 (−1.8 to +7.2 points). In 2015-2024 too, the 500+ band had a small gap between xwOBA and wOBA (0.7 points) with an interval crossing 0.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Picking one of two hitters on last season's numbers, xwOBA was right 65% of the time in 2026 and wOBA 61%, and the gap held up on one season alone. wRC+ did about as well as wOBA&lt;/li&gt;
&lt;li&gt;Picking one of two pitchers, ERA, FIP, xERA, K−BB% and the blend were all right 56-58% of the time, and 2026 alone could not separate them from ERA. In 2015-2024 the numbers other than ERA did pick better&lt;/li&gt;
&lt;li&gt;Where wOBA and xwOBA point at different hitters, xwOBA was right 59% of the time. For pitchers, K−BB% was right 54% against ERA, which one season cannot separate&lt;/li&gt;
&lt;li&gt;For reference, even same-season FIP or xwOBA picks right about 80% of the time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What surprised me most is that picking the player with the better number last season is still wrong about 4 times in 10. For hitters, picking on xwOBA was right more often than picking on wOBA, and that is the clearest result here. For pitchers one season says little, and I would like to keep checking it for a few more seasons.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Terms
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;wOBA&lt;/strong&gt;: an overall batting measure that weights each plate-appearance outcome (walk, single, home run, ...) by its run value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;xwOBA&lt;/strong&gt;: wOBA with each batted ball replaced by the value expected mostly from its exit velocity and launch angle (sprint speed is also used for some weakly hit balls)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;wRC+&lt;/strong&gt;: batting run contribution adjusted for park and league, with league average = 100&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ERA&lt;/strong&gt;: earned runs per nine innings&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FIP&lt;/strong&gt;: a pitcher's expected run allowance from strikeouts, walks, hit-by-pitches and home runs only&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;xERA&lt;/strong&gt;: an ERA estimate from the exit velocity and launch angle of the batted balls a pitcher allowed, plus strikeouts, walks and hit-by-pitches&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;K−BB%&lt;/strong&gt;: strikeouts minus walks, as a share of batters faced&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blend&lt;/strong&gt;: a combination of year-1 numbers fitted on 2015-2024 to predict year 2. Hitters: wOBA, xwOBA, strikeout rate, walk rate and ISO (slugging minus average). Pitchers: ERA, FIP, xERA and K−BB%. In the hitter blend xwOBA carries the most weight (about 60% by coefficient times standard deviation) and wOBA almost none&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Caveats
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Only players with 100+ PA (batters faced) in year 2 are counted. Players whose playing time dropped after a bad season drop out, so this compares players who kept playing. With a 50 bar in year 2, the hitters' order is the same; for pitchers xERA and K−BB% swap places (58.9% and 58.8%)&lt;/li&gt;
&lt;li&gt;A pitcher is a starter if at least half of his year-1 games were starts, otherwise a reliever; only same-role pairs are formed&lt;/li&gt;
&lt;li&gt;Pairs a rule cannot split count as half right; pairs with equal year-2 results are not counted&lt;/li&gt;
&lt;li&gt;The same player appears in hundreds of pairs, so tens of thousands of pairs do not carry that much information; the intervals resample players&lt;/li&gt;
&lt;li&gt;The strong-disagreement counts (500+ PA or batters faced, an ERA gap of more than 1.00, and so on) and the same-season reference values were computed after the results were read and are not part of the method fixed in advance&lt;/li&gt;
&lt;li&gt;Fielding, baserunning, park, age, health and contracts are not included. Choosing real players involves a lot more than this&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Reproducing
&lt;/h3&gt;

&lt;p&gt;All code, the rules fixed in advance and the results are in &lt;a href="https://github.com/yasumorishima/mlb-data-pipeline" rel="noopener noreferrer"&gt;mlb-data-pipeline&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/yasumorishima/mlb-data-pipeline/tree/master/analysis/decision_pairs_batters" rel="noopener noreferrer"&gt;&lt;code&gt;analysis/decision_pairs_batters/&lt;/code&gt;&lt;/a&gt;: hitters (&lt;code&gt;PREREG.md&lt;/code&gt; is the rule fixed in advance, &lt;code&gt;RESULTS.md&lt;/code&gt; the result)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/yasumorishima/mlb-data-pipeline/tree/master/analysis/decision_pairs" rel="noopener noreferrer"&gt;&lt;code&gt;analysis/decision_pairs/&lt;/code&gt;&lt;/a&gt;: pitchers (same). &lt;code&gt;article_dig.py&lt;/code&gt; computes the extra numbers for this article and &lt;code&gt;article_figs.py&lt;/code&gt; draws the charts&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>baseball</category>
      <category>datascience</category>
      <category>python</category>
      <category>statistics</category>
    </item>
    <item>
      <title>How well do player projections predict team wins? I froze MLB 2026 first, then checked</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Sun, 04 Oct 2026 23:53:04 +0000</pubDate>
      <link>https://dev.to/yasumorishima/how-well-do-player-projections-predict-team-wins-i-froze-mlb-2026-first-then-checked-3ih1</link>
      <guid>https://dev.to/yasumorishima/how-well-do-player-projections-predict-team-wins-i-froze-mlb-2026-first-then-checked-3ih1</guid>
      <description>&lt;p&gt;Every spring there are plenty of "how many games will each team win" projections. Most of them build a forecast for each player and add the players up by team. I had long wondered how well that actually works.&lt;/p&gt;

&lt;p&gt;So I built one of my own and checked it against the 2026 MLB season. I froze the projections in a repository before looking at the results, so nothing could be adjusted afterwards. I have no experience inside the game; this is just an analysis of public data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data and method
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Player stats&lt;/strong&gt;: batting and pitching from the MLB Stats API, 2015-2026, every player&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rosters&lt;/strong&gt;: each team's &lt;strong&gt;40-man roster on opening day&lt;/strong&gt; (including the 60-day injured list), from the same API (only what is known before the season)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The answer&lt;/strong&gt;: final standings (wins, runs scored, runs allowed) from the same API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The player forecasts are based on &lt;strong&gt;Marcel&lt;/strong&gt;, a deliberately simple method by Tom Tango: weight the last three seasons (newer ones more), pull the result toward league average, and adjust a little for age. It is often used as the baseline other systems are compared with. The real Marcel projects each component (home runs, walks, strikeouts, ...) separately; mine is a simplified version that applies its weights, regression, playing time and age factor to wOBA and FIP directly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Batters&lt;/strong&gt;: wOBA relative to league average, three seasons weighted 5:4:3, regressed with 1,200 PA of league average&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pitchers&lt;/strong&gt;: FIP relative to league average, weighted 3:2:1, regressed with 134 innings of league average&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Playing time&lt;/strong&gt;: half of last season plus a tenth of the season before, plus 200 PA for batters and 60 innings (starters) or 25 (relievers) for pitchers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Team&lt;/strong&gt;: add up the opening-day 40-man roster into runs scored and allowed, then turn them into wins with the Pythagorean formula&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For one batter it looks like this in Python (simplified; the real code also adjusts for age and makes league runs scored and allowed match):&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;# h: the player's last three seasons, one row per season
# rel = that season's wOBA minus that season's league wOBA
&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;season&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="n"&gt;y&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="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;rel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pa&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rel&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="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pa&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="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# pull toward league average
&lt;/span&gt;&lt;span class="n"&gt;pa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;pa_last&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;pa_before&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;                    &lt;span class="c1"&gt;# playing time
&lt;/span&gt;&lt;span class="n"&gt;runs_above_avg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pa&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;rel&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;woba_scale&lt;/span&gt;                         &lt;span class="c1"&gt;# runs above an average hitter
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A team's runs scored are league-average runs plus the sum of its players' runs above average; runs allowed are built the same way from the pitchers. Plate appearances and innings are scaled so each team gets 162 games' worth.&lt;/p&gt;

&lt;p&gt;To have something to beat, I used three floors that take no work at all:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every team .500&lt;/strong&gt;: 81 wins each&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Last season's record&lt;/strong&gt;: the same winning percentage as last year&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Last season's Pythagenpat&lt;/strong&gt;: last year's winning percentage implied by its runs scored and allowed (Pythagenpat is a version of the Pythagorean formula)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If adding up player forecasts is worth the effort, it should at least beat these three. The yardstick is the mean absolute error of wins over the 30 teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  Over nine past seasons, it beat last season's Pythagenpat in seven
&lt;/h2&gt;

&lt;p&gt;Before 2026 I ran the same thing on the nine seasons 2016-2025 (leaving out the 60-game 2020), projecting each season only from the seasons before it and taking the mean error over its 30 teams.&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%2Fl649xemseyqmmq4zrw1t.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%2Fl649xemseyqmmq4zrw1t.png" alt="Lower error than last season's Pythagenpat in 7 of 9 seasons" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The average over the nine seasons was &lt;strong&gt;8.27 wins&lt;/strong&gt;, against 10.60 for .500, 9.67 for last season's record and 9.34 for last season's Pythagenpat. It beat the toughest floor, Pythagenpat, in 7 of 9 seasons (not in 2019 or 2025).&lt;/p&gt;

&lt;p&gt;These nine seasons, though, are the ones I was looking at while making design choices, so they may flatter the method. Against Pythagenpat, the 95% bootstrap interval (resampling seasons) only just cleared zero, with an upper end of -0.01 to -0.05 depending on the random seed.&lt;/p&gt;

&lt;h2&gt;
  
  
  In 2026 it was slightly better than the floors, but not distinguishably
&lt;/h2&gt;

&lt;p&gt;For 2026 I wrote the projections to a file and merged them into the repository, together with the scoring rules, before fetching the standings. I froze them after the season had ended, but the projections only use information from before opening day; the point is that the method cannot be adjusted to fit the result. At scoring time I checked that the frozen files had not changed by a byte.&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%2Fcaqtifixhgfnnhe742mw.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%2Fcaqtifixhgfnnhe742mw.png" alt="2026: lower error than the floors, but not distinguishably" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The mean error was &lt;strong&gt;7.92 wins&lt;/strong&gt;, a little below all three floors. But the 95% intervals from resampling the 30 teams cross zero for every floor (against Pythagenpat: -0.80 wins, -2.82 to +1.36). By the rule set in advance, that is "indistinguishable".&lt;/p&gt;

&lt;p&gt;A version that stretches the projections away from .500 by a factor of 1.25 (fitted on the past seasons) did slightly worse in 2026, at 8.16.&lt;/p&gt;

&lt;h2&gt;
  
  
  The big misses were MIL, TB, SF and ATH
&lt;/h2&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%2Fxm4rzhjcg8cbpg916zut.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%2Fxm4rzhjcg8cbpg916zut.png" alt="The big misses were MIL, TB, SF and ATH" width="800" height="740"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Projected wins across, actual wins up; the closer to the dashed line, the better. MIL was projected for 84 and won 103, TB 80 and 98, SF 83 and 65, ATH 80 and 64. The correlation of projected and actual wins was 0.48 (0.63 over the nine past seasons).&lt;/p&gt;

&lt;h2&gt;
  
  
  The projections spread half as wide as the results
&lt;/h2&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%2F8m3wz53qx8y2hvl7vr23.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%2F8m3wz53qx8y2hvl7vr23.png" alt="The projections spread half as wide as the results" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 30 projected and actual win totals on one line: the projections sit between 67 and 93 wins, while the actual records ran from 58 to 103. Marcel pulls every player toward league average, so the teams built from them are pulled toward .500 too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Even with the actual runs, about 4 wins of error remain
&lt;/h2&gt;

&lt;p&gt;A miss splits into two parts: the runs scored and allowed were projected wrong, or the team won more or fewer games than its runs suggest. The second part comes from things like close games, and no player forecast can remove it. So I asked how well the Pythagorean formula does if the actual runs scored and allowed were known.&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%2Fmd5c9u9t3qu1j5a5466x.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%2Fmd5c9u9t3qu1j5a5466x.png" alt="Even with the actual runs, about 4 wins of error remain" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the actual runs, the average miss is still &lt;strong&gt;3.94 wins&lt;/strong&gt;. The gap between the projected wins and the wins implied by the actual runs, which is the runs projection being off, averages 8.06 (runs scored were off by a standard deviation of 56, runs allowed by 68).&lt;/p&gt;

&lt;h2&gt;
  
  
  What the miss is made of differs by team
&lt;/h2&gt;

&lt;p&gt;For the four big misses, I split the miss into those two parts. Blue is the runs projection (projected wins minus wins implied by actual runs), gray is record versus runs (wins implied by actual runs minus actual wins); together they make the miss.&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%2Fpmt7vja8igbof4ol615h.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%2Fpmt7vja8igbof4ol615h.png" alt="What the miss is made of differs by team" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Almost all of MIL's 19-win miss came from runs. TB's 10 wins from runs were topped up by 8 wins of beating its runs. ATH's runs projection was off by 21 wins, but it won 5 more than its runs suggest, shrinking the miss to 16. SF's 11 wins from runs were compounded by losing 6 more than its runs suggest.&lt;/p&gt;

&lt;h2&gt;
  
  
  MIL had two projected players beat their forecasts by 30+ runs
&lt;/h2&gt;

&lt;p&gt;I split MIL, the biggest miss, by player: how many runs above average each was projected to add (or save), against what they did. Batters use wOBA and pitchers FIP, converted to runs the same way as in the projection. Projected PA and innings are after scaling the roster to 162 games. Only players on the opening-day 40-man roster with a projection are shown.&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%2F73p8k6c4p9pehhpwiyfg.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%2F73p8k6c4p9pehhpwiyfg.png" alt="MIL: two projected players beat their forecast by 30+ runs" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Jacob Misiorowski (pitcher) was projected for 97 innings and about 5 runs saved; he threw 169 innings and saved about 38. With few innings behind him, his forecast was pulled hard toward average and his innings were estimated low. Jake Bauers (batter) was projected for 309 PA at about league average and had 574 PA and about 31 runs above average. Better rates and more playing time both played a part.&lt;/p&gt;

&lt;h2&gt;
  
  
  Still, the projected players beating their forecasts explain only 40% of MIL's run gap
&lt;/h2&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%2F7s31mr11yad8a7qtfenv.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%2F7s31mr11yad8a7qtfenv.png" alt="MIL: projected players beating their forecasts explain 40% of the run gap" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;MIL scored 93 more runs than projected and allowed 96 fewer, about 190 runs in all. The projected batters beating their forecasts (+19 projected, +71 actual) account for 52 of them, the projected pitchers (by FIP, +46 to +70) for 24: about 40% together. The other 60% includes fielding, baserunning and batted-ball outcomes that FIP and wOBA do not see, and players without a projection; pitchers with no forecast threw 33% of MIL's innings.&lt;/p&gt;

&lt;h2&gt;
  
  
  20-30% of playing time went to players with no forecast
&lt;/h2&gt;

&lt;p&gt;The players without a projection are those not on the opening-day 40-man roster and rookies with no MLB history. I took their share of all 2026 plate appearances and innings.&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%2F6x0zcswyaf1fl4zoes4q.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%2F6x0zcswyaf1fl4zoes4q.png" alt="20-30% of playing time went to players with no forecast" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They took 20% of plate appearances and 27% of innings. The projection assumes the projected players fill that time in proportion. Across the 30 teams, though, the correlation between a team's miss and its unprojected players' total WAR was a weak -0.27, with no clear link to the big misses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Adding up player forecasts beat the floors over nine past seasons, but in the frozen 2026 test its mean error of 7.92 wins could not be told apart from the floors (8.50 to 8.83).&lt;/li&gt;
&lt;li&gt;Even with the actual runs, about 4 wins of error remain. The runs projections alone miss by about 8 wins on average, partly offset for some teams by winning more or fewer games than their runs suggest. The projections cluster toward .500 and spread half as wide as the results.&lt;/li&gt;
&lt;li&gt;In the biggest miss, MIL, projected players beating their forecasts explain about 40% of the run gap; the rest includes fielding, baserunning and unprojected players.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What surprised me most is that a gap of under one win cannot be seen in one season. A method can win over past seasons and still not show it in a single year of scoring, so comparing projection systems probably takes several years side by side. If I change anything next, it will be how rookies and new arrivals are handled, again frozen in advance, for 2027.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Terms
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;wOBA&lt;/strong&gt;: a batting rate that weights each outcome (walk, single, home run, ...) by its run value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FIP&lt;/strong&gt;: a pitcher's run estimate from strikeouts, walks, hit batters and home runs only, leaving out whether balls in play fall for hits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Marcel&lt;/strong&gt;: Tom Tango's simple projection: a weighted average of three seasons, regressed toward average, with an age adjustment (applied here directly to wOBA and FIP)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pythagenpat&lt;/strong&gt;: the Pythagorean win formula with an exponent that depends on the run environment, ((runs scored + allowed) per game)^0.287&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Also checked
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Do young teams beat their projection?&lt;/strong&gt; MIL made it look as if teams whose young players improve should beat their projections. Over 300 team-seasons (the nine past seasons and 2026), the correlation between the age of a team's projected batters (weighted by projected PA, relative to that season's average) and its miss was -0.01. Split into age quartiles, the average miss ranged from -0.7 to +1.6 wins with no order.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Caveats
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No fielding, park or schedule. Runs allowed come from FIP only, so defence is not in it.&lt;/li&gt;
&lt;li&gt;Opening-day 40-man rosters include players on the injured list or in the minors that day, so playing time is spread over more players than actually played.&lt;/li&gt;
&lt;li&gt;Shohei Ohtani is listed as a pitcher on the 2018-2019 rosters, so his batting is missing from the 2019 backtest (he is a two-way player from 2020 on).&lt;/li&gt;
&lt;li&gt;The interval for one season of 30 teams ignores that teams share league-wide trends, so it is narrower than it should be.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Reproducing it
&lt;/h3&gt;

&lt;p&gt;Code, the frozen projections and the scoring rules are in &lt;a href="https://github.com/yasumorishima/mlb-data-pipeline/tree/master/forecast/team_wins" rel="noopener noreferrer"&gt;mlb-data-pipeline, forecast/team_wins&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;fetch.py&lt;/code&gt;: opening-day 40-man rosters and standings from the MLB Stats API&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;project.py&lt;/code&gt;: Marcel forecasts and team wins&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;score.py&lt;/code&gt;: floors and scoring&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PREREG.md&lt;/code&gt;: the scoring rules written before the answer was known&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;RESULTS.md&lt;/code&gt;: the 2026 result&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>baseball</category>
      <category>datascience</category>
      <category>python</category>
      <category>statistics</category>
    </item>
    <item>
      <title>Asking a Decision-Only AI (TypeSafe Jev) to Forecast Next Season's Hitting: Worth About 20 to 50 Training Examples</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Wed, 30 Sep 2026 10:24:22 +0000</pubDate>
      <link>https://dev.to/yasumorishima/asking-a-decision-only-ai-typesafe-jev-to-forecast-next-seasons-hitting-worth-about-20-to-50-360k</link>
      <guid>https://dev.to/yasumorishima/asking-a-decision-only-ai-typesafe-jev-to-forecast-next-seasons-hitting-worth-about-20-to-50-360k</guid>
      <description>&lt;p&gt;&lt;a href="https://docs.typesafe.ai" rel="noopener noreferrer"&gt;TypeSafe Jev&lt;/a&gt; is a decision-only model: it does not write text, it returns typed answers with probabilities. You can ask for a yes/no probability (Noul), probabilities over choices (Choice) or over ordered levels (Score).&lt;/p&gt;

&lt;p&gt;If it answers with probabilities, could it help with baseball's "what happens next year" questions? I wanted to know how often it is right and where it goes wrong, so I tried it on public MLB data. I have no experience working in baseball; I just tallied up public data.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to call Jev
&lt;/h2&gt;

&lt;p&gt;Jev is available through OpenRouter. All 697 calls used for evaluation in the two studies below fit in a new account's free allowance (no card, balance left at $0; the costs returned by the API add up to about $0.019 = 0.0107 + 0.0080).&lt;/p&gt;

&lt;p&gt;A call sends a &lt;code&gt;state&lt;/code&gt; describing the situation and typed &lt;code&gt;questions&lt;/code&gt;:&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="n"&gt;body&lt;/span&gt; &lt;span class="o"&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;model&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;typesafe/jev-1.13&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;state&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&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;context&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;An anonymous MLB hitter&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s 2025 regular season. ...&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;wOBA&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.315&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;xwOBA&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.33&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;strikeout_rate_pct&lt;/span&gt;&lt;span class="sh"&gt;"&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="c1"&gt;# excerpt
&lt;/span&gt;    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;questions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&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;delta_bin&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&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;type&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;score&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;instructions&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;How will this hitter&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s wOBA in 2026 compare with his 2025 wOBA?&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;criteria&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&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;Big drop: ...&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;Small drop: ...&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;About the same: ...&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;Small rise: ...&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;Big rise: ...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]},&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://openrouter.ai/api/alpha/decisions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                             &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&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;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;POST&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                             &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&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;Authorization&lt;/span&gt;&lt;span class="sh"&gt;"&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;Bearer &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;key&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Content-Type&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;application/json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&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;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;probs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;answers&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;delta_bin&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;probabilities&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="nf"&gt;str&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="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="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What comes back is only the probabilities, like &lt;code&gt;{"0": 0.02, "1": 0.32, ...}&lt;/code&gt;, with no explanation.&lt;/p&gt;

&lt;p&gt;Code, pre-registrations and every Jev answer are in &lt;a href="https://github.com/yasumorishima/jev-baseball" rel="noopener noreferrer"&gt;yasumorishima/jev-baseball&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  First study: will an ABS challenge be overturned?
&lt;/h2&gt;

&lt;p&gt;I first asked whether an ABS challenge (a player disputing a ball/strike call) would be overturned. Every challenge has a known answer, so the probabilities are easy to score.&lt;/p&gt;

&lt;h3&gt;
  
  
  Building the data
&lt;/h3&gt;

&lt;p&gt;In MLB StatsAPI game feeds (&lt;code&gt;feed/live&lt;/code&gt;), a challenged pitch carries &lt;code&gt;reviewDetails&lt;/code&gt;. From 777 games in August and September 2026 I extracted 2,678 pitch challenges (&lt;code&gt;reviewType == "MJ"&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Two things needed care:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The pitch's &lt;code&gt;details.call.description&lt;/code&gt; is the call &lt;strong&gt;after&lt;/strong&gt; the review. Using it would leak the answer, so the original call comes from who challenged (the batting side challenges strikes, the fielding side challenges balls).&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;count&lt;/code&gt; on a pitch is the count &lt;strong&gt;after&lt;/strong&gt; that pitch. The count before it comes from the previous pitch.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A gap I found later.&lt;/strong&gt; While re-collecting a full season for another article, I found that when the final call ends the plate appearance (a called strike three or ball four), &lt;code&gt;reviewDetails&lt;/code&gt; sits on the &lt;strong&gt;play&lt;/strong&gt;, not on the pitch. This study read only the pitch, so of the 3,543 challenges from August 1 to September 27 collected again, 893 (25%) were missing (the 2,650 it did capture differ slightly from the original 2,678 because they were collected at different times). The missing ones were overturned 48.6% of the time, against 56.8% for the captured ones.&lt;/p&gt;

&lt;p&gt;All 250 challenges put to Jev came from the captured part, so this section describes challenges where the plate appearance went on. Refitting the distance-only formula on all of August and scoring all of September (1,650) gives a Brier score of 0.102. On the captured September challenges (1,238), the original formula scores 0.1121 and the refitted one 0.1123, nearly the same. The two sets differ, so 0.102 and 0.112 cannot be compared directly, but using every challenge did not make the formula worse. I did not ask Jev again (the free allowance is spent), so Jev's numbers cover only the captured part.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The distance to the zone depends on whether the ball's surface touches the zone, so it is "distance from the zone rectangle to the ball's center, minus the ball's radius" (which gives the zone rounded corners):&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;edge_in&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Inches from the ball&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s surface to the zone; + misses, - touches.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;x0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;17&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;                     &lt;span class="c1"&gt;# half the plate width (feet)
&lt;/span&gt;    &lt;span class="n"&gt;dx&lt;/span&gt; &lt;span class="o"&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;x0&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;dz&lt;/span&gt; &lt;span class="o"&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;bot&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;pz&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pz&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;top&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;dx&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;dz&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;d0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hypot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dz&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;d0&lt;/span&gt; &lt;span class="o"&gt;=&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;px&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;x0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pz&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;pz&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d0&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;1.45&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;                    &lt;span class="c1"&gt;# minus the 1.45-inch ball radius
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I asked Jev about 250 challenges from September and compared it with a logistic regression on a single input, "inches on the wrong side of the original call", fitted on 1,431 August challenges. Jev was given the coordinates and zone top and bottom, plus this distance precomputed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Result: the distance-only formula wins easily
&lt;/h3&gt;

&lt;p&gt;The Brier score (mean squared gap between the probability and the 0/1 outcome; lower is better) was &lt;strong&gt;0.113 for the distance-only formula and 0.180 for Jev&lt;/strong&gt;.&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%2Fdbmlhrgr5v9zwq1xk1md.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%2Fdbmlhrgr5v9zwq1xk1md.png" alt="On clear-cut pitches, only Jev stays hesitant" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I split the 250 into four groups by how far, and on which side, each pitch was from the original call. The 82 pitches at least an inch on the wrong side were overturned 99% of the time, and the formula said 98%. Jev's average probability was 65%. The 63 pitches more than an inch on the called side were never overturned, yet Jev gave them 18% on average.&lt;/p&gt;

&lt;p&gt;Near the edge (within an inch) both the formula and Jev are unsure. Even pitches within an inch on the called side were overturned 58% of the time: the edge computed from StatsAPI coordinates does not seem to reproduce the zone ABS actually uses right at the edge.&lt;/p&gt;

&lt;h3&gt;
  
  
  The wrong task for this tool
&lt;/h3&gt;

&lt;p&gt;This result could have been predicted before measuring anything. ABS compares a tracked position with a fixed zone, so the answer is set by a rule; it is not a judgment call.&lt;/p&gt;

&lt;p&gt;So I switched to something &lt;strong&gt;not settled by a rule, and genuinely uncertain&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main study: how much will a hitter's wOBA move next season?
&lt;/h2&gt;

&lt;p&gt;A hitter's next season is a mix of regression to the mean, luck, age, injuries and more. No rule settles it, but measures of the hitting itself (xwOBA, strikeout rate and so on) are available, so there is material to judge from.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data and comparison
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data:&lt;/strong&gt; season hitting lines from my own MLB dataset (&lt;a href="https://huggingface.co/datasets/yasumorishima/mlb-stats" rel="noopener noreferrer"&gt;yasumorishima/mlb-stats on Hugging Face&lt;/a&gt;), built from Baseball Savant and MLB StatsAPI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hitters:&lt;/strong&gt; 227 with at least 250 plate appearances in both 2025 and 2026. The 82 who had 250 in 2025 but not in 2026 are not included, so this is about hitters who kept playing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Given to Jev:&lt;/strong&gt; 2025 PA, wOBA, xwOBA, strikeout and walk rates, ISO, BABIP, batted-ball mix (ground ball, fly ball, pulled air ball) and sprint speed; age and position in four bands. &lt;strong&gt;No name or team, and numbers rounded&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Question:&lt;/strong&gt; which of five bins the 2026 change in wOBA falls in (Score)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The bin edges split past year-to-year changes into fifths. The past pairs are the 1,620 consecutive seasons from 2016→2017 through 2024→2025 with 250+ PA in both (pairs touching the 60-game 2020 season excluded). The edges came out at −36, −14, +3 and +25 points (1 point = 0.001 of wOBA).&lt;/p&gt;

&lt;p&gt;Forecasts were scored with the RPS (Ranked Probability Score): the mean squared gap between the cumulative forecast and the cumulative outcome, so predicting "small rise" is punished more when the answer is "big drop" than when it is "big rise". Lower is better.&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;rps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;probs&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="c1"&gt;# probs: 5 bin probabilities, b: actual bin (0-4)
&lt;/span&gt;    &lt;span class="n"&gt;cp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&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="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;cp&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;probs&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="n"&gt;tot&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cp&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tot&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three comparators:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Guessing:&lt;/strong&gt; 20% in every bin&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Marcel-style rule:&lt;/strong&gt; pull toward the league mean by plate appearances and adjust a little for age, with no fitting. The forecast change is the center of a normal distribution whose width is the rule's error on the past pairs, turned into five bin probabilities&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Models fitted on past examples:&lt;/strong&gt; ridge regression fitted on n of the 1,620 past pairs
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;marcel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;lg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;lg&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;                                             &lt;span class="c1"&gt;# 2025 league wOBA
&lt;/span&gt;    &lt;span class="n"&gt;proj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lg&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pa&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pa&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;woba&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;age&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;proj&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.006&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;29&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;age&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;age&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;29&lt;/span&gt; &lt;span class="nf"&gt;else &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.003&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;29&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;proj&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;woba&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;                                  &lt;span class="c1"&gt;# forecast change
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A model fitted on all the data will beat Jev, so the question is &lt;strong&gt;how many past examples a fitted model needs to catch up with Jev&lt;/strong&gt;. That number is a rough measure of how much baseball knowledge Jev brings with it, which matters most where data is scarce, such as new foreign players or rookies.&lt;/p&gt;

&lt;p&gt;To avoid reading the results in whatever way suited me, I committed the design and "which result means what" to the repository before calling Jev (&lt;a href="https://github.com/yasumorishima/jev-baseball/blob/master/study2-projection/PREREG.md" rel="noopener noreferrer"&gt;PREREG.md&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Jev's gain over guessing is a third of the Marcel-style rule's
&lt;/h2&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%2F1s10mo2zhyzy63f26ro6.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%2F1s10mo2zhyzy63f26ro6.png" alt="Jev's gain over guessing is a third of the Marcel-style rule's" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Guessing scores an RPS of 0.195. The chart shows how far each method gets below that.&lt;/p&gt;

&lt;p&gt;Jev gets 0.015 below, better than guessing: the 95% interval of the difference over 10,000 resamples of hitters is [−0.029, −0.001] and excludes 0.&lt;/p&gt;

&lt;p&gt;The Marcel-style rule gets 0.046 below, and Jev does not reach it (difference +0.031, 95% interval [+0.017, +0.044]). By the pre-registered reading, &lt;strong&gt;Jev is worse than a textbook rule&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jev is worth a model fitted on 20 to 50 past examples
&lt;/h2&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%2Fdpzsr34zl1lujzzq03su.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%2Fdpzsr34zl1lujzzq03su.png" alt="Jev is worth a model fitted on 20 to 50 past examples" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I fitted ridge regressions on n of the 1,620 past pairs (n = 10, 20, 50, 100, 300) and scored them on the same 227 hitters. Which examples are drawn matters, so each n is an average over 200 draws.&lt;/p&gt;

&lt;p&gt;On average, the model fitted on 20 examples is worse than Jev and the one on 50 is better. With no examples at all, Jev forecasts about as well as a model fitted on 20 to 50 examples.&lt;/p&gt;

&lt;p&gt;With 20 examples, though, the result swings a lot with the draw (95% range 0.157 to 0.242), and Jev's 0.180 is inside it. And only 20 and 50 were measured; where the lines cross is not a measured value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jev rarely expects big moves
&lt;/h2&gt;

&lt;p&gt;From here on, the analysis was done after seeing the results. First, where did Jev lose points?&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%2Fug6z9m2evom8fltb82l6.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%2Fug6z9m2evom8fltb82l6.png" alt="Jev rarely expects big moves" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For each bin, the share of hitters who actually landed in it (gray) next to Jev's average probability for it (orange). The bins split past changes into fifths, so in past pairs each holds about 20%.&lt;/p&gt;

&lt;p&gt;In 2026, 15% of the 227 had a big drop and 22% a big rise. Jev gave these 2% and 9%. It put too much on "about the same" and "small rise".&lt;/p&gt;

&lt;p&gt;It is clearer hitter by hitter. I turned Jev's five probabilities into an "expected change" by weighting each bin's average change in the past pairs (−57, −24, −5, +14, +45 points).&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%2F078wumea3581rpvge12j.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%2F078wumea3581rpvge12j.png" alt="Jev's forecasts move only about 60% as much as the rule's" width="799" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The actual change is on the x-axis and the forecast change on the y-axis. Points on the dashed line are exact. Jev's forecasts stay within about ±30 points, a flat band.&lt;/p&gt;

&lt;p&gt;The standard deviation of the forecasts is 13 points for Jev and 21 for the rule, against 36 for the actual changes. Actual changes include luck, so even a good forecast moves less than reality; the fair comparison is with the rule, and Jev moves only about 60% as much.&lt;/p&gt;

&lt;p&gt;Because this "expected change" is built from bin averages, it cannot go below −57 points even if Jev puts 100% on "big drop". The bottom-left corner of the chart is partly a limit of that construction.&lt;/p&gt;

&lt;p&gt;The direction is right. The correlation of the forecast with the actual change is 0.57 for Jev and 0.62 for the rule, not far apart. The gap is in how far the forecasts move.&lt;/p&gt;

&lt;h2&gt;
  
  
  Jev missed the stars' big drops, got the unlucky hitters right
&lt;/h2&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%2F0uvc52kqjgde36tfwgqc.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%2F0uvc52kqjgde36tfwgqc.png" alt="Jev missed the stars' big drops, got the unlucky hitters right" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The number beside each name is the 2025 wOBA. Jev never saw names; to Jev, Judge was "wOBA .465 (rounded to 0.005), an outfielder aged 30 to 33".&lt;/p&gt;

&lt;p&gt;Aaron Judge had a .463 wOBA in 2025 and dropped 91 points in 2026. The rule, reasoning that such a high number regresses, forecast a 75-point drop; Jev forecast 20. Cal Raleigh (.392) and George Springer (.408) look the same: about 90 points down, with Jev at 15 to 23. No forecast, the rule included, caught drops this large.&lt;/p&gt;

&lt;p&gt;Jev did better on others. Henry Davis had a low .229 wOBA in 2025, 64 points below his xwOBA (.293), an unlucky year. He rose 34 points; Jev said +35, nearly exact, while the rule said +64, too high.&lt;/p&gt;

&lt;p&gt;Michael Conforto rose 55; Jev said +34 and the rule +11, so Jev was closer. His wOBA was 43 points below his xwOBA, and here it matters whether a forecast uses luck (next section).&lt;/p&gt;

&lt;h2&gt;
  
  
  Jev uses luck, but not much regression to the mean
&lt;/h2&gt;

&lt;p&gt;What Jev leans on may explain these five. I regressed Jev's expected change on two inputs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Regression to the mean:&lt;/strong&gt; how far the 2025 wOBA was above the league mean&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Luck:&lt;/strong&gt; 2025 wOBA − xwOBA (the gap to the wOBA expected from exit velocity and launch angle)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and fitted the same regression to the actual changes in the 1,620 past pairs:&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="n"&gt;X&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c_&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ones&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;woba_minus_league&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;woba_minus_xwoba&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;w_actual&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;linalg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lstsq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X_train&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;actual_delta_train&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rcond&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="c1"&gt;# 1,620 past pairs
&lt;/span&gt;&lt;span class="n"&gt;w_jev&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;linalg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lstsq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;X_test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;jev_expected_delta&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rcond&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="c1"&gt;# Jev's forecasts (227)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Ftopkoq42vnkr2jkarpve.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%2Ftopkoq42vnkr2jkarpve.png" alt="Jev uses luck, but not much regression to the mean" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the past pairs, a hitter one point above the league mean gave back 0.43 points the next season, and one point of wOBA above xwOBA also gave back 0.43. In Jev's forecasts, the luck weight is 0.32, somewhat weaker than reality, but the regression weight is 0.20, less than half.&lt;/p&gt;

&lt;p&gt;The Marcel-style rule is the reverse: a strong regression weight (0.57) but, with no xwOBA in the formula, almost no luck weight (0.01). That is why the rule said only +11 for Conforto; the past-pair weights give +30.&lt;/p&gt;

&lt;p&gt;A star who really was hitting, like Judge, also has a high xwOBA, so there is little luck to give back. What is left is regression to the mean: −66 points with the past-pair weights, but Jev uses it weakly and stopped at −20 (the actual was −91, beyond even the weights' formula).&lt;/p&gt;

&lt;p&gt;For Henry Davis, the past-pair weights give +64, the same as the rule. Jev being right on Davis is one hitter's result that these two inputs do not explain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Width and regression filled in: indistinguishable from the rule
&lt;/h2&gt;

&lt;p&gt;If Jev's forecasts are too narrow, does widening them catch up with the rule? I did not ask Jev again; everything below is computed from its existing answers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Jev's center + the rule's width:&lt;/strong&gt; a normal distribution centered on Jev's expected change, with the rule's width (the standard deviation of the rule's errors in past pairs, 32 points), turned into five bin probabilities&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flattening:&lt;/strong&gt; Jev's bin probabilities flattened as &lt;code&gt;p ** (1 / T)&lt;/code&gt; and mixed with guessing (20% each) at weight w. T and w were chosen by splitting the 227 into 10 groups, picking the best on nine and scoring the tenth (every group chose T between 2.7 and 3.2 and w = 0)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;... plus the missing regression to the mean:&lt;/strong&gt; the first repair, with (past-pair weight 0.43 − Jev's weight 0.20) × (points above the league mean) added to the center. Neither weight uses any 2026 outcome&lt;/li&gt;
&lt;/ul&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%2Fotm37tevf7zh2zheqiap.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%2Fotm37tevf7zh2zheqiap.png" alt="Width and regression filled in: indistinguishable from the rule" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keeping Jev's center with the rule's width takes the RPS from 0.180 to 0.162, closing more than half of the 0.031 gap to the rule. Flattening gives 0.168. Neither reaches the rule's 0.149, and the 95% intervals of the differences exclude 0 (width only: +0.014 [+0.004, +0.023]).&lt;/p&gt;

&lt;p&gt;Adding the missing regression to the mean gives 0.1505, a difference from the rule of +0.002 (95% interval [−0.005, +0.008]): indistinguishable. I think the remaining gap was almost all the weak regression to the mean. This repair, though, was thought of after seeing the results, and the repaired forecast is no longer Jev's alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On a problem settled by a rule, like ABS challenges, Jev lost clearly to a distance-only formula (Brier 0.113 vs 0.180)&lt;/li&gt;
&lt;li&gt;Asked for next season's wOBA change from anonymized lines, Jev beat guessing and was worth a model fitted on 20 to 50 past examples, but it did not reach the Marcel-style rule&lt;/li&gt;
&lt;li&gt;It gets the direction, and it uses luck (wOBA − xwOBA), a little less than it should&lt;/li&gt;
&lt;li&gt;It underestimates how far hitters move, above all by using too little regression to the mean. Repairing the width and the regression after the fact gave a forecast indistinguishable from the rule (no longer Jev's alone)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What the two studies share: &lt;strong&gt;Jev gets the direction, but its probabilities sit too close to the middle&lt;/strong&gt;. Personally, if I start from Jev's answers where data is scarce, the next thing I want to try is filling in regression to the mean and the width from a small amount of data.&lt;/p&gt;

&lt;p&gt;I tested one model version (&lt;code&gt;jev-1.13-20260917&lt;/code&gt;), one way of asking, and MLB hitters from 2025 to 2026 only. Other prompts or other tasks may give different results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Terms&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;wOBA: an on-base measure weighting each outcome (walk, single, home run and so on) by its run value; the 2025 league mean was .313&lt;/li&gt;
&lt;li&gt;xwOBA: wOBA with each batted ball replaced by the value expected from its exit velocity and launch angle&lt;/li&gt;
&lt;li&gt;RPS: score for ordered-bin forecasts; mean squared gap between cumulative forecast and cumulative outcome; lower is better&lt;/li&gt;
&lt;li&gt;Brier score: score for yes/no probabilities; mean squared gap between probability and the 0/1 outcome; lower is better&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Pre-registered vs post-hoc&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pre-registered: how hitters were selected, the bins, the comparators, the learning curve (models fitted on n examples) and the main readings&lt;/li&gt;
&lt;li&gt;The registered readings included a rule like "if the catch-up point is 50 examples, then ...", but the "worse than the Marcel-style rule" rule applied first, so the catch-up point is reported descriptively&lt;/li&gt;
&lt;li&gt;Post-hoc: the bin shares, the scatter, the named hitters, the regression weights, the width and regression repairs, and the ABS breakdown by distance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Caveats&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Without 17 near-outlier lines (any input more than 2.5 standard deviations from the mean), the difference from guessing has an interval crossing 0 ([−0.024, +0.005])&lt;/li&gt;
&lt;li&gt;Rounding does not hide stars like Judge, so Jev may have recognized players. I also blended each line with a similar hitter's to hide identity, but blending narrows the actual changes too (standard deviation 0.036 → 0.029), which favors Jev's narrow forecasts. Recall would make Jev worse on blended lines and the narrowing makes it better, and only the sum is observed, so &lt;strong&gt;this check cannot say whether Jev recalls players&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;"Jev's expected change" is computed from its bin probabilities and the past bin averages; Jev did not state it&lt;/li&gt;
&lt;li&gt;The weight comparison uses different samples (Jev's 227 forecasts vs 1,620 past actual changes). Fitting the 227 hitters' actual 2026 changes gives 0.52 for regression and 0.41 for luck, the same pattern&lt;/li&gt;
&lt;li&gt;The ABS comparison uses a zone computed from StatsAPI coordinates, which does not reproduce the ABS zone exactly at the edge&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data and code&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hitting: &lt;a href="https://huggingface.co/datasets/yasumorishima/mlb-stats" rel="noopener noreferrer"&gt;yasumorishima/mlb-stats (Hugging Face)&lt;/a&gt;, taken on 2026-09-29, two days after the regular season ended&lt;/li&gt;
&lt;li&gt;ABS challenges: MLB StatsAPI game feeds&lt;/li&gt;
&lt;li&gt;Analysis and charts: &lt;a href="https://github.com/yasumorishima/jev-baseball" rel="noopener noreferrer"&gt;https://github.com/yasumorishima/jev-baseball&lt;/a&gt; (post-hoc analysis in &lt;code&gt;study2-projection/deepdive.py&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Japanese version: &lt;a href="https://qiita.com/ussu_ussu_ussu/items/cc28f711396515c1fb31" rel="noopener noreferrer"&gt;Qiita&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>baseball</category>
      <category>mlb</category>
      <category>machinelearning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Does a pitch's performance carry over to next season? Whiff rate vs run value on 8,022 MLB pairs</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Tue, 29 Sep 2026 00:08:51 +0000</pubDate>
      <link>https://dev.to/yasumorishima/does-a-pitchs-performance-carry-over-to-next-season-whiff-rate-vs-run-value-on-8022-mlb-pairs-bj</link>
      <guid>https://dev.to/yasumorishima/does-a-pitchs-performance-carry-over-to-next-season-whiff-rate-vs-run-value-on-8022-mlb-pairs-bj</guid>
      <description>&lt;p&gt;While looking at pitch-type stats on Baseball Savant, I started wondering: if a pitch missed a lot of bats one year, does it still miss bats the next year? If a pitch was hard to hit one year, is it still hard to hit the next?&lt;/p&gt;

&lt;p&gt;A good number in one season could mean the pitch is genuinely good, or it could mean it was just a good year, and that probably depends on the metric. So I checked with public MLB data. I have no professional baseball experience; I just aggregated public data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data and how the seasons are compared
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pitch-type stats&lt;/strong&gt;: Baseball Savant's pitch arsenal table (pitcher x pitch type x season), 2017–2025&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pitch-level data&lt;/strong&gt;: about 5.98 million pitches from Savant's Statcast Search (used later to split run value)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The comparison is simple. &lt;strong&gt;The same pitcher's same pitch type in two consecutive seasons is one pair&lt;/strong&gt;, for example one pitcher's 2023 slider and his 2024 slider, and I take the correlation between season 1 and season 2. Only pairs with 100+ pitches in both seasons are used: &lt;strong&gt;8,022 pairs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Compared as is, the correlation would be inflated just because sliders miss more bats than sinkers no matter who throws them. What I want is "is this slider good among sliders", so I first &lt;strong&gt;subtract that season's average for that pitch type&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In SQL the pairs look like this. It is simplified for the post; the real thing is a dbt model (&lt;code&gt;mart_scouting_reliability&lt;/code&gt;) that also leaves out the season in progress, among other things.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="n"&gt;player_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;season&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pitch_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pitches&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;whiff_rate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
           &lt;span class="n"&gt;whiff_rate&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="k"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;whiff_rate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;over&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;partition&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="n"&gt;season&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pitch_type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;
    &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pitch_arsenal&lt;/span&gt;
    &lt;span class="k"&gt;where&lt;/span&gt; &lt;span class="n"&gt;pitches&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="n"&gt;least&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pitches&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pitches&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;min_pitches&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;w1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;w2&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;
&lt;span class="k"&gt;join&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="k"&gt;on&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;player_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;player_id&lt;/span&gt;
        &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pitch_type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pitch_type&lt;/span&gt;
        &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;season&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;season&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Small samples are noisy, so the pairs are split into four bands by &lt;strong&gt;the smaller of the two seasons' pitch counts&lt;/strong&gt;, and &lt;code&gt;corr(w1, w2)&lt;/code&gt; is computed per band.&lt;/p&gt;

&lt;h2&gt;
  
  
  Whiff rate carries over; run value does not
&lt;/h2&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%2Fv8m6lhorf26boutum7gg.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%2Fv8m6lhorf26boutum7gg.png" alt="Whiff rate carries over; run value does not" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every metric carries over more with more pitches, but &lt;strong&gt;the gap between metrics is larger than the gap between sample sizes&lt;/strong&gt;. Whiff rate with only 100–199 pitches (0.53) carries over more than run value with 800+ (0.35).&lt;/p&gt;

&lt;p&gt;For the 1,962 pairs with 400+ pitches in both seasons, the year-to-year correlation is 0.70 for whiff rate and 0.27 for run value. This is what that difference looks like, one dot per pair:&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%2Fv095x1zisasducjzm51e.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%2Fv095x1zisasducjzm51e.png" alt="Correlation 0.70 vs 0.27" width="799" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For whiff rate, most pitches that were above average in season 1 are above average again in season 2, and the dots form a rising band. For run value, a pitch above average in season 1 can land almost anywhere in season 2; the cloud is nearly round.&lt;/p&gt;

&lt;h2&gt;
  
  
  How often the top pitches stay on top
&lt;/h2&gt;

&lt;p&gt;Correlations are hard to picture, so I also counted it another way: rank each season's pitches (after subtracting the pitch-type average) and see how many of the top 20% are still in the top 20% next season. If the two seasons were unrelated, it would be about 20%.&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%2Fuhf4ltjtseues62vn13l.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%2Fuhf4ltjtseues62vn13l.png" alt="Share of top-20% pitches still top 20% next season" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With 400+ pitches in both seasons, about one in three top-20% run value pitches stayed in the top 20%, and 36% dropped to the bottom half (about 50% if unrelated). For whiff rate, only 12% dropped to the bottom half.&lt;/p&gt;

&lt;h2&gt;
  
  
  At 500 pitches, the correlation with next season is 0.68 for whiff rate and 0.20 for run value
&lt;/h2&gt;

&lt;p&gt;If one season's number is "the pitch's true level + noise", then with n pitches the true level is roughly &lt;code&gt;n / (n + k)&lt;/code&gt; of it, where k is the pitch count at which it is half signal, half noise. "Signal" here just means the part that is not chance.&lt;/p&gt;

&lt;p&gt;The true level itself also changes a little from year to year. If c (at most 1) is how stable it is, the year-to-year correlation is c times the geometric mean of the two seasons' signal shares.&lt;/p&gt;

&lt;p&gt;A reader suggested this model in a comment on this post, and later suggested reporting the correlation at a fixed pitch count rather than k. I sorted the 8,022 pairs by pitch count into 12 equal-size groups and searched for the c and k that best fit each group's correlation, using the actual pitch counts of the pairs in the group (weighted by group size). From those I computed the correlation when both seasons have the same n pitches, &lt;code&gt;c * n / (n + k)&lt;/code&gt;:&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;# expected correlation for one group of pairs with pitch counts n1, n2
&lt;/span&gt;&lt;span class="n"&gt;r_pred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&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;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n2&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;span class="c1"&gt;# correlation when both seasons have n pitches
&lt;/span&gt;&lt;span class="n"&gt;r_n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fexvs1nz6a4yapz09wfvo.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%2Fexvs1nz6a4yapz09wfvo.png" alt="Correlation with next season at 500 pitches" width="799" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whiff rate: &lt;strong&gt;0.68&lt;/strong&gt; (95% interval from 200 resamples of pitchers: 0.65–0.70)&lt;/li&gt;
&lt;li&gt;xwOBA allowed: 0.41 (0.38–0.44)&lt;/li&gt;
&lt;li&gt;Run value: &lt;strong&gt;0.20&lt;/strong&gt; (0.18–0.23)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;500 pitches is close to one season of a reliever's main pitch or a starter's second pitch (2021–2025 medians: 463 for the most-used pitch of relievers with 40+ innings, 613 for the second pitch of starters with 100+ innings). A starter's main pitch over a full season is about 1,100 pitches (median 1,086.5 for the most-used pitch of the 316 pitcher-seasons with 2,400+ pitches in 2021–2025). Even there, run value reaches only 0.35 (0.27–0.39), about half of whiff rate at 500, with twice the pitches.&lt;/p&gt;

&lt;p&gt;In terms of k, the pitch count at which half of a season is signal: about 100 for whiff rate (76–138) and about 300 for xwOBA allowed (176–498). Run value's fit gives about 1,800, but the interval runs from 455 to 2,212, and in 92 of the 200 resamples c sat at its cap of 1. Within the pitch counts in this data (at most about 2,300 for one pitch in one season), c and k cannot be told apart well. The correlation at a fixed pitch count does not have that problem: any (c, k) pair that fits the data traces nearly the same curve within this range, so its interval is much narrower than k's (0.18–0.23 at 500 pitches, 0.27–0.39 at about 1,100). An earlier version of this post led with k and said run value needs "at least 600" pitches; recomputed with 200 resamples, the lower end is 455.&lt;/p&gt;

&lt;p&gt;The comment put run value's k at about 700. The bands use the smaller of the two seasons' pitch counts, so the other season had more pitches than that; fitting with both seasons' counts gives a larger k.&lt;/p&gt;

&lt;h2&gt;
  
  
  Splitting run value into parts
&lt;/h2&gt;

&lt;p&gt;Why does run value carry over so little? I went down to pitch-level data.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href="https://www.mlb.com/glossary/statcast/run-value" rel="noopener noreferrer"&gt;MLB glossary&lt;/a&gt;, run value adds up, pitch by pitch, how much each result (ball, strike, hit, out and so on) moved the expected runs. Pitch-level data carries that value as &lt;code&gt;delta_run_exp&lt;/code&gt; (positive favors the batter). Summing it by pitcher, pitch type and season, flipping the sign and rounding to an integer &lt;strong&gt;matches Savant's published pitch-type run value on 99.2–99.7% of rows in every season&lt;/strong&gt;. The rest differ by 1, and all of them have a fractional part near 0.5, where the rounding rule decides.&lt;/p&gt;

&lt;p&gt;I then split each pitch's value into five parts that add back exactly to run value:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mid-PA pitches&lt;/strong&gt;: pitches that did not end the plate appearance (balls, strikes, fouls), the value of the count change&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;K / BB / HBP&lt;/strong&gt;: plate appearances ending in a strikeout, walk or hit-by-pitch&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batted-ball quality&lt;/strong&gt;: for balls in play, the value expected from exit velocity and launch angle (xwOBA) and the count&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batted-ball luck&lt;/strong&gt;: for balls in play, actual minus expected: the same contact can be an out at a fielder or a hit through a gap&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Base/out situation&lt;/strong&gt;: the same count and result is worth different amounts with different runners and outs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first four use values averaged over runners and outs: the mean over all pitches with the same season, count and result, and for batted-ball quality, the mean over batted balls with the same season, count and xwOBA (in 0.05 steps). "Result" is the plate appearance outcome (strikeout, single and so on) for a pitch that ended it, and the pitch call (ball, swinging strike and so on) otherwise.&lt;/p&gt;

&lt;p&gt;The core of it looks like this (simplified: it leaves out batted balls without an xwOBA, the final sign flip to the pitcher's side and so on):&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;# mean by season, count and result = value averaged over runners and outs
&lt;/span&gt;&lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cn&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;season&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;balls&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;strikes&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;result&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="n"&gt;delta_run_exp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mean&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# for batted balls, the mean by season, count and xwOBA step is the "expected" value
&lt;/span&gt;&lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;cn_exp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;bip&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;groupby&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;season&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;balls&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;strikes&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;xwoba_bin&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="n"&gt;cn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mean&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;midpa&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;end_of_pa&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# mid-PA pitches
&lt;/span&gt;&lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pa_nonbip&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end_of_pa&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;bip&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# K / BB / HBP
&lt;/span&gt;&lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bip_exp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bip&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cn_exp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;             &lt;span class="c1"&gt;# batted-ball quality
&lt;/span&gt;&lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bip_luck&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bip&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cn&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cn_exp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;# batted-ball luck
&lt;/span&gt;&lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;situation&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;delta_run_exp&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;P&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cn&lt;/span&gt;                 &lt;span class="c1"&gt;# base/out situation
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  One pitch at a time
&lt;/h3&gt;

&lt;p&gt;To see what the split shows, I picked two top run value pitches of 2021 whose makeup differs clearly, and put them next to 2022. These are season totals in runs, not relative to the pitch-type average.&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%2Fqmt9kj7rhesja2pd118u.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%2Fqmt9kj7rhesja2pd118u.png" alt="Two top pitches of 2021, built very differently" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Adam Wainwright's sinker: +13 of its +20 runs in 2021 were batted-ball luck. Its whiff rate was 9.8%, below the 2021 sinker average (15.5%). In 2022 luck was still positive (+11), but batted-ball quality fell to −18, and the total was 0.&lt;/p&gt;

&lt;p&gt;Corbin Burnes's cutter: in 2021 batted-ball luck was negative (−7), and strikeouts/walks plus mid-PA pitches alone were worth +34. In 2022 those two fell to +26, but luck swung to +11 and batted-ball quality was −10, so the total was +27.&lt;/p&gt;

&lt;p&gt;For one pitch in one season, even the parts that rarely carry over sometimes do and sometimes don't. Two hand-picked examples prove nothing, so here are all the pitches.&lt;/p&gt;

&lt;h3&gt;
  
  
  All pitches
&lt;/h3&gt;

&lt;p&gt;Pairs with 400+ pitches in both seasons (1,962 pairs), per 100 pitches, after subtracting the pitch-type average.&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%2Fa2eukfr2klwaq96smqjd.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%2Fa2eukfr2klwaq96smqjd.png" alt="Run value breakdown" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each part's share of one season's run value variation (covariance of the part with run value divided by the variance of run value; the five add to 100%). Batted-ball luck is 27% and base/out situation 4%, about 30% together.&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%2Fr18pvilx2hs6k1rwu152.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%2Fr18pvilx2hs6k1rwu152.png" alt="Batted-ball luck and situation barely carry over" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Year-to-year correlation of each part alone. Batted-ball luck (0.06) and situation (−0.03) barely carry over; K / BB / HBP (0.57) and mid-PA pitches (0.60) carry over well. Those two are only about 30% of one season's variation, but about 70% of the "high this year, high next year" link comes from them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dropping luck and situation predicts next season better
&lt;/h2&gt;

&lt;p&gt;So I tried predicting next season's run value from the three parts that remain after dropping luck and situation. The prediction was fit on pairs whose second season is 2021 or earlier and checked on pairs whose second season is 2022 or later, so it is tested on years it did not see.&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%2F5y6w9b17u5hvuo8ybw0p.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%2F5y6w9b17u5hvuo8ybw0p.png" alt="Dropping luck and situation predicts next season better" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just adding up the three parts correlates better with next season than this season's run value itself (0.29 → 0.35). Resampling pitchers 2,000 times, the 95% interval of that difference is 0.03 to 0.10 and does not include 0. Pairs with 100–399 pitches go the same way (0.12 → 0.18), though both are low.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whiff rate carries over well: the correlation with next season is 0.68 at 500 pitches, and about 100 pitches are enough for half of a season's number to be signal&lt;/li&gt;
&lt;li&gt;Run value carries over little in one season: 0.20 at 500 pitches, and 0.35 even for a starter's main pitch over a season (about 1,100)&lt;/li&gt;
&lt;li&gt;About 30% of one season's run value variation is batted-ball luck and base/out situation, which barely carry over&lt;/li&gt;
&lt;li&gt;Adding up the other three parts predicts next season's run value better (0.29 → 0.35)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My personal take: when looking at one season of run value, it seems useful to look at whiff rate and strikeouts/walks alongside it to think about the next season.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Terms&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whiff rate: share of swings that miss&lt;/li&gt;
&lt;li&gt;xwOBA allowed: the value of plate appearances ending on that pitch, with batted balls replaced by their expected value from exit velocity and launch angle&lt;/li&gt;
&lt;li&gt;Run value: the sum, pitch by pitch, of how much each pitch moved the expected runs (positive favors the pitcher)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Caveats&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The correlations mix random noise and real change in the pitch (a new grip, lost velocity and so on)&lt;/li&gt;
&lt;li&gt;Bands use the smaller of the two seasons' pitch counts, so a band also holds pairs where one season had many more pitches&lt;/li&gt;
&lt;li&gt;Pairs touching the 60-game 2020 season are included&lt;/li&gt;
&lt;li&gt;Pitchers who stopped pitching (or threw fewer than 100 of that pitch) after a bad year form no pair. That removes low first-season values, so the correlations may be slightly low&lt;/li&gt;
&lt;li&gt;Savant's pitch arsenal table counts knuckle curves and slow curves as curveballs, and the pitch-level data follows it&lt;/li&gt;
&lt;li&gt;Batted-ball luck is only actual minus expected from exit velocity, launch angle and count; defense and park are not separated out&lt;/li&gt;
&lt;li&gt;The five-part split is my own choice; for example, whether the count is used in the batted-ball expectation moves the line between quality and luck a little&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The correlations are built with dbt, with a test that computes the same table another way. The run value split is computed with pandas from pitch-level data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/yasumorishima/mlb-data-pipeline" rel="noopener noreferrer"&gt;https://github.com/yasumorishima/mlb-data-pipeline&lt;/a&gt;&lt;/p&gt;

</description>
      <category>baseball</category>
      <category>datascience</category>
      <category>dbt</category>
      <category>duckdb</category>
    </item>
    <item>
      <title>ABS Challenges from Triple-A to MLB: Catchers Win Most, and Batters Who Don't Chase Win More</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Mon, 28 Sep 2026 02:11:16 +0000</pubDate>
      <link>https://dev.to/yasumorishima/abs-challenges-from-triple-a-to-mlb-catchers-win-most-and-batters-who-dont-chase-win-more-499a</link>
      <guid>https://dev.to/yasumorishima/abs-challenges-from-triple-a-to-mlb-catchers-win-most-and-batters-who-dont-chase-win-more-499a</guid>
      <description>&lt;p&gt;In 2026 MLB started the ABS challenge, where a player can dispute a ball/strike call. Watching players tap their helmet or cap on broadcasts, I got curious: who wins these challenges, and where does the gap between good and bad challengers come from?&lt;/p&gt;

&lt;p&gt;Triple-A used the same system a year earlier, in 2025, so there are records from before players reached MLB. With the regular season over, I looked at public data from Baseball Savant and MLB StatsAPI. I have no experience working in baseball; I just tallied up public data.&lt;/p&gt;

&lt;h2&gt;
  
  
  How ABS challenges work
&lt;/h2&gt;

&lt;p&gt;According to &lt;a href="https://www.mlb.com/news/abs-challenge-system-mlb-2026" rel="noopener noreferrer"&gt;MLB's announcement&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The plate umpire still calls every pitch. &lt;strong&gt;Only the batter, pitcher or catcher&lt;/strong&gt; can challenge, and must do so immediately&lt;/li&gt;
&lt;li&gt;Each team has &lt;strong&gt;two&lt;/strong&gt; challenges per game; a failed challenge uses one up (a successful one does not)&lt;/li&gt;
&lt;li&gt;Hawk-Eye tracking decides. The zone top is &lt;strong&gt;53.5%&lt;/strong&gt; of the player's height (without cleats), the bottom &lt;strong&gt;27%&lt;/strong&gt;, measured &lt;strong&gt;over the middle of the plate&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A challenge wins (the call is overturned) when the tracked pitch was on the other side of the call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data
&lt;/h2&gt;

&lt;p&gt;Two sources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Baseball Savant's ABS challenge boards (per player)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Savant's &lt;a href="https://baseballsavant.mlb.com/leaderboard/abs-challenges" rel="noopener noreferrer"&gt;ABS Challenges&lt;/a&gt; board lists each player's challenges and overturns, plus Savant's expected values: how many times an average player would challenge, and win, given the same opportunities as this player. The page's CSV export has no player id, so I added a function to my package &lt;a href="https://pypi.org/project/savant-extras/" rel="noopener noreferrer"&gt;savant-extras&lt;/a&gt; that reads the JSON embedded in the page:&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;import&lt;/span&gt; &lt;span class="n"&gt;savant_extras&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;sx&lt;/span&gt;

&lt;span class="c1"&gt;# MLB 2026 regular-season catcher challenges, including players with none
&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abs_challenges&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="n"&gt;level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mlb&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;challenge_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;catcher&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                       &lt;span class="n"&gt;game_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;regular&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;min_challenges&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I joined 15 boards (MLB and Triple-A; batters, pitchers and catchers; spring and regular season) on the player id, added season stats and Statcast aggregates (chase rate, framing and so on), and published the result on Kaggle (&lt;a href="https://www.kaggle.com/datasets/yasunorim/mlb-abs-challenges-aaa-2025-to-mlb-2026" rel="noopener noreferrer"&gt;ABS Challenges: Triple-A 2025 to MLB 2026&lt;/a&gt;). The numbers here are from the final version, after the regular season.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. MLB StatsAPI game feeds (pitch by pitch)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To see what kind of pitches were challenged, you need pitch-level data. In StatsAPI game feeds (&lt;code&gt;feed/live&lt;/code&gt;, no key needed), a challenged pitch carries &lt;code&gt;reviewDetails&lt;/code&gt;, so I extracted them from every 2026 regular-season game (2,402 games had a challenge).&lt;/p&gt;

&lt;p&gt;There were three traps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The pitch's &lt;code&gt;details.call.description&lt;/code&gt; is the call &lt;strong&gt;after&lt;/strong&gt; the review. The original call comes from who challenged (the batting side challenges strikes, the fielding side challenges balls)&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;count&lt;/code&gt; on a pitch is the count &lt;strong&gt;after&lt;/strong&gt; that pitch. The count before it comes from the previous pitch&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When the final call ends the plate appearance (strikeout or walk), &lt;code&gt;reviewDetails&lt;/code&gt; sits on the play, not on the pitch.&lt;/strong&gt; Reading only the pitch misses all of those&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I missed the third one at first, and found it when a breakdown by count said batters' challenges with two strikes won 100% of the time, which cannot be right: every failed challenge that would have ended in a strikeout was missing. Picking up both places in jq (excerpt):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.liveData.plays.allPlays[] as $p
| ($p.playEvents) as $ev
| (
    # the plate appearance went on: on the pitch
    ( range(0; $ev | length) as $i | select($ev[$i].reviewDetails.reviewType == "MJ")
      | {i: $i, rv: $ev[$i].reviewDetails} ),
    # the plate appearance ended: on the play; the challenged pitch is the last one
    ( select($p.reviewDetails.reviewType == "MJ")
      | ([range(0; $ev | length) | select($ev[.].isPitch == true)] | last) as $li
      | {i: $li, rv: $p.reviewDetails} )
  )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I checked the counts against Savant's board totals: 10,557 regular-season challenges, matching exactly, and by challenger 5,612 catcher (Savant 5,613), 4,766 batter (4,765) and 179 pitcher (179). Before fixing the third trap, 2,661 challenges (25%) were missing.&lt;/p&gt;

&lt;h2&gt;
  
  
  At every level, catchers win the most challenges
&lt;/h2&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%2F8ojxgha85i4j1e7bwxjo.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%2F8ojxgha85i4j1e7bwxjo.png" alt="At every level, catchers win the most challenges" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the 2026 MLB regular season, catchers won 58.6% of 5,613 challenges, batters 48.9% of 4,765 and pitchers 39.7% of 179. Triple-A has the same order, with a 13-point gap between catchers and batters in 2026.&lt;/p&gt;

&lt;p&gt;Pitchers rarely challenge; on the fielding side it is almost entirely the catcher's job.&lt;/p&gt;

&lt;p&gt;Triple-A catchers went from 53.7% in 2025 to 57.9% in 2026. Batters stayed at 45% both years.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do catchers win more?
&lt;/h2&gt;

&lt;p&gt;Catchers win 10 points more often than batters. Is it because they judge the calls better? I looked at what kind of pitches were challenged.&lt;/p&gt;

&lt;p&gt;From the StatsAPI coordinates I computed how far the ball's surface was from the zone edge, and split challenges into three groups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Call looks clearly wrong:&lt;/strong&gt; at least an inch on the other side of the call (for example, a ball call on a pitch an inch or more inside the zone)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Within an inch of the edge&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Call looks right:&lt;/strong&gt; at least an inch on the called side&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is my own zone, and it differs from the ABS call near the edge (see the appendix). But pitches an inch or more from the edge were called "as they look" about 98% of the time or more, for catchers and batters alike, so the two outer groups are largely reliable.&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%2Fp69e2eh6mi6nsuzcj3mw.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%2Fp69e2eh6mi6nsuzcj3mw.png" alt="Catchers pick pitches whose call looks clearly wrong" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;38% of catchers' challenges were on pitches whose call looks clearly wrong, against 21% of batters'. The other way round, 16% of catchers' challenges were on calls that look right, against 36% of batters'.&lt;/p&gt;

&lt;p&gt;I also swapped only the mix of pitches, keeping each group's win rate. If batters chose pitches in the catchers' mix, they would win 67.4%, more than catchers actually do (58.6%). If catchers chose in the batters' mix, they would win 40.7%. Either way, &lt;strong&gt;the difference in mix alone opens a gap bigger than the actual 10 points&lt;/strong&gt; between catchers and batters. Most of the catchers' edge seems to come from choosing more pitches whose call looks clearly wrong. Catchers receive the ball in their mitt and see its location closest, which may make those pitches easier to pick.&lt;/p&gt;

&lt;p&gt;On the hard pitches within an inch of the edge, batters won 64% and catchers only 46%. That group, though, is where my zone's error matters most (appendix), so I cannot say batters are better at judging the hard ones.&lt;/p&gt;

&lt;p&gt;So why do batters challenge calls that look right? I looked at the situations.&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%2Fri4ns3h1lvioknh38212.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%2Fri4ns3h1lvioknh38212.png" alt="With two strikes, batters' challenges win less often" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By strikes before the pitch, batters won 59% with no strikes and 40% with two. Catchers won 61%, 62% and 53%, a smaller drop.&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%2Fog6tuvhehigm7p9sio6v.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%2Fog6tuvhehigm7p9sio6v.png" alt="A third of batters' challenges dispute a called strike three" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A called strike with two strikes is strike three if it stands. 34% of batters' challenges came in that spot (the same 1,619 challenges as the two-strike point above), and 40% won, 13.5 points below their challenges of other strike calls (53%).&lt;/p&gt;

&lt;p&gt;45% of the strike-three challenges were on pitches whose call looks right (32% for other strike calls). When a strikeout is on the line, batters challenge more long shots.&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%2Fdej7m4xhoqfqcsuxnc92.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%2Fdej7m4xhoqfqcsuxnc92.png" alt="Late in the game, challenges win less often" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Late in the game, from the 9th inning on, both catchers and batters won less often. The share of catchers' challenges on calls that look right rose from 13% in innings 1 to 6 to 28% from the 9th on.&lt;/p&gt;

&lt;p&gt;This data alone does not say why. Unused challenges disappear at the end of the game, so teams may spend what is left; or late innings hold more high-leverage spots, where even a long shot is worth a challenge.&lt;/p&gt;

&lt;h2&gt;
  
  
  Among catchers, the share won ranges from 47% to 81%
&lt;/h2&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%2Fsgafiv5jbvywkhwousm1.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%2Fsgafiv5jbvywkhwousm1.png" alt="Among catchers, the share won ranges from 47% to 81%" width="800" height="592"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are the 44 MLB catchers with 60+ challenges in 2026. J.T. Realmuto won 70 of 86 (81%); Francisco Alvarez won 42 of 90 (47%).&lt;/p&gt;

&lt;p&gt;Savant's expected values say how many times an average player would challenge, and win, given the same opportunities. Realmuto's expected challenge count was 138; he made 86, about 40% fewer than an average catcher. He may have saved them for pitches likely to win. Alvarez made 90 against an expected 81, a little more than average. Salvador Perez, second at 46 of 65 (71%), made exactly as many challenges as expected (65).&lt;/p&gt;

&lt;p&gt;With 60 to 90 challenges per catcher, chance is not small. Using the catchers' overall 58.6%, the binomial probability of winning 70 or more of 86 is below 1 in 100,000, and about 0.03% that any of 44 catchers would. Realmuto is hard to explain by chance. Winning 42 or fewer of 90 has a probability of 1.5%, or 49% that at least one of 44 catchers would; Alvarez's low number is well within what chance produces.&lt;/p&gt;

&lt;p&gt;Across the 44, catchers who challenged less than expected tended to win more often (Spearman −0.26, p = 0.09), but the trend is not clear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Batters who chase less win more challenges
&lt;/h2&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%2Fyrcom3gswwn3yfg9xuhl.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%2Fyrcom3gswwn3yfg9xuhl.png" alt="Batters who chase less win more challenges" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I split the 465 MLB batters with 100+ plate appearances in Statcast into thirds by chase rate (swings at pitches outside the zone). From the least to the most chasing, they won 51.3%, 48.0% and 45.7% of their challenges. Among the 182 with 10+ challenges, the rank correlation between chase rate and share won is −0.20 (p = 0.008).&lt;/p&gt;

&lt;p&gt;Do batters with a good eye judge calls better? As with catchers, I split their challenges into the three groups (4,603 challenges from the three thirds):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Challenges of calls that look right: 33% for the least chasing third, 37% in the middle, 39% for the most chasing&lt;/li&gt;
&lt;li&gt;Challenges of calls that look clearly wrong: 22%, 21%, 19%&lt;/li&gt;
&lt;li&gt;Win rates within each group are about the same across the thirds (63% to 64% within an inch of the edge)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the difference is that batters who chase less challenge fewer calls that look right and slightly more that look clearly wrong. There is no clear difference in judging the hard pitches near the edge.&lt;/p&gt;

&lt;p&gt;How &lt;strong&gt;often&lt;/strong&gt; a batter challenges is nearly unrelated to chase rate (Spearman −0.04, 465 batters).&lt;/p&gt;

&lt;p&gt;By name, Taylor Ward, with the lowest chase rate (15%), won 8 of 15 (53%); Ceddanne Rafaela, with the highest (45%), won 6 of 24 (25%).&lt;/p&gt;

&lt;h2&gt;
  
  
  Stealing strikes and winning challenges are different skills
&lt;/h2&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%2F2f7nd38lzvhtpbgpobe7.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%2F2f7nd38lzvhtpbgpobe7.png" alt="Stealing strikes and winning challenges are different skills" width="799" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Catchers can make balls look like strikes: framing. Savant's official framing is MLB-only, so I computed, per catcher from pitch-level Statcast, the share of out-of-zone takes called strikes. That works in Triple-A too.&lt;/p&gt;

&lt;p&gt;As the left panel shows, in MLB 2026 it has a rank correlation of 0.83 with official framing runs (56 catchers), good enough as a stand-in (Triple-A has no official number, so I cannot check the fit there).&lt;/p&gt;

&lt;p&gt;But it is almost unrelated to challenge skill (Savant's challenges vs expected, see the appendix), as the right panel shows: 0.03 in MLB 2026, 0.08 in Triple-A 2026 and 0.14 in Triple-A 2025, none significant. Making a ball look like a strike and spotting a wrong call worth disputing seem to be different skills.&lt;/p&gt;

&lt;h2&gt;
  
  
  What carries up from Triple-A is how often a player challenges
&lt;/h2&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%2F4x2ive5ymatprmcmg6uk.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%2F4x2ive5ymatprmcmg6uk.png" alt="What carries up from Triple-A is how often a player challenges" width="799" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I compared the same players in Triple-A 2025 and MLB 2026 (63 batters and 51 catchers with 5+ challenges in both):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How often&lt;/strong&gt; they challenge carries over clearly (Spearman 0.37 for batters, 0.45 for catchers)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Share won&lt;/strong&gt; carries over for batters (0.32, p = 0.01); for catchers it is 0.24 (p = 0.10)&lt;/li&gt;
&lt;li&gt;Savant's &lt;strong&gt;challenges vs expected&lt;/strong&gt; (the net against an average player given the same opportunities) does not: 0.05 for batters and 0.21 for catchers, neither clear&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chase rate itself carries over strongly (0.68). As in the previous section, batters who chase less challenge fewer calls that look right, so the carry-over in share won may come from there (I did not check this). For example, Gary Sánchez challenged at 16% in Triple-A 2025 (7 challenges) and 16% in MLB 2026 (37).&lt;/p&gt;

&lt;h2&gt;
  
  
  No clear age difference
&lt;/h2&gt;

&lt;p&gt;Split into four age groups, MLB 2026 batters aged 34 and over won 54.2%, higher than the rest. But that is 34 batters and 334 challenges, and the interval (48.8% to 59.5%) overlaps the other groups. Savant's challenges vs expected per batter is −0.23 for 25 and under, +0.29 for 26 to 29, −0.30 for 30 to 33 and +0.73 for 34 and over, with no ordering by age. There is no clear age effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;In this data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At both MLB and Triple-A, catchers win the most challenges (58.6% in MLB 2026, batters 48.9%)&lt;/li&gt;
&lt;li&gt;Most of that gap seems to come from catchers choosing more pitches whose call looks clearly wrong (38% vs 21%). Batters challenge more calls that look right with two strikes, especially on called strike three&lt;/li&gt;
&lt;li&gt;Late in the game, more challenges go to calls that look right, and fewer win&lt;/li&gt;
&lt;li&gt;Catchers differ a lot: Realmuto challenged about 40% less than expected and won 70 of 86&lt;/li&gt;
&lt;li&gt;Batters who chase less win more, because they challenge fewer calls that look right and slightly more that look clearly wrong&lt;/li&gt;
&lt;li&gt;Framing and challenge skill are different things&lt;/li&gt;
&lt;li&gt;What carries from Triple-A to MLB is how often a player challenges; whether skill carries is unclear&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Terms&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expected values (Savant): how many times an average player would challenge (&lt;code&gt;exp_chal&lt;/code&gt;) and win (&lt;code&gt;exp_chal_gained&lt;/code&gt;) given the same opportunities as this player. They are not computed for the pitches the player chose. "Challenges vs expected" here is Savant's &lt;code&gt;overturns_vs_exp&lt;/code&gt;: the net of overturns and failures against expectation, minus the same for challenges made against the player's side. It mixes how often and how well a player challenges&lt;/li&gt;
&lt;li&gt;Challenge rate: challenges ÷ the opportunities Savant counts for the player (&lt;code&gt;n_total_sample&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Chase rate: share of pitches outside the zone that the batter swung at (Statcast)&lt;/li&gt;
&lt;li&gt;Rank correlation: Spearman's&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Caveats&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everything here is correlation, not causation&lt;/li&gt;
&lt;li&gt;The "distance from the zone edge" in the pitch-level sections is my own, from StatsAPI coordinates (measured at the front of the plate) and the zone top and bottom in StatsAPI. The zone top and bottom were constant per batter in 2026, but ABS judges over the middle of the plate, so my zone differs from the actual call near the edge. Within an inch of my edge, 64% of batters' and 46% of catchers' challenges were overturned, so the error may lean against catchers. An inch or more from the edge, 97.9% to 99.7% of calls went the way they look&lt;/li&gt;
&lt;li&gt;Individual players' shares swing a lot with few challenges. The named players' numbers are one season's results&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data and code&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dataset: &lt;a href="https://www.kaggle.com/datasets/yasunorim/mlb-abs-challenges-aaa-2025-to-mlb-2026" rel="noopener noreferrer"&gt;https://www.kaggle.com/datasets/yasunorim/mlb-abs-challenges-aaa-2025-to-mlb-2026&lt;/a&gt; (DOI: &lt;a href="https://doi.org/10.34740/kaggle/dsv/20077454" rel="noopener noreferrer"&gt;10.34740/kaggle/dsv/20077454&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Notebook: &lt;a href="https://www.kaggle.com/code/yasunorim/abs-challenges-who-wins-them-aaa-to-mlb" rel="noopener noreferrer"&gt;ABS Challenges: Who Wins Them, AAA to MLB&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Build code: &lt;a href="https://github.com/yasumorishima/kaggle-datasets" rel="noopener noreferrer"&gt;https://github.com/yasumorishima/kaggle-datasets&lt;/a&gt; (&lt;code&gt;abs-challenges-dataset/&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Sources: Baseball Savant / MLB StatsAPI (MLB Advanced Media)&lt;/li&gt;
&lt;li&gt;Japanese version: &lt;a href="https://qiita.com/ussu_ussu_ussu/items/57c5760b3f9917b3883f" rel="noopener noreferrer"&gt;Qiita&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Rewritten on 2026-09-30 with pitch-level data for the full regular season. An earlier version described Savant's expected values as accounting for the difficulty of the challenged pitches, and said older batters were below expected; Savant's expected values are for an average player given the same opportunities, and that "below expected" figure mixed two denominators.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>baseball</category>
      <category>mlb</category>
      <category>statcast</category>
      <category>datascience</category>
    </item>
    <item>
      <title>M5 StackChan pairing fails with No devices found — the factory firmware is the cause</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Sat, 25 Jul 2026 09:00:55 +0000</pubDate>
      <link>https://dev.to/yasumorishima/m5-stackchan-pairing-fails-with-no-devices-found-the-factory-firmware-is-the-cause-387e</link>
      <guid>https://dev.to/yasumorishima/m5-stackchan-pairing-fails-with-no-devices-found-the-factory-firmware-is-the-cause-387e</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;I bought the official M5Stack StackChan (&lt;code&gt;M5STACK-K151&lt;/code&gt;), and the "StackChan World" mobile app refused to finish setup: after selecting the device, it showed &lt;strong&gt;&lt;code&gt;No devices found&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The cause was &lt;strong&gt;not Bluetooth permissions and not an app bug — the factory firmware was simply too old&lt;/strong&gt;. After flashing the latest official firmware over USB, pairing went through on the first attempt.&lt;/p&gt;

&lt;p&gt;What makes this worth writing about is that the situation is &lt;strong&gt;a closed loop you cannot escape on the device itself&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New firmware arrives via OTA&lt;/li&gt;
&lt;li&gt;OTA needs Wi-Fi&lt;/li&gt;
&lt;li&gt;Wi-Fi setup needs app pairing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pairing fails on the old firmware&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So &lt;strong&gt;flashing over USB is the only way out&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment and dates
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Product&lt;/td&gt;
&lt;td&gt;M5StackChan AI Desktop Robot (ESP32-S3) / &lt;code&gt;M5STACK-K151&lt;/code&gt; (official assembled unit)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Purchased&lt;/td&gt;
&lt;td&gt;2026-07-24 (Switch Science, Japan)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Setup attempted&lt;/td&gt;
&lt;td&gt;2026-07-25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Factory firmware on the unit&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;1.2.4&lt;/strong&gt; (released 2026-04-20)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latest official firmware that day&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;1.4.4&lt;/strong&gt; (released 2026-07-13)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Host&lt;/td&gt;
&lt;td&gt;Windows 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Phone&lt;/td&gt;
&lt;td&gt;Android&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The dates matter here.&lt;/strong&gt; This product launched in 2026-05 and both the firmware and the app are still being updated frequently. &lt;strong&gt;The firmware version that ships with a unit depends on when you buy it&lt;/strong&gt;, so whether you hit this problem depends on timing. If you buy stock that has been sitting for a few months, you are a good candidate for the same trap.&lt;/p&gt;

&lt;h2&gt;
  
  
  The symptom
&lt;/h2&gt;

&lt;p&gt;The setup flow is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Power on, pass the servo test&lt;/li&gt;
&lt;li&gt;The device shows a 12-digit ID&lt;/li&gt;
&lt;li&gt;In the app: "Add a new StackChan" → scan for nearby devices&lt;/li&gt;
&lt;li&gt;Pick the entry matching the ID on the device screen&lt;/li&gt;
&lt;li&gt;Set device name → AI agent → Wi-Fi&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 4 immediately produced &lt;code&gt;No devices found&lt;/code&gt;&lt;/strong&gt;, and step 5 was never reachable.&lt;/p&gt;

&lt;h2&gt;
  
  
  What did not help
&lt;/h2&gt;

&lt;p&gt;The message talks about devices not being found, so of course I attacked discovery first. None of this changed anything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Granting Bluetooth and location permissions to the app (verified from the OS settings, not just the in-app prompt)&lt;/li&gt;
&lt;li&gt;Turning location services on (BLE scanning on Android is entangled with location)&lt;/li&gt;
&lt;li&gt;Force-stopping and restarting the app, rebooting the phone&lt;/li&gt;
&lt;li&gt;Rebooting the device, returning to the ID screen before scanning&lt;/li&gt;
&lt;li&gt;Toggling Bluetooth off and on&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing I learned the hard way: &lt;strong&gt;do not pair from the OS Bluetooth settings screen.&lt;/strong&gt; If you bond the device at the OS level, it gets registered as a known device and &lt;strong&gt;disappears from the app's "find a new device" list&lt;/strong&gt;. I did exactly this while "just checking", which made the picture even muddier. If you already did it, remove the pairing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The serial log told a completely different story
&lt;/h2&gt;

&lt;p&gt;I stopped guessing about permissions and captured the USB serial log. When you connect the unit to a PC, the CoreS3 (ESP32-S3) native USB shows up as a serial port (&lt;code&gt;VID_303A&lt;/code&gt; / &lt;code&gt;PID_1001&lt;/code&gt;, USB-Serial/JTAG).&lt;/p&gt;

&lt;p&gt;Here is what the log showed while the app was "not finding" anything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I (111140) NimBLE: connection established; status=0
I (111160) NimBLE:  peer_ota_addr_type=1 peer_ota_addr=
I (111160) NimBLE: 63:a2:04:c7:fa:5d
[info] [WifiConfigServer] app Connected
I (112260) NimBLE: Stack-Chan characteristic write; conn_handle=1 attr_handle=22
I (112260) NimBLE: Config data received (42 bytes): {"cmd":"handshake","data":"1784964126892"}
I (112420) NimBLE: GATT procedure initiated: notify;
I (112430) NimBLE: notify_tx event; conn_handle=1 attr_handle=22 status=0 is_indication=0
I (112440) NimBLE: Config notification sent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reading that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The BLE connection was established&lt;/strong&gt; (&lt;code&gt;status=0&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The app was connected&lt;/strong&gt; (&lt;code&gt;app Connected&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The app sent a handshake&lt;/strong&gt; (&lt;code&gt;{"cmd":"handshake"}&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The device answered&lt;/strong&gt; (&lt;code&gt;Config notification sent&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;And then &lt;strong&gt;nothing more arrives from the app&lt;/strong&gt; — not even a disconnect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So &lt;code&gt;No devices found&lt;/code&gt; did not describe reality. The process was not failing at &lt;strong&gt;discovery&lt;/strong&gt;; it was failing at &lt;strong&gt;verification of the response the device sent back&lt;/strong&gt;. Trusting that message is what sent me down the permissions rabbit hole.&lt;/p&gt;

&lt;p&gt;For confirmation I read the app side too. The firmware, the app, and the server for StackChan are all published in &lt;a href="https://github.com/m5stack/StackChan" rel="noopener noreferrer"&gt;m5stack/StackChan&lt;/a&gt; — the Flutter app source lives in the same repository. The device-selection screen has a 30-second connect timeout and a 20-second verification timeout, with failure messages such as &lt;code&gt;Device did not return encryption data.&lt;/code&gt; and &lt;code&gt;Device verification decryption failed.&lt;/code&gt;, and it registers the device with the server only after verification succeeds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Root cause: firmware version, plus a deadlock
&lt;/h2&gt;

&lt;p&gt;The boot log prints the version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I (690) app_init: Project name:     stack-chan
I (696) app_init: App version:      1.2.4
I (700) app_init: Compile time:     Apr 15 2026 09:18:33
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1.2.4&lt;/strong&gt;, while the latest official build that day was &lt;strong&gt;1.4.4&lt;/strong&gt; — nine versions apart.&lt;/p&gt;

&lt;p&gt;And that is where the loop from the top of this post bites: OTA needs Wi-Fi, Wi-Fi needs pairing, pairing fails on old firmware. &lt;strong&gt;USB is the only remaining path.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Note that &lt;strong&gt;building the firmware yourself does not help&lt;/strong&gt;. The handshake implementation in the public repository (&lt;code&gt;firmware/main/hal/utils/secret_logic/secret_logic.cpp&lt;/code&gt;) is a stub whose token function returns a fixed string. It is declared as a weak symbol, and the real implementation is linked in at official build time. &lt;strong&gt;Only the official binary can satisfy the app's verification step.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: flash the official firmware over USB, without M5Burner
&lt;/h2&gt;

&lt;p&gt;The official flashing tool is M5Burner (a GUI), but &lt;strong&gt;the firmware distribution API it uses is public&lt;/strong&gt;, so the whole thing can be done from the CLI. No Python required either.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. List the official firmware versions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"https://m5burner-api.m5stack.com/api/firmware"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | jq &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'.[] | select(.name=="StackChan-UserDemo") | .versions[] | "\(.version)  \(.published_at)  \(.file)"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The factory firmware is named &lt;strong&gt;&lt;code&gt;StackChan-UserDemo&lt;/code&gt;&lt;/strong&gt; (author: M5Stack):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;V1.2.4   2026-04-20  3c8ffe6be0ca26375d836e10e06e3609.bin
V1.4.3   2026-07-02  fb75fa818e63b7ee6b0d35eba308f386.bin
V1.4.4   2026-07-13  790e3fcde496020aa7f188153b23e6f0.bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Older versions stay available, so &lt;strong&gt;rolling back is possible too&lt;/strong&gt; — which makes updating a lot less scary.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Download the binary
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sL&lt;/span&gt; &lt;span class="s2"&gt;"https://m5burner-cdn.m5stack.com/firmware/790e3fcde496020aa7f188153b23e6f0.bin"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; stackchan-v1.4.4.bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the first byte is &lt;code&gt;e9&lt;/code&gt; (the ESP image magic), it is a merged full image to be written at offset &lt;code&gt;0x0&lt;/code&gt;:&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="nb"&gt;od&lt;/span&gt; &lt;span class="nt"&gt;-An&lt;/span&gt; &lt;span class="nt"&gt;-tx1&lt;/span&gt; &lt;span class="nt"&gt;-N&lt;/span&gt; 1 stackchan-v1.4.4.bin
&lt;span class="c"&gt;#  e9&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Get esptool (no Python needed)
&lt;/h3&gt;

&lt;p&gt;Espressif ships standalone executables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh api repos/espressif/esptool/releases/latest &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--jq&lt;/span&gt; &lt;span class="s1"&gt;'.assets[] | select(.name|test("windows-amd64")) | .browser_download_url'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Verify communication with a read-only command first
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\esptool.exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;COM3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;flash-id&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Detecting chip type... ESP32-S3
Chip type:          ESP32-S3 (QFN56) (revision v0.2)
USB mode:           USB-Serial/JTAG
Detected flash size: 16MB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;No manual download mode was necessary&lt;/strong&gt; — esptool resets the chip through USB-Serial/JTAG. If it cannot connect, hold the reset button for about 2 seconds and release it once the internal green LED lights up.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Flash
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\esptool.exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;COM3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;write-flash&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;0x0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;stackchan-v1.4.4.bin&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Wrote 12783792 bytes (3185393 compressed) at 0x00000000 in 47.7 seconds
Verifying written data...
Hash of data verified.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;About 50 seconds for just under 12.8 MB.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Confirm the version
&lt;/h3&gt;

&lt;p&gt;Look for &lt;code&gt;app_init: App version: 1.4.4&lt;/code&gt; in the boot log. With that in place, pairing succeeded on the first try, and I went straight through AI agent setup, Wi-Fi setup, and an actual voice conversation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other traps worth knowing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Opening the serial port reboots the device
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rst:0x15 (USB_UART_CHIP_RESET),boot:0x2b (SPI_FAST_FLASH_BOOT)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;You cannot capture logs and operate the device at the same time.&lt;/strong&gt; Opening the port in the middle of the setup wizard sends you back to the start (it did for me). The flip side is useful: if you want the boot log from the very first line, open the port and then trigger a reset.&lt;/p&gt;

&lt;h3&gt;
  
  
  There is no interactive serial console
&lt;/h3&gt;

&lt;p&gt;Sending commands produces no response, and the write itself blocks. Treat the serial port as read-only.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do not power both USB-C ports at once
&lt;/h3&gt;

&lt;p&gt;The unit has a USB-C port on the CoreS3 and another on the heel (base). 5V fed into the CoreS3 side is routed to the base through the M-BUS &lt;code&gt;BUS_5V&lt;/code&gt; line, so &lt;strong&gt;powering both ports puts two supplies on the same rail&lt;/strong&gt;. The official documentation's "try powering from both ports" means one at a time. The heel port is the recommended one for power and flashing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Servo zero positions survive a full flash erase
&lt;/h3&gt;

&lt;p&gt;I backed up NVS before flashing, but the same zero positions were read back afterwards (&lt;code&gt;[ScsServo] id: 1 get zero pos: 460 from settings&lt;/code&gt;). &lt;strong&gt;Those values appear to live in the servos themselves&lt;/strong&gt;, so a full-flash rewrite does not lose them.&lt;/p&gt;

&lt;h2&gt;
  
  
  A separate warning about charging
&lt;/h2&gt;

&lt;p&gt;The firmware sets the AXP2101 charge current to &lt;strong&gt;700mA&lt;/strong&gt; at boot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;ret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;setChargerConstantCurr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XPOWERS_AXP2101_CHG_CUR_700MA&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ESP32-S3 enumerates as a USB 2.0 device, so &lt;strong&gt;a PC USB port gives you 500mA at most&lt;/strong&gt;. Combined with the system draw (LCD, camera, servos, radio) that exceeds the input limit, and &lt;strong&gt;charging never starts from a PC port&lt;/strong&gt;. Use a USB charger with headroom at 5V.&lt;/p&gt;

&lt;p&gt;If the servos do not report their current position (&lt;code&gt;[ScsServo] ignore invalid current pos: -1&lt;/code&gt;), read that as another sign of insufficient power.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;No devices found&lt;/code&gt; &lt;strong&gt;did not describe what was happening&lt;/strong&gt;. The BLE connection and the handshake both succeeded; the failure was in response verification&lt;/li&gt;
&lt;li&gt;The real cause was &lt;strong&gt;old factory firmware&lt;/strong&gt;, fixed by flashing the latest official build over USB&lt;/li&gt;
&lt;li&gt;OTA ↔ Wi-Fi ↔ pairing form a loop, so &lt;strong&gt;USB flashing is the only exit&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not over-trust the error string — capture the log.&lt;/strong&gt; Every minute I spent re-checking permissions would have been saved by one serial capture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Scripts and the full write-up are in the repository:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/yasumorishima/stackchan-lab" rel="noopener noreferrer"&gt;https://github.com/yasumorishima/stackchan-lab&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Official docs: &lt;a href="https://docs.m5stack.com/en/stackchan" rel="noopener noreferrer"&gt;https://docs.m5stack.com/en/stackchan&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Firmware / app / server source: &lt;a href="https://github.com/m5stack/StackChan" rel="noopener noreferrer"&gt;https://github.com/m5stack/StackChan&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>m5stack</category>
      <category>esp32</category>
      <category>iot</category>
      <category>ble</category>
    </item>
    <item>
      <title>M5 StackChan pairing fails with \"No devices found\"? The factory firmware is the cause</title>
      <dc:creator>YMori</dc:creator>
      <pubDate>Sat, 25 Jul 2026 08:48:29 +0000</pubDate>
      <link>https://dev.to/yasumorishima/m5-stackchan-pairing-fails-with-no-devices-found-the-factory-firmware-is-the-cause-1od8</link>
      <guid>https://dev.to/yasumorishima/m5-stackchan-pairing-fails-with-no-devices-found-the-factory-firmware-is-the-cause-1od8</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;I bought the official M5Stack StackChan (&lt;code&gt;M5STACK-K151&lt;/code&gt;), and the "StackChan World" mobile app refused to finish setup: after selecting the device, it showed &lt;strong&gt;&lt;code&gt;No devices found&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The cause was &lt;strong&gt;not Bluetooth permissions and not an app bug — the factory firmware was simply too old&lt;/strong&gt;. After flashing the latest official firmware over USB, pairing went through on the first attempt.&lt;/p&gt;

&lt;p&gt;What makes this worth writing about is that the situation is &lt;strong&gt;a closed loop you cannot escape on the device itself&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New firmware arrives via OTA&lt;/li&gt;
&lt;li&gt;OTA needs Wi-Fi&lt;/li&gt;
&lt;li&gt;Wi-Fi setup needs app pairing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pairing fails on the old firmware&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So &lt;strong&gt;flashing over USB is the only way out&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment and dates
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Product&lt;/td&gt;
&lt;td&gt;M5StackChan AI Desktop Robot (ESP32-S3) / &lt;code&gt;M5STACK-K151&lt;/code&gt; (official assembled unit)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Purchased&lt;/td&gt;
&lt;td&gt;2026-07-24 (Switch Science, Japan)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Setup attempted&lt;/td&gt;
&lt;td&gt;2026-07-25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Factory firmware on the unit&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;1.2.4&lt;/strong&gt; (released 2026-04-20)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latest official firmware that day&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;1.4.4&lt;/strong&gt; (released 2026-07-13)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Host&lt;/td&gt;
&lt;td&gt;Windows 11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Phone&lt;/td&gt;
&lt;td&gt;Android&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The dates matter here.&lt;/strong&gt; This product launched in 2026-05 and both the firmware and the app are still being updated frequently. &lt;strong&gt;The firmware version that ships with a unit depends on when you buy it&lt;/strong&gt;, so whether you hit this problem depends on timing. If you buy stock that has been sitting for a few months, you are a good candidate for the same trap.&lt;/p&gt;

&lt;h2&gt;
  
  
  The symptom
&lt;/h2&gt;

&lt;p&gt;The setup flow is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Power on, pass the servo test&lt;/li&gt;
&lt;li&gt;The device shows a 12-digit ID&lt;/li&gt;
&lt;li&gt;In the app: "Add a new StackChan" → scan for nearby devices&lt;/li&gt;
&lt;li&gt;Pick the entry matching the ID on the device screen&lt;/li&gt;
&lt;li&gt;Set device name → AI agent → Wi-Fi&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 4 immediately produced &lt;code&gt;No devices found&lt;/code&gt;&lt;/strong&gt;, and step 5 was never reachable.&lt;/p&gt;

&lt;h2&gt;
  
  
  What did not help
&lt;/h2&gt;

&lt;p&gt;The message talks about devices not being found, so of course I attacked discovery first. None of this changed anything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Granting Bluetooth and location permissions to the app (verified from the OS settings, not just the in-app prompt)&lt;/li&gt;
&lt;li&gt;Turning location services on (BLE scanning on Android is entangled with location)&lt;/li&gt;
&lt;li&gt;Force-stopping and restarting the app, rebooting the phone&lt;/li&gt;
&lt;li&gt;Rebooting the device, returning to the ID screen before scanning&lt;/li&gt;
&lt;li&gt;Toggling Bluetooth off and on&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing I learned the hard way: &lt;strong&gt;do not pair from the OS Bluetooth settings screen.&lt;/strong&gt; If you bond the device at the OS level, it gets registered as a known device and &lt;strong&gt;disappears from the app's "find a new device" list&lt;/strong&gt;. I did exactly this while "just checking", which made the picture even muddier. If you already did it, remove the pairing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The serial log told a completely different story
&lt;/h2&gt;

&lt;p&gt;I stopped guessing about permissions and captured the USB serial log. When you connect the unit to a PC, the CoreS3 (ESP32-S3) native USB shows up as a serial port (&lt;code&gt;VID_303A&lt;/code&gt; / &lt;code&gt;PID_1001&lt;/code&gt;, USB-Serial/JTAG).&lt;/p&gt;

&lt;p&gt;Here is what the log showed while the app was "not finding" anything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;I (111140) NimBLE: connection established;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0
&lt;span class="go"&gt;I (111160) NimBLE:  peer_ota_addr_type=1 peer_ota_addr=
I (111160) NimBLE: 63:a2:04:c7:fa:5d
[info] [WifiConfigServer] app Connected
&lt;/span&gt;&lt;span class="gp"&gt;I (112260) NimBLE: Stack-Chan characteristic write;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;conn_handle&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nv"&gt;attr_handle&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;22
&lt;span class="go"&gt;I (112260) NimBLE: Config data received (42 bytes): {"cmd":"handshake","data":"1784964126892"}
&lt;/span&gt;&lt;span class="gp"&gt;I (112420) NimBLE: GATT procedure initiated: notify;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;I (112430) NimBLE: notify_tx event;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;conn_handle&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nv"&gt;attr_handle&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;22 &lt;span class="nv"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 &lt;span class="nv"&gt;is_indication&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0
&lt;span class="go"&gt;I (112440) NimBLE: Config notification sent
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reading that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The BLE connection was established&lt;/strong&gt; (&lt;code&gt;status=0&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The app was connected&lt;/strong&gt; (&lt;code&gt;app Connected&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The app sent a handshake&lt;/strong&gt; (&lt;code&gt;{"cmd":"handshake"}&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The device answered&lt;/strong&gt; (&lt;code&gt;Config notification sent&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;And then &lt;strong&gt;nothing more arrives from the app&lt;/strong&gt; — not even a disconnect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So &lt;code&gt;No devices found&lt;/code&gt; did not describe reality. The process was not failing at &lt;strong&gt;discovery&lt;/strong&gt;; it was failing at &lt;strong&gt;verification of the response the device sent back&lt;/strong&gt;. Trusting that message is what sent me down the permissions rabbit hole.&lt;/p&gt;

&lt;p&gt;For confirmation I read the app side too. The firmware, the app, and the server for StackChan are all published in &lt;a href="https://github.com/m5stack/StackChan" rel="noopener noreferrer"&gt;m5stack/StackChan&lt;/a&gt; — the Flutter app source lives in the same repository. The device-selection screen has a 30-second connect timeout and a 20-second verification timeout, with failure messages such as &lt;code&gt;Device did not return encryption data.&lt;/code&gt; and &lt;code&gt;Device verification decryption failed.&lt;/code&gt;, and it registers the device with the server only after verification succeeds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Root cause: firmware version, plus a deadlock
&lt;/h2&gt;

&lt;p&gt;The boot log prints the version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;I (690) app_init: Project name:     stack-chan
I (696) app_init: App version:      1.2.4
I (700) app_init: Compile time:     Apr 15 2026 09:18:33
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1.2.4&lt;/strong&gt;, while the latest official build that day was &lt;strong&gt;1.4.4&lt;/strong&gt; — nine versions apart.&lt;/p&gt;

&lt;p&gt;And that is where the loop from the top of this post bites: OTA needs Wi-Fi, Wi-Fi needs pairing, pairing fails on old firmware. &lt;strong&gt;USB is the only remaining path.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Note that &lt;strong&gt;building the firmware yourself does not help&lt;/strong&gt;. The handshake implementation in the public repository (&lt;code&gt;firmware/main/hal/utils/secret_logic/secret_logic.cpp&lt;/code&gt;) is a stub whose token function returns a fixed string. It is declared as a weak symbol, and the real implementation is linked in at official build time. &lt;strong&gt;Only the official binary can satisfy the app's verification step.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: flash the official firmware over USB, without M5Burner
&lt;/h2&gt;

&lt;p&gt;The official flashing tool is M5Burner (a GUI), but &lt;strong&gt;the firmware distribution API it uses is public&lt;/strong&gt;, so the whole thing can be done from the CLI. No Python required either.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. List the official firmware versions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="s2"&gt;"https://m5burner-api.m5stack.com/api/firmware"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | jq &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'.[] | select(.name=="StackChan-UserDemo") | .versions[] | "\(.version)  \(.published_at)  \(.file)"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The factory firmware is named &lt;strong&gt;&lt;code&gt;StackChan-UserDemo&lt;/code&gt;&lt;/strong&gt; (author: M5Stack):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;V1.2.4   2026-04-20  3c8ffe6be0ca26375d836e10e06e3609.bin
V1.4.3   2026-07-02  fb75fa818e63b7ee6b0d35eba308f386.bin
V1.4.4   2026-07-13  790e3fcde496020aa7f188153b23e6f0.bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Older versions stay available, so &lt;strong&gt;rolling back is possible too&lt;/strong&gt; — which makes updating a lot less scary.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Download the binary
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-sL&lt;/span&gt; &lt;span class="s2"&gt;"https://m5burner-cdn.m5stack.com/firmware/790e3fcde496020aa7f188153b23e6f0.bin"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-o&lt;/span&gt; stackchan-v1.4.4.bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the first byte is &lt;code&gt;e9&lt;/code&gt; (the ESP image magic), it is a merged full image to be written at offset &lt;code&gt;0x0&lt;/code&gt;:&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="nb"&gt;od&lt;/span&gt; &lt;span class="nt"&gt;-An&lt;/span&gt; &lt;span class="nt"&gt;-tx1&lt;/span&gt; &lt;span class="nt"&gt;-N&lt;/span&gt; 1 stackchan-v1.4.4.bin
&lt;span class="c"&gt;#  e9&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Get esptool (no Python needed)
&lt;/h3&gt;

&lt;p&gt;Espressif ships standalone executables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh api repos/espressif/esptool/releases/latest &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--jq&lt;/span&gt; &lt;span class="s1"&gt;'.assets[] | select(.name|test("windows-amd64")) | .browser_download_url'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Verify communication with a read-only command first
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\esptool.exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;COM3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;flash-id&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Detecting chip type... ESP32-S3
Chip type:          ESP32-S3 (QFN56) (revision v0.2)
USB mode:           USB-Serial/JTAG
Detected flash size: 16MB
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;No manual download mode was necessary&lt;/strong&gt; — esptool resets the chip through USB-Serial/JTAG. If it cannot connect, hold the reset button for about 2 seconds and release it once the internal green LED lights up.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Flash
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;\esptool.exe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;COM3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;write-flash&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;0x0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;stackchan-v1.4.4.bin&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Wrote 12783792 bytes (3185393 compressed) at 0x00000000 in 47.7 seconds
Verifying written data...
Hash of data verified.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;About 50 seconds for just under 12.8 MB.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Confirm the version
&lt;/h3&gt;

&lt;p&gt;Look for &lt;code&gt;app_init: App version: 1.4.4&lt;/code&gt; in the boot log. With that in place, pairing succeeded on the first try, and I went straight through AI agent setup, Wi-Fi setup, and an actual voice conversation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other traps worth knowing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Opening the serial port reboots the device
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;rst:0x15 (USB_UART_CHIP_RESET),boot:0x2b (SPI_FAST_FLASH_BOOT)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;You cannot capture logs and operate the device at the same time.&lt;/strong&gt; Opening the port in the middle of the setup wizard sends you back to the start (it did for me). The flip side is useful: if you want the boot log from the very first line, open the port and then trigger a reset.&lt;/p&gt;

&lt;h3&gt;
  
  
  There is no interactive serial console
&lt;/h3&gt;

&lt;p&gt;Sending commands produces no response, and the write itself blocks. Treat the serial port as read-only.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do not power both USB-C ports at once
&lt;/h3&gt;

&lt;p&gt;The unit has a USB-C port on the CoreS3 and another on the heel (base). 5V fed into the CoreS3 side is routed to the base through the M-BUS &lt;code&gt;BUS_5V&lt;/code&gt; line, so &lt;strong&gt;powering both ports puts two supplies on the same rail&lt;/strong&gt;. The official documentation's "try powering from both ports" means one at a time. The heel port is the recommended one for power and flashing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Servo zero positions survive a full flash erase
&lt;/h3&gt;

&lt;p&gt;I backed up NVS before flashing, but the same zero positions were read back afterwards (&lt;code&gt;[ScsServo] id: 1 get zero pos: 460 from settings&lt;/code&gt;). &lt;strong&gt;Those values appear to live in the servos themselves&lt;/strong&gt;, so a full-flash rewrite does not lose them.&lt;/p&gt;

&lt;h2&gt;
  
  
  A separate warning about charging
&lt;/h2&gt;

&lt;p&gt;The firmware sets the AXP2101 charge current to &lt;strong&gt;700mA&lt;/strong&gt; at boot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;ret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;setChargerConstantCurr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XPOWERS_AXP2101_CHG_CUR_700MA&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ESP32-S3 enumerates as a USB 2.0 device, so &lt;strong&gt;a PC USB port gives you 500mA at most&lt;/strong&gt;. Combined with the system draw (LCD, camera, servos, radio) that exceeds the input limit, and &lt;strong&gt;charging never starts from a PC port&lt;/strong&gt;. Use a USB charger with headroom at 5V.&lt;/p&gt;

&lt;p&gt;If the servos do not report their current position (&lt;code&gt;[ScsServo] ignore invalid current pos: -1&lt;/code&gt;), read that as another sign of insufficient power.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;No devices found&lt;/code&gt; &lt;strong&gt;did not describe what was happening&lt;/strong&gt;. The BLE connection and the handshake both succeeded; the failure was in response verification&lt;/li&gt;
&lt;li&gt;The real cause was &lt;strong&gt;old factory firmware&lt;/strong&gt;, fixed by flashing the latest official build over USB&lt;/li&gt;
&lt;li&gt;OTA ↔ Wi-Fi ↔ pairing form a loop, so &lt;strong&gt;USB flashing is the only exit&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do not over-trust the error string — capture the log.&lt;/strong&gt; Every minute I spent re-checking permissions would have been saved by one serial capture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Scripts and the full write-up are in the repository:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/yasumorishima/stackchan-lab" rel="noopener noreferrer"&gt;https://github.com/yasumorishima/stackchan-lab&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Official docs: &lt;a href="https://docs.m5stack.com/en/stackchan" rel="noopener noreferrer"&gt;https://docs.m5stack.com/en/stackchan&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Firmware / app / server source: &lt;a href="https://github.com/m5stack/StackChan" rel="noopener noreferrer"&gt;https://github.com/m5stack/StackChan&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>m5stack</category>
      <category>esp32</category>
      <category>iot</category>
      <category>ble</category>
    </item>
  </channel>
</rss>
