<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Anirudh Konidala</title><description>Blog posts by Anirudh Konidala</description><link>https://anirudh-konidala.vercel.app/</link><item><title>Why AI Finally Makes &quot;Rewrite It in Rust&quot; Worth It</title><link>https://anirudh-konidala.vercel.app/blog/rewrite-it-in-rust-with-ai/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/rewrite-it-in-rust-with-ai/</guid><description>Rust&apos;s strict compiler used to slow people down. When an AI agent writes the code, that compiler becomes the first reviewer of everything it writes. I walk through real compiler errors, the Bun and GitHub Copilot rewrites, where Rust falls short, and the Clippy and CLAUDE.md setup that makes an agent run the checks.</description><pubDate>Fri, 20 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;“Rewrite it in Rust”&lt;/strong&gt; has been a running joke for years. Someone opens a GitHub issue on a project written in &lt;strong&gt;C&lt;/strong&gt;, &lt;strong&gt;Python&lt;/strong&gt; or &lt;strong&gt;Go&lt;/strong&gt;, and the only suggestion is to throw it all away and start over in &lt;strong&gt;Rust&lt;/strong&gt;. There’s even a &lt;a href=&quot;https://github.com/ansuz/RIIR&quot;&gt;satirical GitHub repo&lt;/a&gt; dedicated to it.&lt;/p&gt;
&lt;p&gt;It was funny because rewrites are expensive, and Rust made them even more expensive. You had to learn the borrow checker, fight lifetimes, and wait for the compiler to agree with you before anything ran.&lt;/p&gt;
&lt;p&gt;Then AI agents started writing most of the code, and the joke started turning into a plan.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When an agent writes the code, Rust’s strict compiler stops being the thing that slows you down and becomes the first reviewer of everything the agent writes.&lt;/strong&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;what-rust-is-and-why-developers-like-it&quot;&gt;What Rust is and why developers like it&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Rust&lt;/strong&gt; is a programming language for the same kind of work as &lt;strong&gt;C&lt;/strong&gt; and &lt;strong&gt;C++&lt;/strong&gt;: operating systems, browsers, databases, command-line tools and anything else where speed and memory use matter. Graydon Hoare started it as a side project, Mozilla later sponsored it, and version 1.0 came out in May 2015.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;What makes Rust different is how it handles memory. C and C++ make you free memory yourself, which leads to bugs like reading memory after it was already freed. &lt;strong&gt;Python&lt;/strong&gt;, &lt;strong&gt;Java&lt;/strong&gt; and &lt;strong&gt;Go&lt;/strong&gt; use a garbage collector instead, a background process that frees memory for you but costs extra work while the program runs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rust does neither: every value has exactly one owner, and the compiler frees the value as soon as its owner goes away.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;On top of that, Rust has a &lt;strong&gt;borrow checker&lt;/strong&gt;, the part of the compiler that tracks references (pointers to a value that don’t own it). It enforces one rule: at any moment, a value can have many references that only read it, or one reference that changes it, but never both. &lt;strong&gt;Listing 1.2&lt;/strong&gt;, later in this post, shows it rejecting a real bug that breaks this rule.&lt;/p&gt;
&lt;p&gt;Breaking that rule is a compile error rather than a crash in production, so &lt;strong&gt;Rust runs about as fast as C++ while ruling out most memory bugs before the program ever runs.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Rust also comes with &lt;code&gt;cargo&lt;/code&gt;, its build tool and package manager, which downloads well-made &lt;strong&gt;crates&lt;/strong&gt; (Rust’s name for packages) like &lt;code&gt;tokio&lt;/code&gt;, &lt;code&gt;axum&lt;/code&gt; and &lt;code&gt;reqwest&lt;/code&gt;. Its compiler is known for unusually helpful error messages, too. Both matter a lot once an AI agent is writing the code, so I’ll come back to them.&lt;/p&gt;
&lt;p&gt;Developers who try Rust tend to stay with it: it was the most admired language in Stack Overflow’s 2025 Developer Survey, with &lt;strong&gt;72% of developers who used it wanting to keep using it&lt;/strong&gt;.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; In December 2025, Linux kernel maintainers agreed that Rust in the kernel “is no longer experimental” and is now “a core part of the kernel.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h2 id=&quot;what-changed&quot;&gt;What changed&lt;/h2&gt;
&lt;p&gt;In July 2024, &lt;strong&gt;DARPA&lt;/strong&gt;, the US military’s research agency, launched a program called &lt;strong&gt;TRACTOR&lt;/strong&gt; (Translating All C to Rust) that uses large language models alongside static and dynamic analysis to translate old C code into Rust.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;A year and a half later, in December 2025, Galen Hunt, a Distinguished Engineer at Microsoft, posted a job listing on LinkedIn with a big goal: &lt;strong&gt;“My goal is to eliminate every line of C and C++ from Microsoft by 2030,”&lt;/strong&gt; using a mix of AI and traditional program analysis to translate code into Rust. His team’s target was “1 engineer, 1 month, 1 million lines of code.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;After the post spread, he clarified that “Windows is &lt;em&gt;NOT&lt;/em&gt; being rewritten in Rust with AI” and that “My team’s project is a research project.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;6&lt;/a&gt;&lt;/sup&gt; Even as a research goal, a million lines per engineer per month only makes sense if writing code has become far cheaper than it used to be.&lt;/p&gt;
&lt;p&gt;Two months after Hunt’s post, two large AI-written Rust projects were published:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ladybird&lt;/strong&gt;, an independent web browser built from scratch, ported the front half of its JavaScript engine (the lexer, parser, syntax tree and bytecode generator) to Rust. Its founder, Andreas Kling, used Claude Code and Codex, and the port came to &lt;strong&gt;about 25,000 lines of Rust in about two weeks&lt;/strong&gt;, work he says “would have taken me multiple months to do by hand.” It had &lt;strong&gt;zero regressions across 52,898 test262 tests&lt;/strong&gt; (the official JavaScript conformance suite).&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;7&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Anthropic&lt;/strong&gt; had 16 Claude agents write a C compiler in Rust from scratch. Over nearly 2,000 Claude Code sessions and about $20,000 in API costs, they produced &lt;strong&gt;a 100,000-line compiler that can build Linux 6.9 on x86, ARM, and RISC-V&lt;/strong&gt;.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;8&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Kling says the port was “human-directed, not autonomous code generation,” with “hundreds of small prompts” and a rule that both engines produce “byte-for-byte identical output.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;7&lt;/a&gt;&lt;/sup&gt; Nicholas Carlini, the Anthropic researcher behind the compiler, wrote that most of his effort “went into designing the environment around Claude”: the tests, the environment and the feedback.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;8&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Neither project trusted the AI to be right, so both built something that checks its work automatically:&lt;/strong&gt; in Rust, the language itself does a big piece of that checking for you.&lt;/p&gt;
&lt;p&gt;In May 2026, the rewrites got bigger. Jarred Sumner, who created the JavaScript runtime &lt;strong&gt;Bun&lt;/strong&gt;, ported its 535,496 lines of Zig to Rust over 11 days, with about 64 Claude agents running at once and around $165,000 in API costs.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;9&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Bun leaned on the same kind of check. The port counted as done once 100% of Bun’s test suite passed on every platform, with “0 tests skipped or deleted,” and Claude Code has run on the Rust version of Bun since June.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;9&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h2 id=&quot;writing-code-got-cheap-checking-it-didnt&quot;&gt;Writing code got cheap, checking it didn’t&lt;/h2&gt;
&lt;p&gt;If you’ve used an AI coding agent, you know the loop: you describe a change, the agent writes it, and then somebody has to check that the code actually does what you asked. The agent is fast at the first step, so &lt;strong&gt;the speed of the whole loop depends on how quickly mistakes get caught&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In a language like Python, a lot of mistakes only show up when the code runs, and only if a test or a user happens to hit that exact path. In Rust, a large group of mistakes can’t make it past &lt;code&gt;cargo check&lt;/code&gt;, the command that compiles your project without building the final program.&lt;/p&gt;
&lt;p&gt;Say you ask an agent to add a &lt;code&gt;Cancelled&lt;/code&gt; state to an order status type. The agent adds the new variant to the enum (a type that can be exactly one of a fixed list of options), but it forgets a function somewhere else that turns each status into a label, as shown in &lt;strong&gt;Listing 1.1&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;rust&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;enum&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; OrderStatus&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;    Pending&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;    Shipped&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; tracking&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; String&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;    Delivered&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;    Cancelled&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; reason&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; String&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; },&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; // the agent added this&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; label&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;OrderStatus&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; String&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    match&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; status &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;        OrderStatus&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;Pending&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;waiting to ship&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;to_string&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;        OrderStatus&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;Shipped&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; tracking &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; format!&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;on the way (&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;tracking&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;)&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;        OrderStatus&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;Delivered&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;delivered&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;to_string&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-2 text-center&quot;&gt;&lt;strong&gt;Listing 1.1:&lt;/strong&gt; the agent added &lt;code&gt;Cancelled&lt;/code&gt; to the enum but missed the &lt;code&gt;match&lt;/code&gt; in &lt;code&gt;label&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Here’s what &lt;code&gt;cargo build&lt;/code&gt; gave me when I ran it:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;ansi&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;cargo&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-macchiato-font-weight:bold;--shiki-latte:#49af3d;--shiki-latte-font-weight:bold;--shiki-frappe:#8ec772;--shiki-frappe-font-weight:bold;--shiki-mocha:#89d88b;--shiki-mocha-font-weight:bold&quot;&gt;   Compiling&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt; orders v0.1.0 (/home/you/orders)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;error[E0004]&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;: non-exhaustive patterns: `&amp;amp;OrderStatus::Cancelled { .. }` not covered&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  --&amp;gt; &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;src/main.rs:9:11&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;   |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; 9&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;     match status {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;   |&lt;/span&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;           ^^^^^^&lt;/span&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt; pattern `&amp;amp;OrderStatus::Cancelled { .. }` not covered&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;   |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-macchiato-font-weight:bold;--shiki-latte:#49af3d;--shiki-latte-font-weight:bold;--shiki-frappe:#8ec772;--shiki-frappe-font-weight:bold;--shiki-mocha:#89d88b;--shiki-mocha-font-weight:bold&quot;&gt;note&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: `OrderStatus` defined here&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  --&amp;gt; &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;src/main.rs:1:6&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;   |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt; enum OrderStatus {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;   |&lt;/span&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-macchiato-font-weight:bold;--shiki-latte:#49af3d;--shiki-latte-font-weight:bold;--shiki-frappe:#8ec772;--shiki-frappe-font-weight:bold;--shiki-mocha:#89d88b;--shiki-mocha-font-weight:bold&quot;&gt;      ^^^^^^^^^^^&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; 5&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;     Cancelled { reason: String }, // the agent added this&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;   |&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;     ---------&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; not covered&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;   = &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;note&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: the matched value is of type `&amp;amp;OrderStatus`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#63cbc0;--shiki-macchiato-font-weight:bold;--shiki-latte:#2d9fa8;--shiki-latte-font-weight:bold;--shiki-frappe:#5abfb5;--shiki-frappe-font-weight:bold;--shiki-mocha:#6bd7ca;--shiki-mocha-font-weight:bold&quot;&gt;help&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;   |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-latte:#49af3d;--shiki-frappe:#8ec772;--shiki-mocha:#89d88b&quot;&gt; ~ &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;        OrderStatus::Delivered =&amp;gt; &amp;quot;delivered&amp;quot;.to_string()&lt;/span&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-latte:#49af3d;--shiki-frappe:#8ec772;--shiki-mocha:#89d88b&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;13&lt;/span&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-latte:#49af3d;--shiki-frappe:#8ec772;--shiki-mocha:#89d88b&quot;&gt; ~         &amp;amp;OrderStatus::Cancelled { .. } =&amp;gt; todo!()&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;   |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;For more information about this error, try `rustc --explain E0004`.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: could not compile `orders` (bin &amp;quot;orders&amp;quot;) due to 1 previous error&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;The compiler found the exact function the agent forgot, pointed at the variant that caused it, and suggested the fix.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In a real project with fifty &lt;code&gt;match&lt;/code&gt; statements over that enum, it would list every single one. The agent reads this, adds the missing arms, and runs &lt;code&gt;cargo check&lt;/code&gt; again, all before you look at anything.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Maddy Zhang&lt;/strong&gt; is a senior software engineer who used to work at Google, and she’s also a popular tech content creator: her YouTube channel has over 100,000 subscribers and more than 500 videos about software engineering, AI and tech careers.&lt;/p&gt;
&lt;p&gt;She makes the same point in her video &lt;a href=&quot;https://youtu.be/QRnfDHVSwZI&quot;&gt;“I Spent 1000+ Hours Learning Rust. This Is What I Learned”&lt;/a&gt;: &lt;strong&gt;“A coding agent, after all, is a loop. Write code, check it, fix it, repeat. And that loop is only as good as its checking condition.”&lt;/strong&gt;&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;10&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;I’ll call this &lt;strong&gt;the compiler loop&lt;/strong&gt;, and it’s shown in &lt;strong&gt;Figure 1.1&lt;/strong&gt;:&lt;/p&gt;
&lt;figure class=&quot;mermaid-diagram&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 544.0374999999999 412.2&quot; width=&quot;544.0374999999999&quot; height=&quot;412.2&quot; style=&quot;--bg:var(--color-nvim-bg-hard);--fg:var(--color-nvim-fg);--line:var(--color-nvim-gray);--accent:var(--color-nvim-orange);--muted:var(--color-nvim-fg2);--surface:var(--color-nvim-bg1);--border:var(--color-nvim-bg3)&quot;&gt; &lt;defs&gt; &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;7&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt; &lt;polygon points=&quot;0 0, 8 2.5, 0 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;marker id=&quot;arrowhead-start&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;1&quot; refY=&quot;2.5&quot; orient=&quot;auto-start-reverse&quot;&gt; &lt;polygon points=&quot;8 0, 0 2.5, 8 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;/defs&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;A&quot; data-to=&quot;B&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;81.98333333333332,359.3 81.98333333333332,347.3 46.337500000000006,347.3 46.337500000000006,262.40000000000003 96.32708333333332,262.40000000000003 96.32708333333332,52.900000000000006&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;C&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;errors&quot; points=&quot;157.5145833333333,52.900000000000006 157.5145833333333,194.10000000000002 162.36249999999995,194.10000000000002 162.36249999999995,262.40000000000003 141.52083333333331,262.40000000000003 141.52083333333331,274.40000000000003&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;C&quot; data-to=&quot;A&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;183.6125,311.3 183.6125,347.3 147.96666666666664,347.3 147.96666666666664,359.3&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;D&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;clean&quot; points=&quot;218.7020833333333,52.900000000000006 218.7020833333333,64.9 333.35833333333323,64.9 333.3583333333333,145.2&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;D&quot; data-to=&quot;C&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;failures&quot; points=&quot;313.3666666666666,182.10000000000002 313.3666666666666,194.10000000000002 229.72916666666663,194.10000000000002 229.72916666666663,262.40000000000003 225.70416666666665,262.40000000000003 225.70416666666665,274.40000000000003&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;D&quot; data-to=&quot;E&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;passing&quot; points=&quot;353.3499999999999,182.10000000000002 353.3499999999999,194.10000000000002 432.9625,194.10000000000002 432.9625,274.40000000000003&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;B&quot; data-to=&quot;C&quot; data-label=&quot;errors&quot;&gt; &lt;rect x=&quot;133.36249999999995&quot; y=&quot;201.10000000000002&quot; width=&quot;57.25&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;161.98749999999995&quot; y=&quot;216.25000000000003&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;errors&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;B&quot; data-to=&quot;D&quot; data-label=&quot;clean&quot;&gt; &lt;rect x=&quot;307.8583333333333&quot; y=&quot;71.9&quot; width=&quot;50.65&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;333.1833333333333&quot; y=&quot;87.05000000000001&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;clean&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;D&quot; data-to=&quot;C&quot; data-label=&quot;failures&quot;&gt; &lt;rect x=&quot;194.22916666666663&quot; y=&quot;201.10000000000002&quot; width=&quot;70.44999999999999&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;229.45416666666662&quot; y=&quot;216.25000000000003&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;failures&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;D&quot; data-to=&quot;E&quot; data-label=&quot;passing&quot;&gt; &lt;rect x=&quot;400.9625&quot; y=&quot;201.10000000000002&quot; width=&quot;63.849999999999994&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;432.8875&quot; y=&quot;216.25000000000003&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;passing&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;A&quot; data-label=&quot;Agent edits the code&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;16&quot; y=&quot;359.3&quot; width=&quot;197.95&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;114.975&quot; y=&quot;377.75&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Agent edits the code&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;B&quot; data-label=&quot;cargo check / cargo clippy&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;35.13958333333332&quot; y=&quot;16&quot; width=&quot;244.74999999999997&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;157.5145833333333&quot; y=&quot;34.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;cargo check / cargo clippy&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;C&quot; data-label=&quot;Agent reads the diagnostics&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;57.337500000000006&quot; y=&quot;274.40000000000003&quot; width=&quot;252.54999999999998&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;183.6125&quot; y=&quot;292.85&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Agent reads the diagnostics&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;D&quot; data-label=&quot;cargo test&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;273.38333333333327&quot; y=&quot;145.2&quot; width=&quot;119.95&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;333.3583333333333&quot; y=&quot;163.64999999999998&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;cargo test&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;E&quot; data-label=&quot;You review the diff&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;337.88749999999993&quot; y=&quot;274.40000000000003&quot; width=&quot;190.14999999999998&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;432.9624999999999&quot; y=&quot;292.85&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;You review the diff&lt;/text&gt; &lt;/g&gt; &lt;/svg&gt;&lt;/figure&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.1:&lt;/strong&gt; the compiler loop, where the compiler and tests reject wrong code before a person reviews it&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the time a diff reaches you, a whole category of mistakes is already gone&lt;/strong&gt;, so your review can focus on whether the code does what you asked.&lt;/p&gt;
&lt;h2 id=&quot;four-reasons-rust-works-well-with-ai-agents&quot;&gt;Four reasons Rust works well with AI agents&lt;/h2&gt;
&lt;p&gt;Every typed language has a compiler loop to some degree. &lt;strong&gt;Rust’s compiler checks more than most and explains clearly what it found, and &lt;code&gt;cargo&lt;/code&gt; makes the rest of the loop easy for an agent:&lt;/strong&gt; here are the four reasons I think matter most, in order.&lt;/p&gt;
&lt;h3 id=&quot;the-errors-are-written-for-whoever-tries-next&quot;&gt;The errors are written for whoever tries next&lt;/h3&gt;
&lt;p&gt;Rust’s error messages are this detailed on purpose. In 2016, the Rust team redesigned them around the idea that &lt;strong&gt;“errors should focus on the code you wrote,”&lt;/strong&gt; and borrowed from Elm, a language famous for friendly errors, for the longer explanations that &lt;code&gt;rustc --explain&lt;/code&gt; prints.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;11&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Look back at the E0004 error that &lt;code&gt;cargo build&lt;/code&gt; gave for &lt;strong&gt;Listing 1.1&lt;/strong&gt;: it names the missing case, shows where the type is defined, and prints a patch. If the agent still doesn’t understand it, &lt;code&gt;rustc --explain E0004&lt;/code&gt; prints a full explanation with examples. &lt;code&gt;cargo check --message-format=json&lt;/code&gt; gives the same diagnostics as &lt;strong&gt;JSON&lt;/strong&gt;, which tools can read without parsing text.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Clear, specific errors are exactly what an AI agent needs, because the agent’s next attempt is only as good as the feedback it gets.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A GoDaddy engineering post on porting services to Rust with agents puts it this way: “the compiler’s diagnostics are structured, precise, and closely tied to correctness guarantees.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;12&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;In 2023, Microsoft Research built &lt;strong&gt;RustAssistant&lt;/strong&gt;, a tool that feeds Rust compile errors to GPT-4 and asks it for a fix. On real compile errors taken from commits in popular open-source Rust crates, it fixed &lt;strong&gt;73.63% of them&lt;/strong&gt;.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;13&lt;/a&gt;&lt;/sup&gt; That was with GPT-4, a model that is now more than three years old.&lt;/p&gt;
&lt;h3 id=&quot;the-borrow-checker-catches-what-a-reviewer-misses&quot;&gt;The borrow checker catches what a reviewer misses&lt;/h3&gt;
&lt;p&gt;The code in &lt;strong&gt;Listing 1.2&lt;/strong&gt; looks harmless: it takes a reference to the first item in a list, then adds another item, then uses the reference.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;rust&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; mut&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; queue &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; vec!&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;first&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; head &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;queue&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;queue&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;push&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;second&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;println!&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-2 text-center&quot;&gt;&lt;strong&gt;Listing 1.2:&lt;/strong&gt; &lt;code&gt;head&lt;/code&gt; points at the first item in &lt;code&gt;queue&lt;/code&gt;, and &lt;code&gt;push&lt;/code&gt; changes &lt;code&gt;queue&lt;/code&gt; while &lt;code&gt;head&lt;/code&gt; is still in use&lt;/p&gt;
&lt;p&gt;Here’s the error:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;ansi&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;cargo&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-macchiato-font-weight:bold;--shiki-latte:#49af3d;--shiki-latte-font-weight:bold;--shiki-frappe:#8ec772;--shiki-frappe-font-weight:bold;--shiki-mocha:#89d88b;--shiki-mocha-font-weight:bold&quot;&gt;   Compiling&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt; orders v0.1.0 (/home/you/orders)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;error[E0502]&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;: cannot borrow `queue` as mutable because it is also borrowed as immutable&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; --&amp;gt; &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;src/main.rs:4:5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;     let head = &amp;amp;queue[0];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;                 -----&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; immutable borrow occurs here&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;     queue.push(String::from(&amp;quot;second&amp;quot;));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;/span&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt; mutable borrow occurs here&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;     println!(&amp;quot;{head}&amp;quot;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;                ----&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; immutable borrow later used here&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;For more information about this error, try `rustc --explain E0502`.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: could not compile `orders` (bin &amp;quot;orders&amp;quot;) due to 1 previous error&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When a list grows past its capacity, it moves to a bigger block of memory, so &lt;code&gt;head&lt;/code&gt; could end up pointing at memory that was freed. &lt;strong&gt;In C++, the same code compiles without a single warning, and it might even work for a while before it crashes or corrupts data, while Rust refuses to build it at all.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is the kind of bug that is hardest to catch in review, because the code reads correctly. Google has measured what removing it is worth. In November 2025, the Android team reported these results from Rust code in Android&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;14&lt;/a&gt;&lt;/sup&gt;, shown in &lt;strong&gt;Table 1.1&lt;/strong&gt;:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Measure&lt;/th&gt;
&lt;th&gt;Rust vs. C and C++&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Memory safety vulnerability density&lt;/td&gt;
&lt;td&gt;about 1000x lower&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rollback rate for medium and large changes&lt;/td&gt;
&lt;td&gt;about 4x lower&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time spent in code review&lt;/td&gt;
&lt;td&gt;about 25% less&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.1:&lt;/strong&gt; Google’s comparison of Rust and C/C++ changes in Android, from its November 2025 security blog&lt;/p&gt;
&lt;p&gt;The 1000x figure comes with a caveat that Google states itself: it’s an estimate based on &lt;strong&gt;one&lt;/strong&gt; potential memory safety vulnerability found in roughly 5 million lines of Rust, compared to about 1,000 per million lines in C and C++.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;14&lt;/a&gt;&lt;/sup&gt; &lt;strong&gt;Still, fewer rollbacks and faster reviews are the two numbers I care about most when an agent is the one writing the changes.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;failure-shows-up-in-the-functions-signature&quot;&gt;Failure shows up in the function’s signature&lt;/h3&gt;
&lt;p&gt;In most languages, a function can throw an exception that its signature never mentions. &lt;strong&gt;Listing 1.3&lt;/strong&gt; shows this in &lt;strong&gt;Python&lt;/strong&gt;: &lt;code&gt;parse_port&lt;/code&gt; promises to return an &lt;code&gt;int&lt;/code&gt;, and nothing in &lt;code&gt;def parse_port(raw: str) -&amp;gt; int&lt;/code&gt; says it can fail:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; parse_port&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;raw&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; str&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;raw&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;strip&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;())&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;port &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; parse_port&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;abc&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;f&amp;quot;listening on &lt;/span&gt;&lt;span style=&quot;color:#F5BDE6;--shiki-latte:#EA76CB;--shiki-frappe:#F4B8E4;--shiki-mocha:#F5C2E7&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;port&lt;/span&gt;&lt;span style=&quot;color:#F5BDE6;--shiki-latte:#EA76CB;--shiki-frappe:#F4B8E4;--shiki-mocha:#F5C2E7&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-2 text-center&quot;&gt;&lt;strong&gt;Listing 1.3:&lt;/strong&gt; &lt;code&gt;parse_port&lt;/code&gt; in Python, whose signature doesn’t mention that it can raise a &lt;code&gt;ValueError&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Here’s what happens when it gets text that isn’t a number:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;ansi&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;python3&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;main.py&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;Traceback (most recent call last):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;  File &lt;/span&gt;&lt;span style=&quot;color:#f5bde6;--shiki-latte:#ea76cb;--shiki-frappe:#f4b8e4;--shiki-mocha:#f5c2e7&quot;&gt;&amp;quot;/home/you/orders/main.py&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;, line &lt;/span&gt;&lt;span style=&quot;color:#f5bde6;--shiki-latte:#ea76cb;--shiki-frappe:#f4b8e4;--shiki-mocha:#f5c2e7&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;, in &lt;/span&gt;&lt;span style=&quot;color:#f5bde6;--shiki-latte:#ea76cb;--shiki-frappe:#f4b8e4;--shiki-mocha:#f5c2e7&quot;&gt;&amp;lt;module&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;    port = parse_port(&amp;quot;abc&amp;quot;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;  File &lt;/span&gt;&lt;span style=&quot;color:#f5bde6;--shiki-latte:#ea76cb;--shiki-frappe:#f4b8e4;--shiki-mocha:#f5c2e7&quot;&gt;&amp;quot;/home/you/orders/main.py&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;, line &lt;/span&gt;&lt;span style=&quot;color:#f5bde6;--shiki-latte:#ea76cb;--shiki-frappe:#f4b8e4;--shiki-mocha:#f5c2e7&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;, in &lt;/span&gt;&lt;span style=&quot;color:#f5bde6;--shiki-latte:#ea76cb;--shiki-frappe:#f4b8e4;--shiki-mocha:#f5c2e7&quot;&gt;parse_port&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;    return int(raw.strip())&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#f5bde6;--shiki-macchiato-font-weight:bold;--shiki-latte:#ea76cb;--shiki-latte-font-weight:bold;--shiki-frappe:#f4b8e4;--shiki-frappe-font-weight:bold;--shiki-mocha:#f5c2e7;--shiki-mocha-font-weight:bold&quot;&gt;ValueError&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color:#f5bde6;--shiki-latte:#ea76cb;--shiki-frappe:#f4b8e4;--shiki-mocha:#f5c2e7&quot;&gt;invalid literal for int() with base 10: &amp;#39;abc&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Python only finds out at runtime, when bad input actually reaches the function.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In Rust, a function that can fail returns a &lt;code&gt;Result&amp;lt;T, E&amp;gt;&lt;/code&gt;, which is either a &lt;strong&gt;value&lt;/strong&gt; (on success) or an &lt;strong&gt;error&lt;/strong&gt; (on failure), and the caller has to deal with both. In &lt;strong&gt;Listing 1.4&lt;/strong&gt;, &lt;code&gt;parse_port&lt;/code&gt; turns text like &lt;code&gt;&amp;quot;8080&amp;quot;&lt;/code&gt; into a port number. Its signature says it returns a &lt;code&gt;Result&lt;/code&gt;, because the text might not be a number, and &lt;code&gt;main&lt;/code&gt; then tries to use that result as a plain &lt;code&gt;u16&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;rust&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; parse_port&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;raw&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; &amp;amp;&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; Result&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;u16&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt; std&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;num&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;ParseIntError&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    raw&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;trim&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;parse&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; port&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; u16&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; parse_port&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;8080&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;    println!&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;listening on &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;port&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-2 text-center&quot;&gt;&lt;strong&gt;Listing 1.4:&lt;/strong&gt; &lt;code&gt;parse_port&lt;/code&gt; in Rust returns a &lt;code&gt;Result&lt;/code&gt;, and &lt;code&gt;main&lt;/code&gt; tries to use it as a plain &lt;code&gt;u16&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Here’s the error:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;ansi&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;cargo&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;build&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-macchiato-font-weight:bold;--shiki-latte:#49af3d;--shiki-latte-font-weight:bold;--shiki-frappe:#8ec772;--shiki-frappe-font-weight:bold;--shiki-mocha:#89d88b;--shiki-mocha-font-weight:bold&quot;&gt;   Compiling&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt; orders v0.1.0 (/home/you/orders)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;error[E0308]&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;: mismatched types&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; --&amp;gt; &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;src/main.rs:6:21&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;     let port: u16 = parse_port(&amp;quot;8080&amp;quot;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;               ---&lt;/span&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;   ^^^^^^^^^^^^^^^^^^&lt;/span&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt; expected `u16`, found `Result&amp;lt;u16, ParseIntError&amp;gt;`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;               |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;               expected due to this&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  = &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;note&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: expected type `&lt;/span&gt;&lt;span style=&quot;color:#f5bde6;--shiki-macchiato-font-weight:bold;--shiki-latte:#ea76cb;--shiki-latte-font-weight:bold;--shiki-frappe:#f4b8e4;--shiki-frappe-font-weight:bold;--shiki-mocha:#f5c2e7;--shiki-mocha-font-weight:bold&quot;&gt;u16&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;             found enum `&lt;/span&gt;&lt;span style=&quot;color:#f5bde6;--shiki-macchiato-font-weight:bold;--shiki-latte:#ea76cb;--shiki-latte-font-weight:bold;--shiki-frappe:#f4b8e4;--shiki-frappe-font-weight:bold;--shiki-mocha:#f5c2e7;--shiki-mocha-font-weight:bold&quot;&gt;Result&amp;lt;u16, ParseIntError&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#63cbc0;--shiki-macchiato-font-weight:bold;--shiki-latte:#2d9fa8;--shiki-latte-font-weight:bold;--shiki-frappe:#5abfb5;--shiki-frappe-font-weight:bold;--shiki-mocha:#6bd7ca;--shiki-mocha-font-weight:bold&quot;&gt;help&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: consider using `Result::expect` to unwrap the `Result&amp;lt;u16, ParseIntError&amp;gt;` value, panicking if the value is a `Result::Err`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; | &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;    let port: u16 = parse_port(&amp;quot;8080&amp;quot;)&lt;/span&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-latte:#49af3d;--shiki-frappe:#8ec772;--shiki-mocha:#89d88b&quot;&gt;.expect(&amp;quot;REASON&amp;quot;)&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-latte:#49af3d;--shiki-frappe:#8ec772;--shiki-mocha:#89d88b&quot;&gt;                                       +++++++++++++++++&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;For more information about this error, try `rustc --explain E0308`.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: could not compile `orders` (bin &amp;quot;orders&amp;quot;) due to 1 previous error&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;The compiler won’t let the caller pretend the error case doesn’t exist:&lt;/strong&gt; to get the &lt;code&gt;u16&lt;/code&gt; out, the code has to handle the error with a &lt;code&gt;match&lt;/code&gt;, pass it up to its own caller with &lt;code&gt;?&lt;/code&gt;, or crash on purpose with &lt;code&gt;unwrap()&lt;/code&gt; or &lt;code&gt;expect()&lt;/code&gt;. Clippy can block &lt;code&gt;unwrap()&lt;/code&gt;, which I’ll set up later in this post.&lt;/p&gt;
&lt;p&gt;That matters for agents more than I expected. Armin Ronacher, the creator of the &lt;strong&gt;Python&lt;/strong&gt; web framework Flask, has been writing about how languages work with agents, and he noticed that “Agents struggle with exceptions, they are afraid of them.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;15&lt;/a&gt;&lt;/sup&gt; &lt;strong&gt;When errors are ordinary return values, the agent can see every way a function can fail just by reading its type&lt;/strong&gt;, and the compiler complains when it ignores one.&lt;/p&gt;
&lt;h3 id=&quot;one-toolchain-that-every-agent-already-knows&quot;&gt;One toolchain that every agent already knows&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;cargo&lt;/code&gt; is one tool that builds your code, runs your tests, and downloads crates from crates.io, Rust’s package registry. It also formats and lints your project, with the same commands in every repository: &lt;code&gt;cargo build&lt;/code&gt;, &lt;code&gt;cargo test&lt;/code&gt;, &lt;code&gt;cargo fmt&lt;/code&gt; and &lt;code&gt;cargo clippy&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You don’t have to pick a build tool or work out which virtual environment is active. Ronacher put it plainly: “What makes agents fail or succeed in many languages is just how good the build tools are.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;15&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Rust’s compiler used to be the price you paid before your code ran. With an agent writing the code, it’s the review you get before you read it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;why-the-tools-around-ai-are-moving-to-rust&quot;&gt;Why the tools around AI are moving to Rust&lt;/h2&gt;
&lt;p&gt;The models themselves run on GPUs in data centers. What’s moving to Rust is the software around them: the CLI in your terminal, the agent loop that reads files and runs commands, and the runtime that streams answers back. &lt;strong&gt;Tools like these get three practical wins from Rust: they start faster, use less memory, and install as a single file.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;GitHub’s port of the runtime behind &lt;strong&gt;Copilot&lt;/strong&gt; shows the first two. The old runtime ran on Node.js, so every app that used it paid for “a whole second language runtime per client, on the order of 100 MB of working set minimum.” In GitHub’s benchmark table, creating a client and session and finishing one turn took 5.25 seconds before the port and 292 milliseconds with the Rust runtime running in process.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;16&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Memory dropped too. With ten clients running at once, the old runtime peaked at 1,383 MB, and the Rust one running in process peaked at 126 MB.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;16&lt;/a&gt;&lt;/sup&gt; &lt;strong&gt;That difference adds up fast when several agents share one laptop.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;GitHub moved about 430,000 lines of TypeScript to more than 832,000 lines of Rust in roughly fourteen and a half weeks, and “AI agents wrote most of the code.” The post is careful not to oversell it, though: “This is in no way a claim that every large TypeScript program should become Rust.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;16&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;The third win, installing as a single file, was one of OpenAI’s reasons for rewriting Codex, and &lt;strong&gt;many of the tools agents run on are already written in Rust&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OpenAI rewrote its Codex CLI agent from &lt;strong&gt;TypeScript&lt;/strong&gt; to Rust in 2025, listing a “Zero-dependency Install,” “Native Security Bindings” for sandboxing on Linux, and “no runtime garbage collection, resulting in lower memory consumption” as reasons.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;17&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;Claude Code’s search is built on ripgrep, a fast search tool written in Rust, and ships with its own copy of it.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;18&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;In March 2026, OpenAI announced it would acquire Astral, the company behind uv, Ruff and ty, which are Python tools written in Rust, and bring the team into Codex.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;19&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-downsides-of-rust-for-ai-written-code&quot;&gt;The downsides of Rust for AI-written code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;The evidence doesn’t support calling Rust the perfect language for AI, and I think the weak spots are just as useful to understand as the strong ones.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;ai-writes-more-broken-rust-than-anything-else&quot;&gt;AI writes more broken Rust than anything else&lt;/h3&gt;
&lt;p&gt;In August 2026, researchers at the University of Coimbra published a study of 86,726 code samples with compile or runtime errors, generated by seven language models in four compiled languages.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;20&lt;/a&gt;&lt;/sup&gt; In &lt;strong&gt;Table 1.2&lt;/strong&gt;, I’ve listed how many samples failed to compile in each language:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Samples that failed to compile&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Rust&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;23,416&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;C&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;12,304&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;C++&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;9,953&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Java&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;6,996&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.2:&lt;/strong&gt; compile failures by language across seven models, from “Unreliable in Practice? A Comprehensive Study of Errors in LLM-Generated Code”&lt;/p&gt;
&lt;p&gt;Rust had &lt;strong&gt;almost twice as many compile failures as C&lt;/strong&gt;, and 16.7% of its compile errors were about ownership and lifetimes, a kind of error the other three languages can’t have. The authors’ explanation is that “Rust enforces stricter compile-time checks, resulting in more frequent compilation errors.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;20&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;One way to read this is that Rust moves errors from runtime to compile time, which is the whole point of the compiler loop. But the models in the study fixed only &lt;strong&gt;12.9% of ownership and lifetime errors&lt;/strong&gt; within two retries that included test feedback.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;20&lt;/a&gt;&lt;/sup&gt; &lt;strong&gt;Catching a mistake is only useful if the agent can then fix it, and the borrow checker is still where agents struggle the most.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;translating-old-code-is-still-hard&quot;&gt;Translating old code is still hard&lt;/h3&gt;
&lt;p&gt;CRUST-Bench, a benchmark from UT Austin and NYU, asks models to translate 100 C repositories into safe Rust that passes the original tests. Models translated &lt;strong&gt;13% to 22% of the projects in a single attempt&lt;/strong&gt;, and the best setup, OpenAI’s o3 repairing its work using both compiler errors and test failures, reached &lt;strong&gt;48%&lt;/strong&gt;.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;21&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ladybird and Anthropic got much better results because a person directed every step or a nearly perfect test suite checked every change:&lt;/strong&gt; both still say the resulting Rust code isn’t great. Kling writes “We know the result isn’t idiomatic Rust,”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;7&lt;/a&gt;&lt;/sup&gt; and Carlini says the compiler’s code “is nowhere near the quality of what an expert Rust programmer might produce.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;8&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h3 id=&quot;the-compiler-cant-check-your-logic&quot;&gt;The compiler can’t check your logic&lt;/h3&gt;
&lt;p&gt;On November 18, 2025, Cloudflare had what it called its “worst outage since 2019.” A database permissions change made a configuration file for its bot detection system double in size. Its new proxy, written in Rust, had a limit of 200 entries for that file (it normally used about 60), and when the bigger file arrived, the code panicked with this message:&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;22&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;thread fl2_worker_thread panicked: called Result::unwrap() on an Err value&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;unwrap()&lt;/code&gt; means “give me the value, and crash if this is an error.” &lt;strong&gt;The compiler made the failure case visible, since the code had to say &lt;code&gt;unwrap()&lt;/code&gt; out loud, but it can’t decide for you whether crashing is acceptable.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That’s a judgment call, and an agent will make it wrong if nothing stops it. Later in this post, I’ll show you how to make Clippy reject &lt;code&gt;unwrap()&lt;/code&gt; in your own projects.&lt;/p&gt;
&lt;h3 id=&quot;go-might-be-simpler-for-agents&quot;&gt;Go might be simpler for agents&lt;/h3&gt;
&lt;p&gt;Ronacher, the same person I quoted earlier, recommends &lt;strong&gt;Go&lt;/strong&gt; over Rust. In his June 2025 post on agentic coding, he wrote “I strongly recommend Go for new backend projects,” noting that “In Rust, agents sometimes fail because they misunderstand &lt;code&gt;cargo test&lt;/code&gt;’s invocation syntax,” and that “Simple code significantly outperforms complex code in agentic contexts.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;23&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;More recently, he argued that “LLMs make language choice much less consequential than it used to be,” while also noticing people shipping Rust “who previously might not have chosen it.”&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;24&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;I think he’s right that an agent gets Go code to compile more easily. &lt;strong&gt;But Go’s compiler also accepts more wrong programs&lt;/strong&gt;, so more of the checking falls back to tests and to you.&lt;/p&gt;
&lt;h3 id=&quot;rust-is-slow-to-compile-and-hard-to-learn&quot;&gt;Rust is slow to compile and hard to learn&lt;/h3&gt;
&lt;p&gt;Rust’s own community names these costs. The 2025 State of Rust Survey collected 7,156 responses, and the Rust team wrote that “concerns persist about the language becoming more and more complex” and that “resource usage (slow compile times and storage usage) is still up there” among the problems that limit productivity.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;25&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Slow compiles hit the compiler loop directly, because the agent waits on &lt;code&gt;cargo check&lt;/code&gt; every round. Rust also has an escape hatch: code inside an &lt;code&gt;unsafe&lt;/code&gt; block can do things the compiler can’t verify, like calling C libraries, and the programmer has to follow the rules there by hand. &lt;strong&gt;Even Bun’s port keeps about 4% of its Rust code inside &lt;code&gt;unsafe&lt;/code&gt; blocks&lt;/strong&gt;, where the compiler checks less.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;9&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;h3 id=&quot;why-rust-is-still-worth-it&quot;&gt;Why Rust is still worth it&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Most of these downsides cost you time before the code ships, while the bugs Rust rules out cost you after it ships.&lt;/strong&gt; The extra compile failures in the Coimbra study are mistakes the compiler caught before the code ever ran. Agents still struggle to fix ownership errors, but an agent stuck on a compile error is easier to deal with than a memory bug in production.&lt;/p&gt;
&lt;p&gt;The other costs are easier to manage than they sound. &lt;code&gt;cargo check&lt;/code&gt; skips building the final program, so each round of the loop is faster than a full build. Code inside &lt;code&gt;unsafe&lt;/code&gt; is marked with that keyword, so a reviewer can search for every place the compiler checks less. For the logic the compiler can’t check, Clippy and tests take over, and the next section sets both up.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;An agent needs more tries before its Rust code compiles, and that’s a trade I’d honestly take every time.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;setting-up-a-rust-project-an-agent-can-work-in&quot;&gt;Setting up a Rust project an agent can work in&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;The compiler loop only works if the agent actually runs the checks and the checks are strict enough to matter:&lt;/strong&gt; here’s the setup I’d start from.&lt;/p&gt;
&lt;h3 id=&quot;make-clippy-reject-the-risky-shortcuts&quot;&gt;Make Clippy reject the risky shortcuts&lt;/h3&gt;
&lt;p&gt;Clippy is Rust’s official linter, a tool that flags code that compiles but is probably a mistake or could be simpler. &lt;strong&gt;For an agent, Clippy is the second reviewer in the loop&lt;/strong&gt;, after the compiler. If you installed Rust with &lt;a href=&quot;https://rustup.rs/&quot;&gt;rustup&lt;/a&gt;, the official installer, add Clippy and the formatter with &lt;code&gt;rustup component add rustfmt clippy&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Clippy’s lints can be set right in &lt;code&gt;Cargo.toml&lt;/code&gt;, so every agent and every teammate gets the same rules. This is the setting that would have flagged Cloudflare’s &lt;code&gt;unwrap()&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;toml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;lints.clippy&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;unwrap_used &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;deny&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With that in place, &lt;code&gt;cargo clippy&lt;/code&gt; turns an &lt;code&gt;unwrap()&lt;/code&gt; into an error instead of letting it through:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;ansi&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;cargo&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;clippy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8ccf7f;--shiki-macchiato-font-weight:bold;--shiki-latte:#49af3d;--shiki-latte-font-weight:bold;--shiki-frappe:#8ec772;--shiki-frappe-font-weight:bold;--shiki-mocha:#89d88b;--shiki-mocha-font-weight:bold&quot;&gt;    Checking&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt; orders v0.1.0 (/home/you/orders)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;: used `unwrap()` on a `Result` value&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; --&amp;gt; &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;src/main.rs:2:5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;     raw.trim().parse().unwrap()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;     ^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  = &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;note&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: if this value is an `Err`, it will panic&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  = &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;help&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: consider using `expect()` to provide a better panic message&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  = &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;help&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: for further information visit https://rust-lang.github.io/rust-clippy/main/index.html#unwrap_used&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#78a1f6;--shiki-macchiato-font-weight:bold;--shiki-latte:#456eff;--shiki-latte-font-weight:bold;--shiki-frappe:#7b9ef0;--shiki-frappe-font-weight:bold;--shiki-mocha:#74a8fc;--shiki-mocha-font-weight:bold&quot;&gt;  = &lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-macchiato-font-weight:bold;--shiki-latte:#4c4f69;--shiki-latte-font-weight:bold;--shiki-frappe:#c6d0f5;--shiki-frappe-font-weight:bold;--shiki-mocha:#cdd6f4;--shiki-mocha-font-weight:bold&quot;&gt;note&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: requested on the command line with `-D clippy::unwrap-used`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#ec7486;--shiki-macchiato-font-weight:bold;--shiki-latte:#de293e;--shiki-latte-font-weight:bold;--shiki-frappe:#e67172;--shiki-frappe-font-weight:bold;--shiki-mocha:#f37799;--shiki-mocha-font-weight:bold&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4&quot;&gt;: could not compile `orders` (bin &amp;quot;orders&amp;quot;) due to 1 previous error&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Now the agent has to handle the error or explain the crash with &lt;code&gt;expect()&lt;/code&gt;&lt;/strong&gt;, and you’ll see that choice in the diff.&lt;/p&gt;
&lt;h3 id=&quot;tell-the-agent-to-run-the-loop&quot;&gt;Tell the agent to run the loop&lt;/h3&gt;
&lt;p&gt;Agents read a project instructions file before they start (&lt;code&gt;CLAUDE.md&lt;/code&gt; for Claude Code, &lt;code&gt;AGENTS.md&lt;/code&gt; for Codex and others). &lt;strong&gt;A few lines there make the compiler loop automatic:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;markdown&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;## Checks&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;Run after every change, and fix every error and warning before finishing:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; cargo fmt&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; cargo clippy --all-targets -- -D warnings&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; cargo nextest run&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;-D warnings&lt;/code&gt; turns every Clippy warning into an error, so the agent can’t leave them behind. &lt;a href=&quot;https://nexte.st/&quot;&gt;cargo-nextest&lt;/a&gt; is “a next-generation test runner for Rust” that runs tests faster than &lt;code&gt;cargo test&lt;/code&gt; and gives clearer output. It doesn’t run doctests (the examples inside your documentation comments), so add &lt;code&gt;cargo test --doc&lt;/code&gt; if your project has them.&lt;/p&gt;
&lt;p&gt;Two &lt;code&gt;cargo&lt;/code&gt; add-ons fit in that checks list too, because they catch dependency problems the compiler is happy to accept.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rustsec/rustsec/tree/main/cargo-audit&quot;&gt;cargo-audit&lt;/a&gt; checks your dependencies against the RustSec Advisory Database of crates with reported security vulnerabilities, and &lt;a href=&quot;https://github.com/bnjbvr/cargo-machete&quot;&gt;cargo-machete&lt;/a&gt; finds dependencies your code no longer uses, which can pile up after an agent refactors code. Install both with &lt;code&gt;cargo install cargo-audit cargo-machete&lt;/code&gt;, then add &lt;code&gt;cargo audit&lt;/code&gt; and &lt;code&gt;cargo machete&lt;/code&gt; to the list.&lt;/p&gt;
&lt;h2 id=&quot;wrapping-up&quot;&gt;Wrapping up&lt;/h2&gt;
&lt;p&gt;People laughed at “Rewrite it in Rust” because rewrites cost months and Rust made them cost more. &lt;strong&gt;AI made the writing cheap, and that left checking as the expensive part, which is exactly the part Rust’s compiler is good at.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It won’t make an agent’s code correct, and the research says agents still struggle with the borrow checker, but it rejects a whole category of mistakes before you spend any time reading.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rust is the language I want agents writing when the code has to keep running for a long time:&lt;/strong&gt; services, CLI tools, anything that handles untrusted input, and anything I’ll have to maintain after the agent is gone.&lt;/p&gt;
&lt;p&gt;For training models or exploring data in a notebook, Python’s libraries are still where that work happens, and I’d use them. For a quick internal script or prototype, the compiler loop is more checking than the job needs.&lt;/p&gt;
&lt;p&gt;So set up the loop: Clippy that denies &lt;code&gt;unwrap()&lt;/code&gt;, and an instructions file that tells the agent to run every check before it hands you a diff.&lt;/p&gt;
&lt;p&gt;The rewrite used to be the joke.&lt;/p&gt;
&lt;p&gt;Now the agent writes it,
the compiler reviews it,
and you read what’s left.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;a name=&quot;references&quot;&gt;&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.rust-lang.org/2015/05/15/Rust-1.0.html&quot;&gt;Announcing Rust 1.0, The Rust Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://survey.stackoverflow.co/2025/technology/&quot;&gt;Stack Overflow Developer Survey 2025: Technology, Stack Overflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://lwn.net/Articles/1049831/&quot;&gt;The (successful) end of the kernel Rust experiment, LWN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.darpa.mil/research/programs/translating-all-c-to-rust&quot;&gt;Translating All C to Rust (TRACTOR), DARPA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.theregister.com/2025/12/24/microsoft_rust_codebase_migration&quot;&gt;Microsoft wants to replace its entire C and C++ codebase, perhaps by 2030, The Register&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.infoworld.com/article/4111553/microsoft-is-not-rewriting-windows-in-rust.html&quot;&gt;Microsoft is not rewriting Windows in Rust, InfoWorld&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ladybird.org/posts/adopting-rust/&quot;&gt;Ladybird adopts Rust, with help from AI, Ladybird&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.anthropic.com/engineering/building-c-compiler&quot;&gt;Building a C compiler with a team of parallel Claudes, Anthropic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://bun.com/blog/bun-in-rust&quot;&gt;Rewriting Bun in Rust, Bun&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://youtu.be/QRnfDHVSwZI&quot;&gt;I Spent 1000+ Hours Learning Rust. This Is What I Learned, Maddy Zhang on YouTube&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come/&quot;&gt;Shape of errors to come, The Rust Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.godaddy.com/resources/news/rust-is-the-native-language-of-agentic-development&quot;&gt;Rust Is the Native Language of Agentic Development, GoDaddy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://arxiv.org/abs/2308.05177&quot;&gt;Fixing Rust Compilation Errors using LLMs, Microsoft Research (arXiv)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.google/security/rust-in-android-move-fast-fix-things/&quot;&gt;Rust in Android: move fast and fix things, Google&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://lucumr.pocoo.org/2026/2/9/a-language-for-agents/&quot;&gt;A Language For Agents, Armin Ronacher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-copilot/&quot;&gt;Migrating the GitHub Copilot runtime to Rust, using Copilot, The GitHub Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/openai/codex/discussions/1174&quot;&gt;Codex CLI is Going Native, OpenAI (GitHub)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://code.claude.com/docs/en/troubleshooting&quot;&gt;Troubleshooting: search and discovery issues, Claude Code docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://simonwillison.net/2026/Mar/19/openai-acquiring-astral/&quot;&gt;OpenAI acquiring Astral, Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://arxiv.org/abs/2608.00661&quot;&gt;Unreliable in Practice? A Comprehensive Study of Errors in LLM-Generated Code, University of Coimbra (arXiv)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://arxiv.org/abs/2504.15254&quot;&gt;CRUST-Bench: A Comprehensive Benchmark for C-to-safe-Rust Transpilation, UT Austin and NYU (arXiv)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.cloudflare.com/18-november-2025-outage/&quot;&gt;Cloudflare outage on November 18, 2025, Cloudflare&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://lucumr.pocoo.org/2025/6/12/agentic-coding/&quot;&gt;Agentic Coding Recommendations, Armin Ronacher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://lucumr.pocoo.org/2026/8/22/fast-hard-code/&quot;&gt;Fast and Hard Code, Armin Ronacher&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.rust-lang.org/2026/03/02/2025-State-Of-Rust-Survey-results&quot;&gt;2025 State of Rust Survey Results, The Rust Blog&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</content:encoded></item><item><title>Which Popular Halloween Candies Can Kids With Food Allergies Eat?</title><link>https://anirudh-konidala.vercel.app/blog/halloween-candy-food-allergies/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/halloween-candy-food-allergies/</guid><description>I combined an online candy vote with real ingredient labels on Databricks to find the most popular candies kids with food allergies can still eat, then checked the answer against this year&apos;s labels</description><pubDate>Sat, 31 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you went trick-or-treating as a kid, chances are you came home with a lot of Reese’s Peanut Butter Cups. They are pretty much everywhere. An &lt;a href=&quot;https://www.chowhound.com/2299896/best-selling-halloween-candy-america-reeses/&quot;&gt;Instacart report on its 2025 orders&lt;/a&gt; found that Reese’s was the &lt;strong&gt;No. 1 candy sold in 40 of the 50 states&lt;/strong&gt;, plus Washington, D.C.&lt;/p&gt;
&lt;p&gt;That is a problem for kids with a peanut allergy, because the most popular candy in the bowl is the one they cannot eat.&lt;/p&gt;
&lt;p&gt;I was curious what the best Halloween bowl looks like when it has to be safe for every kid, and how much popularity a household gives up by skipping certain candies.&lt;/p&gt;
&lt;p&gt;So I built &lt;a href=&quot;https://github.com/kidskoding/candyops&quot;&gt;candyops&lt;/a&gt;, a data pipeline that answers one question: for each common food allergy, which 10 popular candies can you still hand out, and how much less popular is that bowl than one with no allergy restrictions? It also asks what a household can do about it.&lt;/p&gt;
&lt;h2 id=&quot;why-this-matters&quot;&gt;Why this matters&lt;/h2&gt;
&lt;p&gt;Food allergies are common in children. The CDC found that &lt;strong&gt;5.8% of US children&lt;/strong&gt; had a diagnosed food allergy in 2021, &lt;strong&gt;about 1 in 17&lt;/strong&gt;, according to its &lt;a href=&quot;https://www.cdc.gov/nchs/products/databriefs/db459.htm&quot;&gt;National Health Interview Survey data brief&lt;/a&gt;. Halloween is the one night of the year when those kids collect food from strangers.&lt;/p&gt;
&lt;p&gt;Candy labels do not make this easy. US law requires packaged food to name the major allergens it contains, but many “may contain” warnings are voluntary and vary from one manufacturer to the next, as the &lt;a href=&quot;https://nationalaglawcenter.org/food-labeling-the-regulation-of-food-allergen-labels/&quot;&gt;National Agricultural Law Center explains&lt;/a&gt;. The nonprofit Food Allergy Research &amp;amp; Education (FARE) runs the &lt;a href=&quot;https://www.foodallergy.org/media-room/bring-magic-halloween-teal-pumpkin-project&quot;&gt;Teal Pumpkin Project&lt;/a&gt; so families can signal that they offer non-food treats instead. That works, but plenty of households would rather hand out candy every kid can eat.&lt;/p&gt;
&lt;p&gt;A lot of the candy you eat comes from three big companies.&lt;/p&gt;
&lt;p&gt;The Hershey Company makes Hershey’s, Reese’s, Hershey’s Kisses, Jolly Rancher and Kit Kat. Reese’s Peanut Butter Cups, the bestseller from the start of this post, are built around peanut butter.&lt;/p&gt;
&lt;p&gt;Mars makes Snickers, M&amp;amp;M’s, Twix, 3 Musketeers, Milky Way, Skittles and Starburst. Its lineup covers both kinds of candy in a Halloween bowl: chocolate bars like Snickers and Twix, made with milk chocolate, and fruit candies like Skittles and Starburst, made without chocolate or nuts. The fruit candies come up again later, because they are what remains once the common allergens are removed.&lt;/p&gt;
&lt;p&gt;Ferrero makes Ferrero Rocher, Nutella and Kinder Joy. It also owns Halloween staples like Butterfinger, Baby Ruth, 100 Grand and Nerds, which came with &lt;a href=&quot;https://www.ferrero.com/news/ferrero-to-acquire-nestle-s-us-confectionary-business&quot;&gt;Nestlé’s US candy business when Ferrero bought it in 2018&lt;/a&gt;. Butterfinger turned out to be the biggest risk in this project: the data nearly labeled it peanut-free, even though it is made with peanuts.&lt;/p&gt;
&lt;h2 id=&quot;the-data&quot;&gt;The data&lt;/h2&gt;
&lt;p&gt;I combined two public datasets from Kaggle, a website where people share free datasets. They were collected separately and share no common ID. A third, live source keeps the results up to date.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Table 1.1&lt;/strong&gt; lists the three sources, what each one holds, and its size.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.kaggle.com/datasets/fivethirtyeight/the-ultimate-halloween-candy-power-ranking&quot;&gt;FiveThirtyEight’s Ultimate Halloween Candy Power Ranking&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;How often each candy won a head-to-head vote&lt;/td&gt;
&lt;td&gt;85 entries from about 269,000 matchups&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://www.kaggle.com/datasets/openfoodfacts/world-food-facts&quot;&gt;Open Food Facts (world-food-facts)&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Ingredients, allergens, sugar and serving size of packaged foods&lt;/td&gt;
&lt;td&gt;356,001 products x 163 columns, about 1 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://static.openfoodfacts.org/data/delta/index.txt&quot;&gt;Open Food Facts daily change feed&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Every product edited each day&lt;/td&gt;
&lt;td&gt;98,694 edits in its first two weeks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.1:&lt;/strong&gt; The three data sources candyops combines, what each one holds, and its size.&lt;/p&gt;
&lt;p&gt;FiveThirtyEight was a data journalism site. Its writer Walt Hickey built the ranking in 2017 by asking readers to pick between two random candies, again and again. Besides each candy’s win rate, the dataset tags every candy with yes-or-no traits (chocolate, fruity, caramel, peanut or almond, nougat, crisped rice or wafer, hard candy, bar, and many pieces per bag) and ranks how sugary and how expensive it is compared with the others.&lt;/p&gt;
&lt;p&gt;Open Food Facts is a nonprofit, crowdsourced database of food labels that anyone can edit. Both Kaggle files are 2017 snapshots, and the pipeline pins their versions, so every run downloads and reads exactly the same data.&lt;/p&gt;
&lt;p&gt;This is one real row from Open Food Facts, a US pack of Reese’s Peanut Butter Cups:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;code             0768395475482&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;product_name     Peanut Butter Cups&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;brands           Reese&amp;#39;s&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;countries_tags   en:united-states&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;ingredients      Milk chocolate (sugar; cocoa butter; chocolate; nonfat milk; milk fat; lactose;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                 soy lecithin; pgpr, emulsifier); peanuts; sugar; dextrose; salt; tbhq (preservative)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;allergens        (empty)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;traces           (empty)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;serving_size     42 g (1 PACKAGE)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;sugars_100g      50&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The allergen field is empty, even though the ingredients list milk, soy and peanuts. Only &lt;strong&gt;37,177 of the 356,001&lt;/strong&gt; products fill it in. Most of the allergen information is only in the ingredient text, so the pipeline has to read each ingredient list to find allergens.&lt;/p&gt;
&lt;p&gt;The raw files are messier than they look. The candy ranking stores apostrophes as &lt;code&gt;HersheyÕs&lt;/code&gt; and includes two coins (a dime and a quarter) as joke entries. The Open Food Facts file has 26 rows with a stray carriage return inside a field; pandas and most CSV readers treat it as a line break and report 356,027 rows instead of 356,001. A test pins the correct count, so a reader that splits on the wrong character fails with an error instead of producing extra rows.&lt;/p&gt;
&lt;h2 id=&quot;how-the-pipeline-works&quot;&gt;How the pipeline works&lt;/h2&gt;
&lt;figure class=&quot;mermaid-diagram&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 434.44999999999993 645.5&quot; width=&quot;434.44999999999993&quot; height=&quot;645.5&quot; style=&quot;--bg:var(--color-nvim-bg-hard);--fg:var(--color-nvim-fg);--line:var(--color-nvim-gray);--accent:var(--color-nvim-orange);--muted:var(--color-nvim-fg2);--surface:var(--color-nvim-bg1);--border:var(--color-nvim-bg3)&quot;&gt; &lt;defs&gt; &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;7&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt; &lt;polygon points=&quot;0 0, 8 2.5, 0 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;marker id=&quot;arrowhead-start&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;1&quot; refY=&quot;2.5&quot; orient=&quot;auto-start-reverse&quot;&gt; &lt;polygon points=&quot;8 0, 0 2.5, 8 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;/defs&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;K&quot; data-to=&quot;V&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;128.62499999999997,69.80000000000001 128.62499999999997,93.80000000000001 229.89999999999998,93.80000000000001 229.89999999999998,117.80000000000001&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;F&quot; data-to=&quot;V&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;331.17499999999995,69.80000000000001 331.17499999999995,93.80000000000001 229.89999999999998,93.80000000000001 229.89999999999998,117.80000000000001&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;V&quot; data-to=&quot;B&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;229.89999999999998,171.60000000000002 229.89999999999998,219.60000000000002&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;S&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;229.89999999999998,273.40000000000003 229.89999999999998,321.40000000000003&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;S&quot; data-to=&quot;G&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;229.89999999999998,392.1 229.89999999999998,440.1&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;G&quot; data-to=&quot;O&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;229.89999999999998,527.7 229.89999999999998,551.7 130.575,551.7 130.575,575.7&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;G&quot; data-to=&quot;D&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;229.89999999999998,527.7 229.89999999999998,551.7 329.22499999999997,551.7 329.22499999999997,575.7&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;g class=&quot;node&quot; data-id=&quot;K&quot; data-label=&quot;Kaggle 2 pinned datasets&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;41.34999999999999&quot; y=&quot;16&quot; width=&quot;174.54999999999998&quot; height=&quot;53.800000000000004&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;128.62499999999997&quot; y=&quot;42.900000000000006&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;128.62499999999997&quot; dy=&quot;-3.9000000000000012&quot;&gt;Kaggle&lt;/tspan&gt;&lt;tspan x=&quot;128.62499999999997&quot; dy=&quot;16.900000000000002&quot;&gt;2 pinned datasets&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;V&quot; data-label=&quot;Unity Catalog volume raw files + feed archive&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;115.32499999999999&quot; y=&quot;117.80000000000001&quot; width=&quot;229.14999999999998&quot; height=&quot;53.800000000000004&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;229.89999999999998&quot; y=&quot;144.70000000000002&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;-3.9000000000000012&quot;&gt;Unity Catalog volume&lt;/tspan&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;16.900000000000002&quot;&gt;raw files + feed archive&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;F&quot; data-label=&quot;Open Food Facts daily change feed&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;243.89999999999998&quot; y=&quot;16&quot; width=&quot;174.54999999999998&quot; height=&quot;53.800000000000004&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;331.17499999999995&quot; y=&quot;42.900000000000006&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;331.17499999999995&quot; dy=&quot;-3.9000000000000012&quot;&gt;Open Food Facts&lt;/tspan&gt;&lt;tspan x=&quot;331.17499999999995&quot; dy=&quot;16.900000000000002&quot;&gt;daily change feed&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;B&quot; data-label=&quot;bronze raw strings&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;166.02499999999998&quot; y=&quot;219.60000000000002&quot; width=&quot;127.75&quot; height=&quot;53.800000000000004&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;229.89999999999998&quot; y=&quot;246.50000000000003&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;-3.9000000000000012&quot;&gt;bronze&lt;/tspan&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;16.900000000000002&quot;&gt;raw strings&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;S&quot; data-label=&quot;silver cleaned products, candy matches, allergen flags&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;95.82499999999999&quot; y=&quot;321.40000000000003&quot; width=&quot;268.15&quot; height=&quot;70.7&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;229.89999999999998&quot; y=&quot;356.75000000000006&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;-12.350000000000001&quot;&gt;silver&lt;/tspan&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;16.900000000000002&quot;&gt;cleaned products,&lt;/tspan&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;16.900000000000002&quot;&gt;candy matches, allergen flags&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;G&quot; data-label=&quot;gold candy profiles, bowls, warning cost, safe swaps, 2017 vs now&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;111.42499999999998&quot; y=&quot;440.1&quot; width=&quot;236.95&quot; height=&quot;87.60000000000001&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;229.89999999999998&quot; y=&quot;483.90000000000003&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;-20.8&quot;&gt;gold&lt;/tspan&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;16.900000000000002&quot;&gt;candy profiles, bowls,&lt;/tspan&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;16.900000000000002&quot;&gt;warning cost, safe swaps,&lt;/tspan&gt;&lt;tspan x=&quot;229.89999999999998&quot; dy=&quot;16.900000000000002&quot;&gt;2017 vs now&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;O&quot; data-label=&quot;street bowl optimizer Python, logged to MLflow&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;16&quot; y=&quot;575.7&quot; width=&quot;229.14999999999998&quot; height=&quot;53.800000000000004&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;130.575&quot; y=&quot;602.6&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;130.575&quot; dy=&quot;-3.9000000000000012&quot;&gt;street bowl optimizer&lt;/tspan&gt;&lt;tspan x=&quot;130.575&quot; dy=&quot;16.900000000000002&quot;&gt;Python, logged to MLflow&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;D&quot; data-label=&quot;dashboard&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;273.15&quot; y=&quot;575.7&quot; width=&quot;112.15&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;329.22499999999997&quot; y=&quot;594.1500000000001&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;dashboard&lt;/text&gt; &lt;/g&gt; &lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;The pipeline runs on &lt;strong&gt;Databricks&lt;/strong&gt;, a cloud platform for processing large datasets with Spark and SQL. Raw files land in a &lt;strong&gt;Unity Catalog volume&lt;/strong&gt;, which is Databricks’ managed storage for files, so the downloads are kept between runs. I set up a Databricks job that runs every day and stores the data in a &lt;strong&gt;medallion architecture&lt;/strong&gt;, which organizes it into three layers: &lt;span class=&quot;font-bold text-nvim-orange&quot;&gt;bronze&lt;/span&gt; pulls in the raw data from the sources unchanged, &lt;span class=&quot;font-bold text-nvim-fg2&quot;&gt;silver&lt;/span&gt; cleans it and reads the allergens from each ingredient list, and &lt;span class=&quot;font-bold text-nvim-yellow&quot;&gt;gold&lt;/span&gt; turns it into the results this post reports, such as each candy’s allergen status and the allergy-safe bowls.&lt;/p&gt;
&lt;p&gt;The job starts by downloading the Kaggle datasets into two bronze tables, with every value kept as text: &lt;code&gt;bronze_candy_ranking&lt;/code&gt;, with one row for each of the 85 candies in the vote, and &lt;code&gt;bronze_off_products&lt;/code&gt;, with all 356,001 Open Food Facts products and their 163 columns.&lt;/p&gt;
&lt;p&gt;A second notebook then archives each new change-feed file and loads it with Auto Loader, which remembers which files it has already read, so each day’s edits are loaded exactly once. Open Food Facts keeps only about two weeks of those files, so the archive is the only copy once they expire.&lt;/p&gt;
&lt;p&gt;From there, &lt;strong&gt;dbt&lt;/strong&gt; (data build tool) builds everything in SQL: each table is a SQL file called a model, and dbt runs the models in the right order and checks each one with tests. The silver models clean data types and whitespace, parse serving sizes like &lt;code&gt;1.55 oz&lt;/code&gt; into grams, match products to candies, and turn ingredient text into allergen flags for peanut, tree nut, milk, gluten, soy and egg. The parser splits “may contain” warnings away from real ingredients and ignores lookalikes such as “cocoa butter” (not dairy) and “peanut-free”. The gold models give each candy a status per allergen (&lt;code&gt;contains&lt;/code&gt;, &lt;code&gt;varies&lt;/code&gt;, &lt;code&gt;may_contain&lt;/code&gt;, &lt;code&gt;not_listed&lt;/code&gt; or &lt;code&gt;unknown&lt;/code&gt;) and pick the bowls. dbt runs &lt;strong&gt;51 tests&lt;/strong&gt; on every build, including one that fails if any candy in a peanut-free bowl is not peanut-free.&lt;/p&gt;
&lt;p&gt;The last step turns the gold tables into decisions. Two more dbt models rebuild every bowl with and without accepting “may contain” warnings, and find the most similar safe candy for each favorite. A Python step then runs a small optimization that picks the one bowl that gives the most trick-or-treaters a favorite they can eat, and logs each run’s inputs and results to &lt;strong&gt;MLflow&lt;/strong&gt;, a tool for recording experiments, so runs can be compared over time.&lt;/p&gt;
&lt;h2 id=&quot;the-results&quot;&gt;The results&lt;/h2&gt;
&lt;h3 id=&quot;how-to-read-the-results&quot;&gt;How to read the results&lt;/h3&gt;
&lt;p&gt;Every allergy-safe bowl is compared with the same baseline, the &lt;strong&gt;unrestricted bowl&lt;/strong&gt;: the 10 most popular candies overall, which is the bowl a household would put out without thinking about allergies. It starts with Reese’s Peanut Butter Cups, Reese’s Miniatures and Twix, so it is the opposite of allergen-free: almost every candy in it contains peanuts, milk or both.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Table 1.2&lt;/strong&gt; defines the four measures the results use, each with a worked example from the data.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Measure&lt;/th&gt;
&lt;th&gt;Definition&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Win rate&lt;/td&gt;
&lt;td&gt;The percentage of a candy’s head-to-head matchups in which voters picked it. In each matchup, FiveThirtyEight showed a voter two randomly chosen candies and asked which one they would rather receive. The value comes from the dataset’s &lt;code&gt;winpercent&lt;/code&gt; column, based on about 269,000 matchups in total.&lt;/td&gt;
&lt;td&gt;Reese’s Peanut Butter Cups won 84.2% of their matchups, the highest of the 83 candies.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Candies allowed&lt;/td&gt;
&lt;td&gt;The number of the 83 ranked candies that pass a restriction. A candy passes when every restricted allergen has the status &lt;code&gt;not_listed&lt;/code&gt;, based on at least two matched products with an ingredient list. Peanut-free and nut-free restrictions also exclude any candy FiveThirtyEight tags as containing peanuts or almonds.&lt;/td&gt;
&lt;td&gt;42 candies pass the peanut-free restriction.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bowl&lt;/td&gt;
&lt;td&gt;The 10 candies with the highest win rate among the candies allowed. The &lt;strong&gt;unrestricted bowl&lt;/strong&gt; applies no restriction, so it is simply the 10 candies with the highest win rate overall; its average win rate is 76.3%.&lt;/td&gt;
&lt;td&gt;The peanut-free bowl starts with Starburst, Rolo, and Skittles.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Popularity kept (popularity score)&lt;/td&gt;
&lt;td&gt;A restricted bowl’s average win rate divided by the unrestricted bowl’s average win rate.&lt;/td&gt;
&lt;td&gt;Peanut-free: 59.5% ÷ 76.3% = 78.0%.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.2:&lt;/strong&gt; Definitions of the four measures used in the results, each with a worked example from the data.&lt;/p&gt;
&lt;p&gt;A popularity score of 78% means the candies in the peanut-free bowl win their matchups, on average, about 22% less often than the candies in the unrestricted bowl. A score of 100% would mean a restriction costs no popularity at all.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Table 1.3&lt;/strong&gt; sums up the main results, and the sections below explain each one.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;How much popularity does a peanut-free bowl keep?&lt;/td&gt;
&lt;td&gt;A 78.0% popularity score&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How much does a bowl free of all six allergens keep?&lt;/td&gt;
&lt;td&gt;A 68.7% popularity score&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How much do “may contain” warnings cost the peanut-free bowl?&lt;/td&gt;
&lt;td&gt;7.9 points of popularity score&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What is the closest peanut-free swap for Twix?&lt;/td&gt;
&lt;td&gt;Hershey’s Special Dark, with a 59.2% win rate versus Twix’s 81.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What single change covers every kid with a peanut, milk or tree-nut allergy?&lt;/td&gt;
&lt;td&gt;Swapping Butterfinger for Starburst, which keeps a 99.5% popularity score&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;How many candies changed allergen status since 2017?&lt;/td&gt;
&lt;td&gt;12 of the 19 candies with enough current data&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.3:&lt;/strong&gt; The main results of the analysis, each explained in the sections below.&lt;/p&gt;
&lt;h3 id=&quot;the-most-popular-candies-carry-the-most-allergens&quot;&gt;The most popular candies carry the most allergens&lt;/h3&gt;
&lt;p&gt;The Reese’s problem from the start of this post is not a one-off. &lt;strong&gt;Figure 1.1&lt;/strong&gt; plots each of the 58 candies with at least two matched products that have an ingredient list (the other 25 candies lack enough label data to judge) by how many of the six allergens its label lists and how often it won its matchups.&lt;/p&gt;
&lt;style&gt;astro-island,astro-slot,astro-static-slot{display:contents}&lt;/style&gt;&lt;script&gt;(function(){let e=async e=&gt;{await(await e())()};(self.Astro||(self.Astro={})).load=e,window.dispatchEvent(new Event(`astro:load`))})();&lt;/script&gt;&lt;script&gt;(function(){function e(t){&quot;@babel/helpers - typeof&quot;;return e=typeof Symbol==`function`&amp;&amp;typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&amp;&amp;typeof Symbol==`function`&amp;&amp;e.constructor===Symbol&amp;&amp;e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r;if(typeof Symbol&lt;`u`&amp;&amp;(r=t[Symbol.toPrimitive])!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let i=/* @__PURE__ */ new Set([`__proto__`,`constructor`,`prototype`]);{let e={0:e=&gt;a(e),1:e=&gt;n(e),2:e=&gt;new RegExp(e),3:e=&gt;new Date(e),4:e=&gt;new Map(n(e)),5:e=&gt;new Set(n(e)),6:e=&gt;BigInt(e),7:e=&gt;new URL(e),8:e=&gt;new Uint8Array(e),9:e=&gt;new Uint16Array(e),10:e=&gt;new Uint32Array(e),11:e=&gt;1/0*e},t=t=&gt;{let[n,r]=t;return n in e?e[n](r):void 0},n=e=&gt;e.map(t),a=e=&gt;typeof e!=`object`||!e?e:Object.fromEntries(Object.entries(e).map(([e,n])=&gt;[e,t(n)]));class o extends HTMLElement{constructor(...e){super(...e),r(this,`Component`,void 0),r(this,`hydrator`,void 0),r(this,`hydrate`,async()=&gt;{var e;if(!this.hydrator||!this.isConnected)return;let t=(e=this.parentElement)==null?void 0:e.closest(`astro-island[ssr]`);if(t){t.addEventListener(`astro:hydrate`,this.hydrate,{once:!0});return}let n=this.querySelectorAll(`astro-slot`),r={},i=this.querySelectorAll(`template[data-astro-template]`);for(let e of i){let t=e.closest(this.tagName);t!=null&amp;&amp;t.isSameNode(this)&amp;&amp;(r[e.getAttribute(`data-astro-template`)||`default`]=e.innerHTML,e.remove())}for(let e of n){let t=e.closest(this.tagName);t!=null&amp;&amp;t.isSameNode(this)&amp;&amp;(r[e.getAttribute(`name`)||`default`]=e.innerHTML)}let o;try{o=this.hasAttribute(`props`)?a(JSON.parse(this.getAttribute(`props`))):{}}catch(e){let t=this.getAttribute(`component-url`)||`&lt;unknown&gt;`,n=this.getAttribute(`component-export`);throw n&amp;&amp;(t+=` (export ${n})`),console.error(`[hydrate] Error parsing props for component ${t}`,this.getAttribute(`props`),e),e}await this.hydrator(this)(this.Component,o,r,{client:this.getAttribute(`client`)}),this.removeAttribute(`ssr`),this.dispatchEvent(new CustomEvent(`astro:hydrate`))}),r(this,`unmount`,()=&gt;{this.isConnected||this.dispatchEvent(new CustomEvent(`astro:unmount`))})}disconnectedCallback(){document.removeEventListener(`astro:after-swap`,this.unmount),document.addEventListener(`astro:after-swap`,this.unmount,{once:!0})}connectedCallback(){if(!this.hasAttribute(`await-children`)||document.readyState===`interactive`||document.readyState===`complete`)this.childrenConnectedCallback();else{let e=()=&gt;{document.removeEventListener(`DOMContentLoaded`,e),t.disconnect(),this.childrenConnectedCallback()},t=new MutationObserver(()=&gt;{var t;((t=this.lastChild)==null?void 0:t.nodeType)===Node.COMMENT_NODE&amp;&amp;this.lastChild.nodeValue===`astro:end`&amp;&amp;(this.lastChild.remove(),e())});t.observe(this,{childList:!0}),document.addEventListener(`DOMContentLoaded`,e)}}async childrenConnectedCallback(){let e=this.getAttribute(`before-hydration-url`);e&amp;&amp;await import(e),this.start()}getRetryImportUrl(e){let t=new URL(e,document.baseURI);return t.searchParams.set(`astro-retry`,Date.now().toString()),t.toString()}async importWithRetry(e){try{return await import(e)}catch(t){return await new Promise(e=&gt;setTimeout(e,1e3)),import(this.getRetryImportUrl(e))}}handleHydrationError(e){let t=this.getAttribute(`component-url`),n=new CustomEvent(`astro:hydration-error`,{cancelable:!0,bubbles:!0,composed:!0,detail:{error:e,componentUrl:t}});this.dispatchEvent(n)&amp;&amp;console.error(`[astro-island] Error hydrating ${t}`,e)}async start(){let e=JSON.parse(this.getAttribute(`opts`)),t=this.getAttribute(`client`);if(Astro[t]===void 0)window.addEventListener(`astro:${t}`,()=&gt;this.start(),{once:!0});else try{await Astro[t](async()=&gt;{let e=this.getAttribute(`renderer-url`);try{let[t,{default:n}]=await Promise.all([this.importWithRetry(this.getAttribute(`component-url`)),e?this.importWithRetry(e):Promise.resolve({default:()=&gt;()=&gt;{}})]),r=this.getAttribute(`component-export`)||`default`;if(r.includes(`.`)){this.Component=t;for(let e of r.split(`.`)){if(i.has(e)||!this.Component||typeof this.Component!=`object`&amp;&amp;typeof this.Component!=`function`||!Object.hasOwn(this.Component,e))throw Error(`Invalid component export path: ${r}`);this.Component=this.Component[e]}}else{if(i.has(r))throw Error(`Invalid component export path: ${r}`);this.Component=t[r]}return this.hydrator=n,this.hydrate}catch(e){return this.handleHydrationError(e),()=&gt;{}}},e,this)}catch(e){this.handleHydrationError(e)}}attributeChangedCallback(){this.hydrate()}}r(o,`observedAttributes`,[`props`]),customElements.get(`astro-island`)||customElements.define(`astro-island`,o)}})();&lt;/script&gt;&lt;script&gt;window._$HY||(e=&gt;{let t=e=&gt;e&amp;&amp;e.hasAttribute&amp;&amp;(e.hasAttribute(&quot;data-hk&quot;)?e:t(e.host&amp;&amp;e.host.nodeType?e.host:e.parentNode));[&quot;click&quot;, &quot;input&quot;].forEach((o=&gt;document.addEventListener(o,(o=&gt;{if(!e.events)return;let s=t(o.composedPath&amp;&amp;o.composedPath()[0]||o.target);s&amp;&amp;!e.completed.has(s)&amp;&amp;e.events.push([s,o])}))))})(_$HY={events:[],completed:new WeakSet,r:{},fe(){}});&lt;/script&gt;&lt;!--xs--&gt;&lt;astro-island uid=&quot;AHn0c&quot; data-solid-render-id=&quot;s0&quot; component-url=&quot;/vercel/path0/src/components/charts/ChartFigure.tsx&quot; component-export=&quot;default&quot; renderer-url=&quot;@astrojs/solid-js/client.js&quot; props=&quot;{&amp;quot;kind&amp;quot;:[0,&amp;quot;scatter&amp;quot;],&amp;quot;title&amp;quot;:[0,&amp;quot;The most popular candies list the most allergens&amp;quot;],&amp;quot;subtitle&amp;quot;:[0,&amp;quot;Each dot is one of 58 candies with at least two labeled products. Lines show the average win rate. Hover a dot for details, or click the legend to show or hide a group.&amp;quot;],&amp;quot;data&amp;quot;:[0,{&amp;quot;points&amp;quot;:[1,[[0,{&amp;quot;x&amp;quot;:[0,-0.165],&amp;quot;y&amp;quot;:[0,27.3],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Super Bubble\n27.3% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,-0.055],&amp;quot;y&amp;quot;:[0,29.7],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Root Beer Barrels\n29.7% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.055],&amp;quot;y&amp;quot;:[0,34.2],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Haribo Happy Cola\n34.2% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.165],&amp;quot;y&amp;quot;:[0,35.3],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Ring pop\n35.3% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,-0.165],&amp;quot;y&amp;quot;:[0,36],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Chewey Lemonhead Fruit Mix\n36.0% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,-0.055],&amp;quot;y&amp;quot;:[0,39.1],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Lemonhead\n39.1% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.055],&amp;quot;y&amp;quot;:[0,39.2],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Fun Dip\n39.2% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.165],&amp;quot;y&amp;quot;:[0,39.5],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Dum Dums\n39.5% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,-0.165],&amp;quot;y&amp;quot;:[0,42.3],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Dots\n42.3% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,-0.055],&amp;quot;y&amp;quot;:[0,42.8],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Runts\n42.8% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.055],&amp;quot;y&amp;quot;:[0,44.4],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Welch&amp;#39;s Fruit Snacks\n44.4% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.165],&amp;quot;y&amp;quot;:[0,51.4],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Haribo Sour Bears\n51.4% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,-0.165],&amp;quot;y&amp;quot;:[0,52.9],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Lifesavers big ring gummies\n52.9% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,-0.055],&amp;quot;y&amp;quot;:[0,54.9],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Swedish Fish\n54.9% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.055],&amp;quot;y&amp;quot;:[0,55.1],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Skittles wildberry\n55.1% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.165],&amp;quot;y&amp;quot;:[0,57.1],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Haribo Gold Bears\n57.1% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,-0.165],&amp;quot;y&amp;quot;:[0,59.9],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Sour Patch Kids\n59.9% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,-0.055],&amp;quot;y&amp;quot;:[0,63.1],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,{&amp;quot;text&amp;quot;:[0,&amp;quot;Skittles: most popular with none of the six&amp;quot;],&amp;quot;dx&amp;quot;:[0,30],&amp;quot;dy&amp;quot;:[0,-72]}],&amp;quot;tip&amp;quot;:[0,&amp;quot;Skittles original\n63.1% win rate\n0 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.835],&amp;quot;y&amp;quot;:[0,23.4],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Boston Baked Beans\n23.4% win rate\n1 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.945],&amp;quot;y&amp;quot;:[0,24.5],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Chiclets\n24.5% win rate\n1 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,1.055],&amp;quot;y&amp;quot;:[0,37.3],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Red vines\n37.3% win rate\n1 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,1.165],&amp;quot;y&amp;quot;:[0,42.2],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Haribo Twin Snakes\n42.2% win rate\n1 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.835],&amp;quot;y&amp;quot;:[0,47.2],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Trolli Sour Bites\n47.2% win rate\n1 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,0.945],&amp;quot;y&amp;quot;:[0,67],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Starburst\n67.0% win rate\n1 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,1.835],&amp;quot;y&amp;quot;:[0,34.7],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Sixlets\n34.7% win rate\n2 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,1.945],&amp;quot;y&amp;quot;:[0,39.4],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Now &amp;amp; Later\n39.4% win rate\n2 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2.055],&amp;quot;y&amp;quot;:[0,41.4],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Laffy Taffy\n41.4% win rate\n2 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2.165],&amp;quot;y&amp;quot;:[0,43.1],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Fruit Chews\n43.1% win rate\n2 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,1.835],&amp;quot;y&amp;quot;:[0,45.7],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Tootsie Roll Midgies\n45.7% win rate\n2 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,1.945],&amp;quot;y&amp;quot;:[0,46.4],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mike &amp;amp; Ike\n46.4% win rate\n2 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2.055],&amp;quot;y&amp;quot;:[0,47.8],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mounds\n47.8% win rate\n2 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2.165],&amp;quot;y&amp;quot;:[0,49],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Tootsie Pop\n49.0% win rate\n2 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,1.835],&amp;quot;y&amp;quot;:[0,52.3],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Air Heads\n52.3% win rate\n2 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,1.945],&amp;quot;y&amp;quot;:[0,55.4],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nerds\n55.4% win rate\n2 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2.055],&amp;quot;y&amp;quot;:[0,57.2],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Junior Mints\n57.2% win rate\n2 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2.835],&amp;quot;y&amp;quot;:[0,34.6],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Strawberry bon bons\n34.6% win rate\n3 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2.945],&amp;quot;y&amp;quot;:[0,39],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Charleston Chew\n39.0% win rate\n3 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,3.055],&amp;quot;y&amp;quot;:[0,41.3],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Pop Rocks\n41.3% win rate\n3 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,3.165],&amp;quot;y&amp;quot;:[0,49.5],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Whoppers\n49.5% win rate\n3 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2.835],&amp;quot;y&amp;quot;:[0,65.7],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Rolo\n65.7% win rate\n3 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2.945],&amp;quot;y&amp;quot;:[0,73.4],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s pieces\n73.4% win rate\n3 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,3.055],&amp;quot;y&amp;quot;:[0,81.9],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Miniatures\n81.9% win rate\n3 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,3.165],&amp;quot;y&amp;quot;:[0,84.2],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,{&amp;quot;text&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter Cup&amp;quot;],&amp;quot;dx&amp;quot;:[0,-46],&amp;quot;dy&amp;quot;:[0,-26]}],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup\n84.2% win rate\n3 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,3.835],&amp;quot;y&amp;quot;:[0,38],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Candy Corn\n38.0% win rate\n4 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,3.945],&amp;quot;y&amp;quot;:[0,39],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Warheads\n39.0% win rate\n4 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,4.055],&amp;quot;y&amp;quot;:[0,41.9],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Werther&amp;#39;s Original Caramel\n41.9% win rate\n4 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,4.165],&amp;quot;y&amp;quot;:[0,56.5],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Milk Chocolate\n56.5% win rate\n4 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,3.835],&amp;quot;y&amp;quot;:[0,59.2],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark\n59.2% win rate\n4 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,3.945],&amp;quot;y&amp;quot;:[0,69.5],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut M&amp;amp;Ms\n69.5% win rate\n4 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,4.055],&amp;quot;y&amp;quot;:[0,71.5],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut butter M&amp;amp;M&amp;#39;s\n71.5% win rate\n4 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,4.835],&amp;quot;y&amp;quot;:[0,66.5],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nestle Crunch\n66.5% win rate\n5 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,4.945],&amp;quot;y&amp;quot;:[0,66.6],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;M&amp;amp;M&amp;#39;s\n66.6% win rate\n5 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,5.055],&amp;quot;y&amp;quot;:[0,76.8],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Kit Kat\n76.8% win rate\n5 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,5.165],&amp;quot;y&amp;quot;:[0,81.6],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,{&amp;quot;text&amp;quot;:[0,&amp;quot;Twix&amp;quot;],&amp;quot;dx&amp;quot;:[0,-40],&amp;quot;dy&amp;quot;:[0,-30]}],&amp;quot;tip&amp;quot;:[0,&amp;quot;Twix\n81.6% win rate\n5 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,5.835],&amp;quot;y&amp;quot;:[0,37.9],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nestle Smarties\n37.9% win rate\n6 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,5.945],&amp;quot;y&amp;quot;:[0,46],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Smarties candy\n46.0% win rate\n6 of 6 allergens listed\nNot chocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,6.055],&amp;quot;y&amp;quot;:[0,73.1],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,null],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milky Way\n73.1% win rate\n6 of 6 allergens listed\nChocolate&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,6.165],&amp;quot;y&amp;quot;:[0,76.7],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;label&amp;quot;:[0,{&amp;quot;text&amp;quot;:[0,&amp;quot;Snickers&amp;quot;],&amp;quot;dx&amp;quot;:[0,-34],&amp;quot;dy&amp;quot;:[0,-40]}],&amp;quot;tip&amp;quot;:[0,&amp;quot;Snickers\n76.7% win rate\n6 of 6 allergens listed\nChocolate&amp;quot;]}]]],&amp;quot;averages&amp;quot;:[1,[[0,{&amp;quot;x&amp;quot;:[0,0],&amp;quot;y&amp;quot;:[0,44.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;0 allergens listed\nAverage win rate 44.7% across 18 candies&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,1],&amp;quot;y&amp;quot;:[0,40.3],&amp;quot;tip&amp;quot;:[0,&amp;quot;1 allergens listed\nAverage win rate 40.3% across 6 candies&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,2],&amp;quot;y&amp;quot;:[0,46.6],&amp;quot;tip&amp;quot;:[0,&amp;quot;2 allergens listed\nAverage win rate 46.6% across 11 candies&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,3],&amp;quot;y&amp;quot;:[0,58.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;3 allergens listed\nAverage win rate 58.7% across 8 candies&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,4],&amp;quot;y&amp;quot;:[0,53.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;4 allergens listed\nAverage win rate 53.7% across 7 candies&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,5],&amp;quot;y&amp;quot;:[0,72.9],&amp;quot;tip&amp;quot;:[0,&amp;quot;5 allergens listed\nAverage win rate 72.9% across 4 candies&amp;quot;]}],[0,{&amp;quot;x&amp;quot;:[0,6],&amp;quot;y&amp;quot;:[0,58.4],&amp;quot;tip&amp;quot;:[0,&amp;quot;6 allergens listed\nAverage win rate 58.4% across 4 candies&amp;quot;]}]]]}],&amp;quot;options&amp;quot;:[0,{&amp;quot;xTitle&amp;quot;:[0,&amp;quot;Major allergens listed on the label (of 6, including may-contain warnings)&amp;quot;],&amp;quot;yTitle&amp;quot;:[0,&amp;quot;Win rate in head-to-head votes&amp;quot;]}],&amp;quot;height&amp;quot;:[0,540]}&quot; ssr client=&quot;load&quot; before-hydration-url=&quot;astro:scripts/before-hydration.js&quot; opts=&quot;{&amp;quot;name&amp;quot;:&amp;quot;ChartFigure&amp;quot;,&amp;quot;value&amp;quot;:true}&quot; await-children&gt;&lt;figure data-hk=&quot;s00000&quot; class=&quot;cjs-chart&quot;&gt;&lt;div class=&quot;chart-title&quot;&gt;The most popular candies list the most allergens&lt;/div&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s000010&quot; class=&quot;chart-sub&quot;&gt;Each dot is one of 58 candies with at least two labeled products. Lines show the average win rate. Hover a dot for details, or click the legend to show or hide a group.&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;div class=&quot;chart-canvas&quot; style=&quot;height:540px&quot;&gt;&lt;canvas role=&quot;img&quot; aria-label=&quot;The most popular candies list the most allergens&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/figure&gt;&lt;!--astro:end--&gt;&lt;/astro-island&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.1:&lt;/strong&gt; Win rate against the number of major allergens each candy’s label lists, including may-contain warnings. Chocolate candies are orange and other candies are blue; lines show the average win rate for each count.&lt;/p&gt;
&lt;p&gt;Candies with none of the six allergens average a &lt;strong&gt;45% win rate&lt;/strong&gt;, while candies with five or more average &lt;strong&gt;66%&lt;/strong&gt;. Most of that gap comes from chocolate, which almost always contains milk and soy, so the candies voters like best are also the hardest for allergic kids to eat.&lt;/p&gt;
&lt;p&gt;Chocolate is not the whole story, though. Among the 22 chocolate candies alone, those listing four or more allergens average a &lt;strong&gt;66.9%&lt;/strong&gt; win rate, compared with &lt;strong&gt;57.1%&lt;/strong&gt; for those listing three or fewer. Among the 36 non-chocolate candies, the number of allergens makes almost no difference (a 41.2% win rate with four or more, 43.7% with three or fewer). The best-loved chocolate bars are the ones whose fillings, such as peanuts, nougat or a wafer, put more allergens on the label.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Table 1.4&lt;/strong&gt; shows five of the most popular candies and their status for each allergen.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Candy&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;Peanut&lt;/th&gt;
&lt;th&gt;Tree nut&lt;/th&gt;
&lt;th&gt;Milk&lt;/th&gt;
&lt;th&gt;Gluten&lt;/th&gt;
&lt;th&gt;Soy&lt;/th&gt;
&lt;th&gt;Egg&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Reese’s Peanut Butter Cup&lt;/td&gt;
&lt;td&gt;84.2%&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;not listed&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;not listed&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;not listed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Twix&lt;/td&gt;
&lt;td&gt;81.6%&lt;/td&gt;
&lt;td&gt;varies&lt;/td&gt;
&lt;td&gt;varies&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;not listed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kit Kat&lt;/td&gt;
&lt;td&gt;76.8%&lt;/td&gt;
&lt;td&gt;may contain&lt;/td&gt;
&lt;td&gt;varies&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;varies&lt;/td&gt;
&lt;td&gt;not listed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Snickers&lt;/td&gt;
&lt;td&gt;76.7%&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;varies&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;varies&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;varies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Milky Way&lt;/td&gt;
&lt;td&gt;73.1%&lt;/td&gt;
&lt;td&gt;may contain&lt;/td&gt;
&lt;td&gt;may contain&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;contains&lt;/td&gt;
&lt;td&gt;varies&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.4:&lt;/strong&gt; Allergen status of five of the most popular candies, based on their matched Open Food Facts labels.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;varies&lt;/code&gt; means some matched products list the allergen and others do not, usually because the same bar is made with different recipes in different countries.&lt;/p&gt;
&lt;h3 id=&quot;what-each-allergy-costs-a-bowl&quot;&gt;What each allergy costs a bowl&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Table 1.5&lt;/strong&gt; lists the number of candies each allergy restriction allows, the popularity it keeps, and the resulting bowl.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Restriction&lt;/th&gt;
&lt;th&gt;Candies allowed&lt;/th&gt;
&lt;th&gt;Popularity kept&lt;/th&gt;
&lt;th&gt;The bowl, most popular first&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;83&lt;/td&gt;
&lt;td&gt;100.0%&lt;/td&gt;
&lt;td&gt;Reese’s Peanut Butter Cup, Reese’s Miniatures, Twix, Kit Kat, Snickers, Reese’s Pieces, Milky Way, Reese’s Stuffed with Pieces, Peanut Butter M&amp;amp;M’s, Butterfinger&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gluten-free&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;88.2%&lt;/td&gt;
&lt;td&gt;Reese’s Peanut Butter Cup, Reese’s Miniatures, Reese’s Pieces, Peanut Butter M&amp;amp;M’s, Peanut M&amp;amp;M’s, Skittles, Sour Patch Kids, Junior Mints, Haribo Gold-Bears, Nerds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Peanut-free&lt;/td&gt;
&lt;td&gt;42&lt;/td&gt;
&lt;td&gt;78.0%&lt;/td&gt;
&lt;td&gt;Starburst, Rolo, Skittles, Sour Patch Kids, Hershey’s Special Dark, Junior Mints, Haribo Gold-Bears, Nerds, Skittles Wild Berry, Swedish Fish&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nut-free&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;77.1%&lt;/td&gt;
&lt;td&gt;Starburst, Rolo, Skittles, Sour Patch Kids, Junior Mints, Haribo Gold-Bears, Nerds, Skittles Wild Berry, Swedish Fish, Lifesavers Big Ring Gummies&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Milk-free&lt;/td&gt;
&lt;td&gt;29&lt;/td&gt;
&lt;td&gt;74.6%&lt;/td&gt;
&lt;td&gt;Starburst, Skittles, Sour Patch Kids, Haribo Gold-Bears, Nerds, Skittles Wild Berry, Swedish Fish, Lifesavers Big Ring Gummies, Airheads, Haribo Sour Bears&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free of all six&lt;/td&gt;
&lt;td&gt;18&lt;/td&gt;
&lt;td&gt;68.7%&lt;/td&gt;
&lt;td&gt;Skittles, Sour Patch Kids, Haribo Gold-Bears, Skittles Wild Berry, Swedish Fish, Lifesavers Big Ring Gummies, Haribo Sour Bears, Welch’s Fruit Snacks, Runts, Dots&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.5:&lt;/strong&gt; The 10-candy bowl for each allergy restriction, with the number of candies allowed and the share of the unrestricted bowl’s popularity it keeps.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Figure 1.2&lt;/strong&gt; puts the popularity each bowl keeps side by side, from the unrestricted bowl down to a bowl free of all six allergens.&lt;/p&gt;
&lt;astro-island uid=&quot;Zlozu5&quot; data-solid-render-id=&quot;s1&quot; component-url=&quot;/vercel/path0/src/components/charts/ChartFigure.tsx&quot; component-export=&quot;default&quot; renderer-url=&quot;@astrojs/solid-js/client.js&quot; props=&quot;{&amp;quot;kind&amp;quot;:[0,&amp;quot;hbar&amp;quot;],&amp;quot;title&amp;quot;:[0,&amp;quot;Every restriction costs popularity&amp;quot;],&amp;quot;subtitle&amp;quot;:[0,&amp;quot;Average win rate of each 10-candy bowl, as a share of the unrestricted bowl. Hover a bar to see the bowl.&amp;quot;],&amp;quot;data&amp;quot;:[0,{&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;No restriction&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,100],&amp;quot;color&amp;quot;:[0,&amp;quot;gray&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;No restriction bowl\n100.0% popularity score\n83 eligible candies\n\nBowl: Reese&amp;#39;s Peanut Butter cup, Reese&amp;#39;s Miniatures, Twix, Kit Kat, Snickers, Reese&amp;#39;s pieces, Milky Way, Reese&amp;#39;s stuffed with pieces, Peanut butter M&amp;amp;M&amp;#39;s, Nestle Butterfinger&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;100.0%&amp;quot;],&amp;quot;note&amp;quot;:[0,&amp;quot;83 eligible candies&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Gluten-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,88.2],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Gluten-free bowl\n88.2% popularity score\n36 eligible candies\n\nBowl: Reese&amp;#39;s Peanut Butter cup, Reese&amp;#39;s Miniatures, Reese&amp;#39;s pieces, Peanut butter M&amp;amp;M&amp;#39;s, Peanut M&amp;amp;Ms, Skittles original, Sour Patch Kids, Junior Mints, Haribo Gold Bears, Nerds&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;88.2%&amp;quot;],&amp;quot;note&amp;quot;:[0,&amp;quot;36 eligible candies&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Peanut-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,78],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut-free bowl\n78.0% popularity score\n42 eligible candies\n\nBowl: Starburst, Rolo, Skittles original, Sour Patch Kids, Hershey&amp;#39;s Special Dark, Junior Mints, Haribo Gold Bears, Nerds, Skittles wildberry, Swedish Fish&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;78.0%&amp;quot;],&amp;quot;note&amp;quot;:[0,&amp;quot;42 eligible candies&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Nut-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,77.1],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nut-free bowl\n77.1% popularity score\n40 eligible candies\n\nBowl: Starburst, Rolo, Skittles original, Sour Patch Kids, Junior Mints, Haribo Gold Bears, Nerds, Skittles wildberry, Swedish Fish, Lifesavers big ring gummies&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;77.1%&amp;quot;],&amp;quot;note&amp;quot;:[0,&amp;quot;40 eligible candies&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Milk-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,74.6],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milk-free bowl\n74.6% popularity score\n29 eligible candies\n\nBowl: Starburst, Skittles original, Sour Patch Kids, Haribo Gold Bears, Nerds, Skittles wildberry, Swedish Fish, Lifesavers big ring gummies, Air Heads, Haribo Sour Bears&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;74.6%&amp;quot;],&amp;quot;note&amp;quot;:[0,&amp;quot;29 eligible candies&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Free of all six&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,68.7],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Free of all six bowl\n68.7% popularity score\n18 eligible candies\n\nBowl: Skittles original, Sour Patch Kids, Haribo Gold Bears, Skittles wildberry, Swedish Fish, Lifesavers big ring gummies, Haribo Sour Bears, Welch&amp;#39;s Fruit Snacks, Runts, Dots&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;68.7%&amp;quot;],&amp;quot;note&amp;quot;:[0,&amp;quot;18 eligible candies&amp;quot;]}]]]}],&amp;quot;options&amp;quot;:[0,{&amp;quot;max&amp;quot;:[0,100],&amp;quot;step&amp;quot;:[0,25],&amp;quot;suffix&amp;quot;:[0,&amp;quot;%&amp;quot;],&amp;quot;xTitle&amp;quot;:[0,&amp;quot;Popularity kept (unrestricted bowl = 100%)&amp;quot;],&amp;quot;yTitle&amp;quot;:[0,&amp;quot;Bowl&amp;quot;],&amp;quot;rightPad&amp;quot;:[0,240]}],&amp;quot;height&amp;quot;:[0,400]}&quot; ssr client=&quot;load&quot; before-hydration-url=&quot;astro:scripts/before-hydration.js&quot; opts=&quot;{&amp;quot;name&amp;quot;:&amp;quot;ChartFigure&amp;quot;,&amp;quot;value&amp;quot;:true}&quot; await-children&gt;&lt;figure data-hk=&quot;s10000&quot; class=&quot;cjs-chart&quot;&gt;&lt;div class=&quot;chart-title&quot;&gt;Every restriction costs popularity&lt;/div&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s100010&quot; class=&quot;chart-sub&quot;&gt;Average win rate of each 10-candy bowl, as a share of the unrestricted bowl. Hover a bar to see the bowl.&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;div class=&quot;chart-canvas&quot; style=&quot;height:400px&quot;&gt;&lt;canvas role=&quot;img&quot; aria-label=&quot;Every restriction costs popularity&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/figure&gt;&lt;!--astro:end--&gt;&lt;/astro-island&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.2:&lt;/strong&gt; The share of the unrestricted bowl’s popularity that each allergy-safe bowl keeps, with the number of candies each restriction allows.&lt;/p&gt;
&lt;p&gt;Every candy in the unrestricted top 10 is chocolate, and at least five of them are made with peanuts: four Reese’s products and Peanut Butter M&amp;amp;M’s. That is why the peanut-free bowl loses so much. It keeps a &lt;strong&gt;78% popularity score&lt;/strong&gt;, and none of the 10 candies in the unrestricted bowl make it in.&lt;/p&gt;
&lt;p&gt;A gluten-free bowl loses the least popularity. It keeps an &lt;strong&gt;88.2% popularity score&lt;/strong&gt; and still leads with Reese’s, because Reese’s Peanut Butter Cups list no wheat. A milk-free bowl drops to a &lt;strong&gt;74.6% popularity score&lt;/strong&gt;, because it excludes every candy made with milk chocolate. &lt;strong&gt;Figure 1.3&lt;/strong&gt; splits each bowl into chocolate and non-chocolate candies.&lt;/p&gt;
&lt;astro-island uid=&quot;Z1NvUlr&quot; data-solid-render-id=&quot;s2&quot; component-url=&quot;/vercel/path0/src/components/charts/ChartFigure.tsx&quot; component-export=&quot;default&quot; renderer-url=&quot;@astrojs/solid-js/client.js&quot; props=&quot;{&amp;quot;kind&amp;quot;:[0,&amp;quot;hbar&amp;quot;],&amp;quot;title&amp;quot;:[0,&amp;quot;Chocolate disappears as restrictions are added&amp;quot;],&amp;quot;subtitle&amp;quot;:[0,&amp;quot;Chocolate and non-chocolate candies in each 10-candy bowl. Hover a segment to see the candies.&amp;quot;],&amp;quot;data&amp;quot;:[0,{&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;No restriction&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,10],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;10&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;No restriction bowl\nChocolate: 10 of 10 candies\n\nReese&amp;#39;s Peanut Butter cup, Reese&amp;#39;s Miniatures, Twix, Kit Kat, Snickers, Reese&amp;#39;s pieces, Milky Way, Reese&amp;#39;s stuffed with pieces, Peanut butter M&amp;amp;M&amp;#39;s, Nestle Butterfinger&amp;quot;]}],[0,{&amp;quot;value&amp;quot;:[0,0],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;No restriction bowl\nNot chocolate: 0 of 10 candies&amp;quot;]}]]]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Gluten-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,6],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;6&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Gluten-free bowl\nChocolate: 6 of 10 candies\n\nReese&amp;#39;s Peanut Butter cup, Reese&amp;#39;s Miniatures, Reese&amp;#39;s pieces, Peanut butter M&amp;amp;M&amp;#39;s, Peanut M&amp;amp;Ms, Junior Mints&amp;quot;]}],[0,{&amp;quot;value&amp;quot;:[0,4],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;4&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Gluten-free bowl\nNot chocolate: 4 of 10 candies\n\nSkittles original, Sour Patch Kids, Haribo Gold Bears, Nerds&amp;quot;]}]]]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Peanut-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,3],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;3&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut-free bowl\nChocolate: 3 of 10 candies\n\nRolo, Hershey&amp;#39;s Special Dark, Junior Mints&amp;quot;]}],[0,{&amp;quot;value&amp;quot;:[0,7],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;7&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut-free bowl\nNot chocolate: 7 of 10 candies\n\nStarburst, Skittles original, Sour Patch Kids, Haribo Gold Bears, Nerds, Skittles wildberry, Swedish Fish&amp;quot;]}]]]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Nut-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,2],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;2&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nut-free bowl\nChocolate: 2 of 10 candies\n\nRolo, Junior Mints&amp;quot;]}],[0,{&amp;quot;value&amp;quot;:[0,8],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;8&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nut-free bowl\nNot chocolate: 8 of 10 candies\n\nStarburst, Skittles original, Sour Patch Kids, Haribo Gold Bears, Nerds, Skittles wildberry, Swedish Fish, Lifesavers big ring gummies&amp;quot;]}]]]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Milk-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,0],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milk-free bowl\nChocolate: 0 of 10 candies&amp;quot;]}],[0,{&amp;quot;value&amp;quot;:[0,10],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;10&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milk-free bowl\nNot chocolate: 10 of 10 candies\n\nStarburst, Skittles original, Sour Patch Kids, Haribo Gold Bears, Nerds, Skittles wildberry, Swedish Fish, Lifesavers big ring gummies, Air Heads, Haribo Sour Bears&amp;quot;]}]]]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Free of all six&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,0],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Free of all six bowl\nChocolate: 0 of 10 candies&amp;quot;]}],[0,{&amp;quot;value&amp;quot;:[0,10],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;10&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Free of all six bowl\nNot chocolate: 10 of 10 candies\n\nSkittles original, Sour Patch Kids, Haribo Gold Bears, Skittles wildberry, Swedish Fish, Lifesavers big ring gummies, Haribo Sour Bears, Welch&amp;#39;s Fruit Snacks, Runts, Dots&amp;quot;]}]]]}]]]}],&amp;quot;options&amp;quot;:[0,{&amp;quot;legend&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Chocolate&amp;quot;],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Not chocolate&amp;quot;],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;]}]]],&amp;quot;max&amp;quot;:[0,10],&amp;quot;step&amp;quot;:[0,2],&amp;quot;xTitle&amp;quot;:[0,&amp;quot;Candies in the 10-candy bowl&amp;quot;],&amp;quot;yTitle&amp;quot;:[0,&amp;quot;Bowl&amp;quot;],&amp;quot;rightPad&amp;quot;:[0,20]}],&amp;quot;height&amp;quot;:[0,420]}&quot; ssr client=&quot;load&quot; before-hydration-url=&quot;astro:scripts/before-hydration.js&quot; opts=&quot;{&amp;quot;name&amp;quot;:&amp;quot;ChartFigure&amp;quot;,&amp;quot;value&amp;quot;:true}&quot; await-children&gt;&lt;figure data-hk=&quot;s20000&quot; class=&quot;cjs-chart&quot;&gt;&lt;div class=&quot;chart-title&quot;&gt;Chocolate disappears as restrictions are added&lt;/div&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s200010&quot; class=&quot;chart-sub&quot;&gt;Chocolate and non-chocolate candies in each 10-candy bowl. Hover a segment to see the candies.&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;div class=&quot;chart-canvas&quot; style=&quot;height:420px&quot;&gt;&lt;canvas role=&quot;img&quot; aria-label=&quot;Chocolate disappears as restrictions are added&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/figure&gt;&lt;!--astro:end--&gt;&lt;/astro-island&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.3:&lt;/strong&gt; Chocolate and non-chocolate candies in each 10-candy bowl. The milk-free bowl and the bowl free of all six allergens contain no chocolate at all.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The safest bowl is a bowl of gummies and fruit candy, and it still keeps about two-thirds of the popularity.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Avoiding all six allergens leaves &lt;strong&gt;18 candies&lt;/strong&gt; and a &lt;strong&gt;68.7% popularity score&lt;/strong&gt;: Skittles, Sour Patch Kids, Swedish Fish, Haribo Gold-Bears and others. Skittles and Sour Patch Kids still rank in the top third of the vote.&lt;/p&gt;
&lt;p&gt;Swapping chocolate for fruit candy also adds sugar. The unrestricted bowl has a median of &lt;strong&gt;51.7 g&lt;/strong&gt; of sugar per 100 g, while the peanut-free and nut-free bowls reach &lt;strong&gt;about 69 g&lt;/strong&gt;, as shown in &lt;strong&gt;Figure 1.4&lt;/strong&gt;.&lt;/p&gt;
&lt;astro-island uid=&quot;ZQWkAw&quot; data-solid-render-id=&quot;s3&quot; component-url=&quot;/vercel/path0/src/components/charts/ChartFigure.tsx&quot; component-export=&quot;default&quot; renderer-url=&quot;@astrojs/solid-js/client.js&quot; props=&quot;{&amp;quot;kind&amp;quot;:[0,&amp;quot;hbar&amp;quot;],&amp;quot;title&amp;quot;:[0,&amp;quot;Allergy-safe bowls contain more sugar&amp;quot;],&amp;quot;subtitle&amp;quot;:[0,&amp;quot;Median sugar per 100 g in each bowl. Safe bowls rely on fruit candy instead of chocolate.&amp;quot;],&amp;quot;data&amp;quot;:[0,{&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Nut-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,69.4],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nut-free bowl\nMedian 69.4 g of sugar per 100 g&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;69.4 g&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Peanut-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,69.1],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut-free bowl\nMedian 69.1 g of sugar per 100 g&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;69.1 g&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Free of all six&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,64.7],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Free of all six bowl\nMedian 64.7 g of sugar per 100 g&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;64.7 g&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Milk-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,64.7],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milk-free bowl\nMedian 64.7 g of sugar per 100 g&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;64.7 g&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Gluten-free&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,52.9],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Gluten-free bowl\nMedian 52.9 g of sugar per 100 g&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;52.9 g&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;No restriction&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,51.7],&amp;quot;color&amp;quot;:[0,&amp;quot;gray&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;No restriction bowl\nMedian 51.7 g of sugar per 100 g&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;51.7 g&amp;quot;]}]]]}],&amp;quot;options&amp;quot;:[0,{&amp;quot;max&amp;quot;:[0,80],&amp;quot;step&amp;quot;:[0,20],&amp;quot;xTitle&amp;quot;:[0,&amp;quot;Grams of sugar per 100 g (median)&amp;quot;],&amp;quot;yTitle&amp;quot;:[0,&amp;quot;Bowl&amp;quot;],&amp;quot;rightPad&amp;quot;:[0,70]}],&amp;quot;height&amp;quot;:[0,400]}&quot; ssr client=&quot;load&quot; before-hydration-url=&quot;astro:scripts/before-hydration.js&quot; opts=&quot;{&amp;quot;name&amp;quot;:&amp;quot;ChartFigure&amp;quot;,&amp;quot;value&amp;quot;:true}&quot; await-children&gt;&lt;figure data-hk=&quot;s30000&quot; class=&quot;cjs-chart&quot;&gt;&lt;div class=&quot;chart-title&quot;&gt;Allergy-safe bowls contain more sugar&lt;/div&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s300010&quot; class=&quot;chart-sub&quot;&gt;Median sugar per 100 g in each bowl. Safe bowls rely on fruit candy instead of chocolate.&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;div class=&quot;chart-canvas&quot; style=&quot;height:400px&quot;&gt;&lt;canvas role=&quot;img&quot; aria-label=&quot;Allergy-safe bowls contain more sugar&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/figure&gt;&lt;!--astro:end--&gt;&lt;/astro-island&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.4:&lt;/strong&gt; Median sugar per 100 g in each bowl. Allergy-safe bowls rely on fruit candy, which contains more sugar per gram than chocolate.&lt;/p&gt;
&lt;h3 id=&quot;part-of-that-cost-is-a-labeling-choice&quot;&gt;Part of that cost is a labeling choice&lt;/h3&gt;
&lt;p&gt;Some candies are excluded only for what they &lt;em&gt;might&lt;/em&gt; contain. No US law requires “may contain” warnings or sets rules for when to use them: each candy maker decides on its own whether to print one, so two candies made on similar production lines can carry different warnings. So I rebuilt every bowl a second time, accepting candies whose only problem is a precautionary warning, to see how much of each cost those warnings cause.&lt;/p&gt;
&lt;astro-island uid=&quot;Z1v5gCO&quot; data-solid-render-id=&quot;s4&quot; component-url=&quot;/vercel/path0/src/components/charts/ChartFigure.tsx&quot; component-export=&quot;default&quot; renderer-url=&quot;@astrojs/solid-js/client.js&quot; props=&quot;{&amp;quot;kind&amp;quot;:[0,&amp;quot;dumbbell&amp;quot;],&amp;quot;title&amp;quot;:[0,&amp;quot;\&amp;quot;May contain\&amp;quot; warnings cost the peanut-free bowl 7.9 points&amp;quot;],&amp;quot;subtitle&amp;quot;:[0,&amp;quot;Popularity kept by each bowl when may-contain warnings exclude a candy, and when they are accepted. Hover a dot to see which candies come back.&amp;quot;],&amp;quot;data&amp;quot;:[0,{&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Gluten-free&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,88.2],&amp;quot;tip&amp;quot;:[0,&amp;quot;Gluten-free, warnings exclude\n88.2% popularity score&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,89.6],&amp;quot;tip&amp;quot;:[0,&amp;quot;Gluten-free, warnings accepted\n89.6% popularity score\n\nCandies added: Rolo&amp;quot;]}],&amp;quot;note&amp;quot;:[0,&amp;quot;+1.4&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Peanut-free&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,78],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut-free, warnings exclude\n78.0% popularity score&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,85.9],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut-free, warnings accepted\n85.9% popularity score\n\nCandies added: Kit Kat, Milky Way, M&amp;amp;M&amp;#39;s, Nestle Crunch&amp;quot;]}],&amp;quot;note&amp;quot;:[0,&amp;quot;+7.9&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Nut-free&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,77.1],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nut-free, warnings exclude\n77.1% popularity score&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,81.3],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nut-free, warnings accepted\n81.3% popularity score\n\nCandies added: Milky Way, M&amp;amp;M&amp;#39;s&amp;quot;]}],&amp;quot;note&amp;quot;:[0,&amp;quot;+4.2&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Milk-free&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,74.6],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milk-free, warnings exclude\n74.6% popularity score&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,74.6],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milk-free, warnings accepted\n74.6% popularity score\n\nCandies added: none&amp;quot;]}],&amp;quot;note&amp;quot;:[0,&amp;quot;no change&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Free of all six&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,68.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Free of all six, warnings exclude\n68.7% popularity score&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,68.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Free of all six, warnings accepted\n68.7% popularity score\n\nCandies added: none&amp;quot;]}],&amp;quot;note&amp;quot;:[0,&amp;quot;no change&amp;quot;]}]]]}],&amp;quot;options&amp;quot;:[0,{&amp;quot;aLabel&amp;quot;:[0,&amp;quot;Warnings exclude&amp;quot;],&amp;quot;aColor&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;bLabel&amp;quot;:[0,&amp;quot;Warnings accepted&amp;quot;],&amp;quot;bColor&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;min&amp;quot;:[0,60],&amp;quot;max&amp;quot;:[0,100],&amp;quot;step&amp;quot;:[0,10],&amp;quot;xTitle&amp;quot;:[0,&amp;quot;Popularity kept (unrestricted bowl = 100%)&amp;quot;],&amp;quot;yTitle&amp;quot;:[0,&amp;quot;Bowl&amp;quot;]}],&amp;quot;height&amp;quot;:[0,380]}&quot; ssr client=&quot;load&quot; before-hydration-url=&quot;astro:scripts/before-hydration.js&quot; opts=&quot;{&amp;quot;name&amp;quot;:&amp;quot;ChartFigure&amp;quot;,&amp;quot;value&amp;quot;:true}&quot; await-children&gt;&lt;figure data-hk=&quot;s40000&quot; class=&quot;cjs-chart&quot;&gt;&lt;div class=&quot;chart-title&quot;&gt;&quot;May contain&quot; warnings cost the peanut-free bowl 7.9 points&lt;/div&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s400010&quot; class=&quot;chart-sub&quot;&gt;Popularity kept by each bowl when may-contain warnings exclude a candy, and when they are accepted. Hover a dot to see which candies come back.&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;div class=&quot;chart-canvas&quot; style=&quot;height:380px&quot;&gt;&lt;canvas role=&quot;img&quot; aria-label=&quot;&amp;quot;May contain&amp;quot; warnings cost the peanut-free bowl 7.9 points&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/figure&gt;&lt;!--astro:end--&gt;&lt;/astro-island&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.5:&lt;/strong&gt; Popularity kept by each bowl when may-contain warnings exclude a candy, and when they are accepted.&lt;/p&gt;
&lt;p&gt;“May contain” warnings cost the peanut-free bowl &lt;strong&gt;7.9 points&lt;/strong&gt; of popularity score, as shown in &lt;strong&gt;Figure 1.5&lt;/strong&gt;. Kit Kat, Milky Way, M&amp;amp;M’s and Nestle Crunch list no peanuts, yet each carries a peanut warning on at least one label, which keeps all four out. Accepting the warnings would lift the peanut-free bowl’s popularity score from &lt;strong&gt;78.0% to 85.9%&lt;/strong&gt;. The nut-free bowl loses &lt;strong&gt;4.2 points&lt;/strong&gt; of popularity score the same way, and the gluten-free bowl loses &lt;strong&gt;1.4 points&lt;/strong&gt; to a single warning on Rolo.&lt;/p&gt;
&lt;p&gt;Families should still take the warnings seriously: for a kid with a severe allergy, a shared production line is a real risk. But a meaningful share of what allergic kids give up comes from how candy makers label, rather than from what is in the candy.&lt;/p&gt;
&lt;h3 id=&quot;the-closest-safe-swap-for-each-favorite&quot;&gt;The closest safe swap for each favorite&lt;/h3&gt;
&lt;p&gt;A household that wants a peanut-free bowl still needs to know what to buy instead. For each candy in the unrestricted top 10, the pipeline finds the most similar peanut-free candy using FiveThirtyEight’s candy traits (chocolate, caramel, nougat, crisped rice, bar and others), plus how sugary and how expensive each candy is.&lt;/p&gt;
&lt;astro-island uid=&quot;yhPee&quot; data-solid-render-id=&quot;s5&quot; component-url=&quot;/vercel/path0/src/components/charts/ChartFigure.tsx&quot; component-export=&quot;default&quot; renderer-url=&quot;@astrojs/solid-js/client.js&quot; props=&quot;{&amp;quot;kind&amp;quot;:[0,&amp;quot;dumbbell&amp;quot;],&amp;quot;title&amp;quot;:[0,&amp;quot;The closest safe swap for each favorite&amp;quot;],&amp;quot;subtitle&amp;quot;:[0,&amp;quot;Most similar safe candy by FiveThirtyEight&amp;#39;s traits, sugar and price. Pick an allergy to switch the swaps.&amp;quot;],&amp;quot;data&amp;quot;:[0,{&amp;quot;views&amp;quot;:[1,[[0,{&amp;quot;key&amp;quot;:[0,&amp;quot;peanut_free&amp;quot;],&amp;quot;label&amp;quot;:[0,&amp;quot;Peanut-free&amp;quot;],&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,59.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark\n59.2% win rate\nShared traits: chocolate&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,84.2],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup\n84.2% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Miniatures&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,34.7],&amp;quot;label&amp;quot;:[0,&amp;quot;Sixlets&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Sixlets\n34.7% win rate\nShared traits: chocolate&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,81.9],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Miniatures\n81.9% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Twix&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,59.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark\n59.2% win rate\nShared traits: chocolate, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,81.6],&amp;quot;tip&amp;quot;:[0,&amp;quot;Twix\n81.6% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Kit Kat&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,47.8],&amp;quot;label&amp;quot;:[0,&amp;quot;Mounds&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mounds\n47.8% win rate\nShared traits: chocolate, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,76.8],&amp;quot;tip&amp;quot;:[0,&amp;quot;Kit Kat\n76.8% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Snickers&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,39],&amp;quot;label&amp;quot;:[0,&amp;quot;Charleston Chew&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Charleston Chew\n39.0% win rate\nShared traits: chocolate, nougat, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,76.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Snickers\n76.7% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s pieces&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,57.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Junior Mints&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Junior Mints\n57.2% win rate\nShared traits: chocolate, many per bag&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,73.4],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s pieces\n73.4% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Milky Way&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,39],&amp;quot;label&amp;quot;:[0,&amp;quot;Charleston Chew&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Charleston Chew\n39.0% win rate\nShared traits: chocolate, nougat, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,73.1],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milky Way\n73.1% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s stuffed with pieces&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,59.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark\n59.2% win rate\nShared traits: chocolate&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,72.9],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s stuffed with pieces\n72.9% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Peanut butter M&amp;amp;M&amp;#39;s&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,57.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Junior Mints&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Junior Mints\n57.2% win rate\nShared traits: chocolate, many per bag&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,71.5],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut butter M&amp;amp;M&amp;#39;s\n71.5% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Nestle Butterfinger&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,59.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark\n59.2% win rate\nShared traits: chocolate, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,70.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nestle Butterfinger\n70.7% win rate&amp;quot;]}]}]]]}],[0,{&amp;quot;key&amp;quot;:[0,&amp;quot;nut_free&amp;quot;],&amp;quot;label&amp;quot;:[0,&amp;quot;Nut-free&amp;quot;],&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,47.8],&amp;quot;label&amp;quot;:[0,&amp;quot;Mounds&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mounds\n47.8% win rate\nShared traits: chocolate&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,84.2],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup\n84.2% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Miniatures&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,34.7],&amp;quot;label&amp;quot;:[0,&amp;quot;Sixlets&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Sixlets\n34.7% win rate\nShared traits: chocolate&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,81.9],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Miniatures\n81.9% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Twix&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,47.8],&amp;quot;label&amp;quot;:[0,&amp;quot;Mounds&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mounds\n47.8% win rate\nShared traits: chocolate, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,81.6],&amp;quot;tip&amp;quot;:[0,&amp;quot;Twix\n81.6% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Kit Kat&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,47.8],&amp;quot;label&amp;quot;:[0,&amp;quot;Mounds&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mounds\n47.8% win rate\nShared traits: chocolate, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,76.8],&amp;quot;tip&amp;quot;:[0,&amp;quot;Kit Kat\n76.8% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Snickers&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,39],&amp;quot;label&amp;quot;:[0,&amp;quot;Charleston Chew&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Charleston Chew\n39.0% win rate\nShared traits: chocolate, nougat, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,76.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Snickers\n76.7% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s pieces&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,57.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Junior Mints&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Junior Mints\n57.2% win rate\nShared traits: chocolate, many per bag&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,73.4],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s pieces\n73.4% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Milky Way&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,39],&amp;quot;label&amp;quot;:[0,&amp;quot;Charleston Chew&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Charleston Chew\n39.0% win rate\nShared traits: chocolate, nougat, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,73.1],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milky Way\n73.1% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s stuffed with pieces&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,47.8],&amp;quot;label&amp;quot;:[0,&amp;quot;Mounds&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mounds\n47.8% win rate\nShared traits: chocolate&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,72.9],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s stuffed with pieces\n72.9% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Peanut butter M&amp;amp;M&amp;#39;s&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,57.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Junior Mints&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Junior Mints\n57.2% win rate\nShared traits: chocolate, many per bag&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,71.5],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut butter M&amp;amp;M&amp;#39;s\n71.5% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Nestle Butterfinger&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,47.8],&amp;quot;label&amp;quot;:[0,&amp;quot;Mounds&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mounds\n47.8% win rate\nShared traits: chocolate, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,70.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nestle Butterfinger\n70.7% win rate&amp;quot;]}]}]]]}],[0,{&amp;quot;key&amp;quot;:[0,&amp;quot;milk_free&amp;quot;],&amp;quot;label&amp;quot;:[0,&amp;quot;Milk-free&amp;quot;],&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,23.4],&amp;quot;label&amp;quot;:[0,&amp;quot;Boston Baked Beans&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Boston Baked Beans\n23.4% win rate\nShared traits: peanut or almond&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,84.2],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup\n84.2% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Miniatures&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,23.4],&amp;quot;label&amp;quot;:[0,&amp;quot;Boston Baked Beans&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Boston Baked Beans\n23.4% win rate\nShared traits: peanut or almond&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,81.9],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Miniatures\n81.9% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Twix&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,34.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Haribo Happy Cola&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Haribo Happy Cola\n34.2% win rate\nShared traits: none&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,81.6],&amp;quot;tip&amp;quot;:[0,&amp;quot;Twix\n81.6% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Kit Kat&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,34.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Haribo Happy Cola&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Haribo Happy Cola\n34.2% win rate\nShared traits: none&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,76.8],&amp;quot;tip&amp;quot;:[0,&amp;quot;Kit Kat\n76.8% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Snickers&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,23.4],&amp;quot;label&amp;quot;:[0,&amp;quot;Boston Baked Beans&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Boston Baked Beans\n23.4% win rate\nShared traits: peanut or almond&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,76.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Snickers\n76.7% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s pieces&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,23.4],&amp;quot;label&amp;quot;:[0,&amp;quot;Boston Baked Beans&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Boston Baked Beans\n23.4% win rate\nShared traits: peanut or almond, many per bag&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,73.4],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s pieces\n73.4% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Milky Way&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,34.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Haribo Happy Cola&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Haribo Happy Cola\n34.2% win rate\nShared traits: none&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,73.1],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milky Way\n73.1% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s stuffed with pieces&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,23.4],&amp;quot;label&amp;quot;:[0,&amp;quot;Boston Baked Beans&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Boston Baked Beans\n23.4% win rate\nShared traits: peanut or almond&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,72.9],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s stuffed with pieces\n72.9% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Peanut butter M&amp;amp;M&amp;#39;s&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,23.4],&amp;quot;label&amp;quot;:[0,&amp;quot;Boston Baked Beans&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Boston Baked Beans\n23.4% win rate\nShared traits: peanut or almond, many per bag&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,71.5],&amp;quot;tip&amp;quot;:[0,&amp;quot;Peanut butter M&amp;amp;M&amp;#39;s\n71.5% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Nestle Butterfinger&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,23.4],&amp;quot;label&amp;quot;:[0,&amp;quot;Boston Baked Beans&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Boston Baked Beans\n23.4% win rate\nShared traits: peanut or almond&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,70.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nestle Butterfinger\n70.7% win rate&amp;quot;]}]}]]]}],[0,{&amp;quot;key&amp;quot;:[0,&amp;quot;gluten_free&amp;quot;],&amp;quot;label&amp;quot;:[0,&amp;quot;Gluten-free&amp;quot;],&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Twix&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,47.8],&amp;quot;label&amp;quot;:[0,&amp;quot;Mounds&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mounds\n47.8% win rate\nShared traits: chocolate, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,81.6],&amp;quot;tip&amp;quot;:[0,&amp;quot;Twix\n81.6% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Kit Kat&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,47.8],&amp;quot;label&amp;quot;:[0,&amp;quot;Mounds&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Mounds\n47.8% win rate\nShared traits: chocolate, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,76.8],&amp;quot;tip&amp;quot;:[0,&amp;quot;Kit Kat\n76.8% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Snickers&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,39],&amp;quot;label&amp;quot;:[0,&amp;quot;Charleston Chew&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Charleston Chew\n39.0% win rate\nShared traits: chocolate, nougat, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,76.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Snickers\n76.7% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Milky Way&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,39],&amp;quot;label&amp;quot;:[0,&amp;quot;Charleston Chew&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Charleston Chew\n39.0% win rate\nShared traits: chocolate, nougat, bar&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,73.1],&amp;quot;tip&amp;quot;:[0,&amp;quot;Milky Way\n73.1% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s stuffed with pieces&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,84.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup\n84.2% win rate\nShared traits: chocolate, peanut or almond&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,72.9],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s stuffed with pieces\n72.9% win rate&amp;quot;]}]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Nestle Butterfinger&amp;quot;],&amp;quot;a&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,84.2],&amp;quot;label&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup\n84.2% win rate\nShared traits: chocolate, peanut or almond&amp;quot;]}],&amp;quot;b&amp;quot;:[0,{&amp;quot;value&amp;quot;:[0,70.7],&amp;quot;tip&amp;quot;:[0,&amp;quot;Nestle Butterfinger\n70.7% win rate&amp;quot;]}]}]]]}]]]}],&amp;quot;options&amp;quot;:[0,{&amp;quot;aLabel&amp;quot;:[0,&amp;quot;Safe swap&amp;quot;],&amp;quot;aColor&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;bLabel&amp;quot;:[0,&amp;quot;Favorite&amp;quot;],&amp;quot;bColor&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;min&amp;quot;:[0,30],&amp;quot;max&amp;quot;:[0,90],&amp;quot;step&amp;quot;:[0,10],&amp;quot;xTitle&amp;quot;:[0,&amp;quot;Win rate in head-to-head votes&amp;quot;],&amp;quot;yTitle&amp;quot;:[0,&amp;quot;Favorite in the unrestricted bowl&amp;quot;]}],&amp;quot;height&amp;quot;:[0,560]}&quot; ssr client=&quot;load&quot; before-hydration-url=&quot;astro:scripts/before-hydration.js&quot; opts=&quot;{&amp;quot;name&amp;quot;:&amp;quot;ChartFigure&amp;quot;,&amp;quot;value&amp;quot;:true}&quot; await-children&gt;&lt;figure data-hk=&quot;s50000&quot; class=&quot;cjs-chart&quot;&gt;&lt;div class=&quot;chart-title&quot;&gt;The closest safe swap for each favorite&lt;/div&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s500010&quot; class=&quot;chart-sub&quot;&gt;Most similar safe candy by FiveThirtyEight&apos;s traits, sugar and price. Pick an allergy to switch the swaps.&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s500020&quot; class=&quot;chart-views&quot; role=&quot;tablist&quot;&gt;&lt;button data-hk=&quot;s5000210&quot; type=&quot;button&quot; role=&quot;tab&quot; data-view=&quot;peanut_free&quot; aria-selected=&quot;true&quot;&gt;Peanut-free&lt;/button&gt;&lt;button data-hk=&quot;s5000211&quot; type=&quot;button&quot; role=&quot;tab&quot; data-view=&quot;nut_free&quot; aria-selected=&quot;false&quot;&gt;Nut-free&lt;/button&gt;&lt;button data-hk=&quot;s5000212&quot; type=&quot;button&quot; role=&quot;tab&quot; data-view=&quot;milk_free&quot; aria-selected=&quot;false&quot;&gt;Milk-free&lt;/button&gt;&lt;button data-hk=&quot;s5000213&quot; type=&quot;button&quot; role=&quot;tab&quot; data-view=&quot;gluten_free&quot; aria-selected=&quot;false&quot;&gt;Gluten-free&lt;/button&gt;&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;div class=&quot;chart-canvas&quot; style=&quot;height:560px&quot;&gt;&lt;canvas role=&quot;img&quot; aria-label=&quot;The closest safe swap for each favorite&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/figure&gt;&lt;!--astro:end--&gt;&lt;/astro-island&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.6:&lt;/strong&gt; The most similar safe candy for each favorite in the unrestricted bowl, with the win rate of each. Peanut-free is shown first; the buttons switch to the other allergies.&lt;/p&gt;
&lt;p&gt;The closest swaps are familiar candies. Twix, Butterfinger and Reese’s Peanut Butter Cups point to Hershey’s Special Dark, Kit Kat to Mounds, Snickers and Milky Way to Charleston Chew, and Reese’s Pieces to Junior Mints, as shown in &lt;strong&gt;Figure 1.6&lt;/strong&gt;. The catch is popularity. The best swap, Hershey’s Special Dark, has a &lt;strong&gt;59.2% win rate&lt;/strong&gt;, more than 20 points below Twix’s &lt;strong&gt;81.6%&lt;/strong&gt; and 25 points below Reese’s Peanut Butter Cups’ &lt;strong&gt;84.2%&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;For a bowl free of all six allergens, the same search finds nothing similar. Every favorite maps to an unrelated gummy, because no chocolate candy passes all six restrictions.&lt;/p&gt;
&lt;h3 id=&quot;one-bowl-for-the-whole-street&quot;&gt;One bowl for the whole street&lt;/h3&gt;
&lt;p&gt;Households handing out candy don’t know which trick-or-treaters at their door have which allergies. So the last question is: which single bowl gives the most trick-or-treaters a favorite they can eat?&lt;/p&gt;
&lt;p&gt;The pipeline answers it with a small optimization. About &lt;strong&gt;2.2%&lt;/strong&gt; of US children are allergic to peanuts, &lt;strong&gt;1.9%&lt;/strong&gt; to milk and &lt;strong&gt;1.2%&lt;/strong&gt; to tree nuts, according to a &lt;a href=&quot;https://pubmed.ncbi.nlm.nih.gov/30455345/&quot;&gt;national survey of &lt;strong&gt;38,408 children&lt;/strong&gt; published in &lt;em&gt;Pediatrics&lt;/em&gt;&lt;/a&gt;. The pipeline weights each group of kids by those rates and picks, one candy at a time, the 10 candies that maximize the average win rate of the best candy each kid can eat, counting zero for a kid with nothing safe in the bowl.&lt;/p&gt;
&lt;astro-island uid=&quot;j4pWN&quot; data-solid-render-id=&quot;s6&quot; component-url=&quot;/vercel/path0/src/components/charts/ChartFigure.tsx&quot; component-export=&quot;default&quot; renderer-url=&quot;@astrojs/solid-js/client.js&quot; props=&quot;{&amp;quot;kind&amp;quot;:[0,&amp;quot;simulator&amp;quot;],&amp;quot;title&amp;quot;:[0,&amp;quot;One swap gives every allergic kid something to eat&amp;quot;],&amp;quot;subtitle&amp;quot;:[0,&amp;quot;The regular top 10 with its least popular candies swapped for the most popular candies safe for peanut, milk and tree-nut allergies. Slide to add more safe candies and watch the popularity score.&amp;quot;],&amp;quot;data&amp;quot;:[0,{&amp;quot;candies&amp;quot;:[1,[[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Peanut Butter cup&amp;quot;],&amp;quot;win&amp;quot;:[0,84.18],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Reese&amp;#39;s Miniatures&amp;quot;],&amp;quot;win&amp;quot;:[0,81.87],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Twix&amp;quot;],&amp;quot;win&amp;quot;:[0,81.64],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Kit Kat&amp;quot;],&amp;quot;win&amp;quot;:[0,76.77],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Snickers&amp;quot;],&amp;quot;win&amp;quot;:[0,76.67],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Reese&amp;#39;s pieces&amp;quot;],&amp;quot;win&amp;quot;:[0,73.43],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Milky Way&amp;quot;],&amp;quot;win&amp;quot;:[0,73.1],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Reese&amp;#39;s stuffed with pieces&amp;quot;],&amp;quot;win&amp;quot;:[0,72.89],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Peanut butter M&amp;amp;M&amp;#39;s&amp;quot;],&amp;quot;win&amp;quot;:[0,71.47],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Nestle Butterfinger&amp;quot;],&amp;quot;win&amp;quot;:[0,70.74],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Peanut M&amp;amp;Ms&amp;quot;],&amp;quot;win&amp;quot;:[0,69.48],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;3 Musketeers&amp;quot;],&amp;quot;win&amp;quot;:[0,67.6],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Starburst&amp;quot;],&amp;quot;win&amp;quot;:[0,67.04],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;100 Grand&amp;quot;],&amp;quot;win&amp;quot;:[0,66.97],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;M&amp;amp;M&amp;#39;s&amp;quot;],&amp;quot;win&amp;quot;:[0,66.57],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Nestle Crunch&amp;quot;],&amp;quot;win&amp;quot;:[0,66.47],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Rolo&amp;quot;],&amp;quot;win&amp;quot;:[0,65.72],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Milky Way Simply Caramel&amp;quot;],&amp;quot;win&amp;quot;:[0,64.35],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Skittles original&amp;quot;],&amp;quot;win&amp;quot;:[0,63.09],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Krackel&amp;quot;],&amp;quot;win&amp;quot;:[0,62.28],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Milky Way Midnight&amp;quot;],&amp;quot;win&amp;quot;:[0,60.8],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Sour Patch Kids&amp;quot;],&amp;quot;win&amp;quot;:[0,59.86],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Snickers Crisper&amp;quot;],&amp;quot;win&amp;quot;:[0,59.53],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Special Dark&amp;quot;],&amp;quot;win&amp;quot;:[0,59.24],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;peanut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Junior Mints&amp;quot;],&amp;quot;win&amp;quot;:[0,57.22],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Haribo Gold Bears&amp;quot;],&amp;quot;win&amp;quot;:[0,57.12],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Baby Ruth&amp;quot;],&amp;quot;win&amp;quot;:[0,56.91],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Milk Chocolate&amp;quot;],&amp;quot;win&amp;quot;:[0,56.49],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Hershey&amp;#39;s Kisses&amp;quot;],&amp;quot;win&amp;quot;:[0,55.38],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Nerds&amp;quot;],&amp;quot;win&amp;quot;:[0,55.35],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Skittles wildberry&amp;quot;],&amp;quot;win&amp;quot;:[0,55.1],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Milk Duds&amp;quot;],&amp;quot;win&amp;quot;:[0,55.06],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Swedish Fish&amp;quot;],&amp;quot;win&amp;quot;:[0,54.86],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Mr Good Bar&amp;quot;],&amp;quot;win&amp;quot;:[0,54.53],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Lifesavers big ring gummies&amp;quot;],&amp;quot;win&amp;quot;:[0,52.91],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Sour Patch Tricksters&amp;quot;],&amp;quot;win&amp;quot;:[0,52.83],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Air Heads&amp;quot;],&amp;quot;win&amp;quot;:[0,52.34],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Haribo Sour Bears&amp;quot;],&amp;quot;win&amp;quot;:[0,51.41],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Almond Joy&amp;quot;],&amp;quot;win&amp;quot;:[0,50.35],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Tootsie Roll Snack Bars&amp;quot;],&amp;quot;win&amp;quot;:[0,49.65],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Whoppers&amp;quot;],&amp;quot;win&amp;quot;:[0,49.52],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Tootsie Pop&amp;quot;],&amp;quot;win&amp;quot;:[0,48.98],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Mounds&amp;quot;],&amp;quot;win&amp;quot;:[0,47.83],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Trolli Sour Bites&amp;quot;],&amp;quot;win&amp;quot;:[0,47.17],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Gobstopper&amp;quot;],&amp;quot;win&amp;quot;:[0,46.78],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Mike &amp;amp; Ike&amp;quot;],&amp;quot;win&amp;quot;:[0,46.41],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Payday&amp;quot;],&amp;quot;win&amp;quot;:[0,46.3],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Smarties candy&amp;quot;],&amp;quot;win&amp;quot;:[0,46],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Tootsie Roll Midgies&amp;quot;],&amp;quot;win&amp;quot;:[0,45.74],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Twizzlers&amp;quot;],&amp;quot;win&amp;quot;:[0,45.47],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Welch&amp;#39;s Fruit Snacks&amp;quot;],&amp;quot;win&amp;quot;:[0,44.38],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Fruit Chews&amp;quot;],&amp;quot;win&amp;quot;:[0,43.09],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Tootsie Roll Juniors&amp;quot;],&amp;quot;win&amp;quot;:[0,43.07],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Runts&amp;quot;],&amp;quot;win&amp;quot;:[0,42.85],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Dots&amp;quot;],&amp;quot;win&amp;quot;:[0,42.27],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Haribo Twin Snakes&amp;quot;],&amp;quot;win&amp;quot;:[0,42.18],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Werther&amp;#39;s Original Caramel&amp;quot;],&amp;quot;win&amp;quot;:[0,41.9],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;peanut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Laffy Taffy&amp;quot;],&amp;quot;win&amp;quot;:[0,41.39],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Pop Rocks&amp;quot;],&amp;quot;win&amp;quot;:[0,41.27],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Dum Dums&amp;quot;],&amp;quot;win&amp;quot;:[0,39.46],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Now &amp;amp; Later&amp;quot;],&amp;quot;win&amp;quot;:[0,39.45],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Fun Dip&amp;quot;],&amp;quot;win&amp;quot;:[0,39.19],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Lemonhead&amp;quot;],&amp;quot;win&amp;quot;:[0,39.14],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Warheads&amp;quot;],&amp;quot;win&amp;quot;:[0,39.01],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Charleston Chew&amp;quot;],&amp;quot;win&amp;quot;:[0,38.98],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Candy Corn&amp;quot;],&amp;quot;win&amp;quot;:[0,38.01],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Nestle Smarties&amp;quot;],&amp;quot;win&amp;quot;:[0,37.89],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Pixie Sticks&amp;quot;],&amp;quot;win&amp;quot;:[0,37.72],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Red vines&amp;quot;],&amp;quot;win&amp;quot;:[0,37.35],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Chewey Lemonhead Fruit Mix&amp;quot;],&amp;quot;win&amp;quot;:[0,36.02],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Ring pop&amp;quot;],&amp;quot;win&amp;quot;:[0,35.29],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Sixlets&amp;quot;],&amp;quot;win&amp;quot;:[0,34.72],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Strawberry bon bons&amp;quot;],&amp;quot;win&amp;quot;:[0,34.58],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Caramel Apple Pops&amp;quot;],&amp;quot;win&amp;quot;:[0,34.52],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Haribo Happy Cola&amp;quot;],&amp;quot;win&amp;quot;:[0,34.16],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Sugar Babies&amp;quot;],&amp;quot;win&amp;quot;:[0,33.44],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Sugar Daddy&amp;quot;],&amp;quot;win&amp;quot;:[0,32.23],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Root Beer Barrels&amp;quot;],&amp;quot;win&amp;quot;:[0,29.7],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Jawbusters&amp;quot;],&amp;quot;win&amp;quot;:[0,28.13],&amp;quot;safe&amp;quot;:[1,[]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Super Bubble&amp;quot;],&amp;quot;win&amp;quot;:[0,27.3],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;soy&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Chiclets&amp;quot;],&amp;quot;win&amp;quot;:[0,24.52],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;peanut&amp;quot;],[0,&amp;quot;tree_nut&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Boston Baked Beans&amp;quot;],&amp;quot;win&amp;quot;:[0,23.42],&amp;quot;safe&amp;quot;:[1,[[0,&amp;quot;egg&amp;quot;],[0,&amp;quot;gluten&amp;quot;],[0,&amp;quot;milk&amp;quot;],[0,&amp;quot;soy&amp;quot;]]]}],[0,{&amp;quot;candy&amp;quot;:[0,&amp;quot;Nik L Nip&amp;quot;],&amp;quot;win&amp;quot;:[0,22.45],&amp;quot;safe&amp;quot;:[1,[]]}]]]}],&amp;quot;options&amp;quot;:[0,{&amp;quot;max&amp;quot;:[0,100],&amp;quot;step&amp;quot;:[0,25],&amp;quot;suffix&amp;quot;:[0,&amp;quot;%&amp;quot;],&amp;quot;xTitle&amp;quot;:[0,&amp;quot;Win rate in head-to-head votes&amp;quot;],&amp;quot;yTitle&amp;quot;:[0,&amp;quot;Candy in the bowl&amp;quot;],&amp;quot;rightPad&amp;quot;:[0,60]}],&amp;quot;height&amp;quot;:[0,480]}&quot; ssr client=&quot;load&quot; before-hydration-url=&quot;astro:scripts/before-hydration.js&quot; opts=&quot;{&amp;quot;name&amp;quot;:&amp;quot;ChartFigure&amp;quot;,&amp;quot;value&amp;quot;:true}&quot; await-children&gt;&lt;figure data-hk=&quot;s60000&quot; class=&quot;cjs-chart&quot;&gt;&lt;div class=&quot;chart-title&quot;&gt;One swap gives every allergic kid something to eat&lt;/div&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s600010&quot; class=&quot;chart-sub&quot;&gt;The regular top 10 with its least popular candies swapped for the most popular candies safe for peanut, milk and tree-nut allergies. Slide to add more safe candies and watch the popularity score.&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s600030&quot; class=&quot;chart-sliders&quot;&gt;&lt;label&gt;&lt;span&gt;Allergy-safe candies&lt;/span&gt;&lt;input type=&quot;range&quot; min=&quot;0&quot; max=&quot;10&quot; step=&quot;1&quot; value=&quot;1&quot; data-safe-count&gt;&lt;output&gt;&lt;!--$--&gt;1&lt;!--/--&gt; of 10&lt;/output&gt;&lt;/label&gt;&lt;div class=&quot;chart-stats&quot; aria-live=&quot;polite&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--/--&gt;&lt;div class=&quot;chart-canvas&quot; style=&quot;height:480px&quot;&gt;&lt;canvas role=&quot;img&quot; aria-label=&quot;One swap gives every allergic kid something to eat&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/figure&gt;&lt;!--astro:end--&gt;&lt;/astro-island&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.7:&lt;/strong&gt; The bowl with a chosen number of candies that are safe for peanut, milk and tree-nut allergies. The optimization picks one, Starburst; the slider shows what each extra safe candy costs.&lt;/p&gt;
&lt;p&gt;One swap is enough. The best bowl for a whole street is the regular top 10 with Butterfinger replaced by Starburst, as shown in &lt;strong&gt;Figure 1.7&lt;/strong&gt;. Starburst is the most popular candy that is safe for all three allergies, so that single change gives every kid with a peanut, milk or tree-nut allergy something to eat, no matter how common each allergy is. The bowl’s average win rate drops only from &lt;strong&gt;76.3% to 75.9%&lt;/strong&gt;, a &lt;strong&gt;99.5% popularity score&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Each safe candy after the first costs more than the one before it: two safe candies keep a &lt;strong&gt;98.4%&lt;/strong&gt; popularity score, three keep &lt;strong&gt;96.7%&lt;/strong&gt;, five keep &lt;strong&gt;92.2%&lt;/strong&gt;, and a bowl of ten keeps &lt;strong&gt;74.6%&lt;/strong&gt;. The optimization stops at one safe candy because allergic kids are a small share of the street, so each extra safe candy adds less than the chocolate it replaces. It also treats each allergy separately, and I could not confirm the survey rates for egg, wheat and soy, so those allergies are left out.&lt;/p&gt;
&lt;h2 id=&quot;matching-candy-names-to-products&quot;&gt;Matching candy names to products&lt;/h2&gt;
&lt;p&gt;Every result above depends on linking each candy in the vote to the right products in Open Food Facts, so this is where most of the work went.&lt;/p&gt;
&lt;p&gt;The ranking says “Snickers”. Open Food Facts has hundreds of products with “Snickers” in the name, including ice cream bars, protein bars and almond variants. Joining the two datasets is the riskiest step in the whole pipeline, because a wrong match can change a candy’s allergy status without causing any error.&lt;/p&gt;
&lt;p&gt;I compared two approaches: matching on the candy’s name alone, and hand-written matching rules stored as a dbt seed, a small CSV file that lives in the repository, so the rules are reviewed like code. Name matching found &lt;strong&gt;53 of the 83&lt;/strong&gt; candies and pulled in &lt;strong&gt;80 products that are not candy at all&lt;/strong&gt;, such as an Almond Joy coffee creamer and a Hershey’s ice cream bar. The hand-written rules found &lt;strong&gt;67 candies&lt;/strong&gt; with &lt;strong&gt;no non-candy matches&lt;/strong&gt;, because they handle spellings like “KitKat” and “Mike and Ike” and exclude variants like Snickers Almond.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Figure 1.8&lt;/strong&gt; compares how many candies each approach matches and how many non-candy products it pulls in.&lt;/p&gt;
&lt;astro-island uid=&quot;12wnkA&quot; data-solid-render-id=&quot;s7&quot; component-url=&quot;/vercel/path0/src/components/charts/ChartFigure.tsx&quot; component-export=&quot;default&quot; renderer-url=&quot;@astrojs/solid-js/client.js&quot; props=&quot;{&amp;quot;kind&amp;quot;:[0,&amp;quot;hbar&amp;quot;],&amp;quot;title&amp;quot;:[0,&amp;quot;Curated matching rules remove every false match&amp;quot;],&amp;quot;subtitle&amp;quot;:[0,&amp;quot;Matching on the name alone pulls in coffee creamer, ice cream and cereal&amp;quot;],&amp;quot;data&amp;quot;:[0,{&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Name only&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,53],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;53&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Name only\n53 of 83 candies matched\n921 products matched&amp;quot;]}],[0,{&amp;quot;value&amp;quot;:[0,80],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;80&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Name only\n80 matched products that are not candy&amp;quot;]}]]]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Curated rules&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,67],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;67&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Curated rules\n67 of 83 candies matched\n1217 products matched&amp;quot;]}],[0,{&amp;quot;value&amp;quot;:[0,0],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;text&amp;quot;:[0,&amp;quot;0&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Curated rules\n0 matched products that are not candy&amp;quot;]}]]]}]]]}],&amp;quot;options&amp;quot;:[0,{&amp;quot;legend&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Candies matched (of 83)&amp;quot;],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Non-candy products matched&amp;quot;],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;]}]]],&amp;quot;mode&amp;quot;:[0,&amp;quot;group&amp;quot;],&amp;quot;max&amp;quot;:[0,90],&amp;quot;step&amp;quot;:[0,15],&amp;quot;xTitle&amp;quot;:[0,&amp;quot;Number of candies or products&amp;quot;],&amp;quot;yTitle&amp;quot;:[0,&amp;quot;Method&amp;quot;],&amp;quot;rightPad&amp;quot;:[0,20]}],&amp;quot;height&amp;quot;:[0,320]}&quot; ssr client=&quot;load&quot; before-hydration-url=&quot;astro:scripts/before-hydration.js&quot; opts=&quot;{&amp;quot;name&amp;quot;:&amp;quot;ChartFigure&amp;quot;,&amp;quot;value&amp;quot;:true}&quot; await-children&gt;&lt;figure data-hk=&quot;s70000&quot; class=&quot;cjs-chart&quot;&gt;&lt;div class=&quot;chart-title&quot;&gt;Curated matching rules remove every false match&lt;/div&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s700010&quot; class=&quot;chart-sub&quot;&gt;Matching on the name alone pulls in coffee creamer, ice cream and cereal&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;div class=&quot;chart-canvas&quot; style=&quot;height:320px&quot;&gt;&lt;canvas role=&quot;img&quot; aria-label=&quot;Curated matching rules remove every false match&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/figure&gt;&lt;!--astro:end--&gt;&lt;/astro-island&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.8:&lt;/strong&gt; Name-only matching compared with the curated matching rules, by candies matched and non-candy products matched.&lt;/p&gt;
&lt;h2 id=&quot;how-a-matching-bug-put-butterfinger-in-the-peanut-free-bowl&quot;&gt;How a matching bug put Butterfinger in the peanut-free bowl&lt;/h2&gt;
&lt;p&gt;Butterfinger is made with peanuts, yet the first version of the peanut-free bowl included it. The 2017 data had only three Butterfinger products. One was the bar itself, with no ingredient list. The other two were a caramel apple and a box of marshmallow squares “made with” Butterfinger, and their ingredient lists never mention peanuts.&lt;/p&gt;
&lt;p&gt;The fix has two parts. Products “made with” a candy no longer count as evidence for that candy, and neither do caramel apples or other derived treats. And the ranking itself flags candies made with peanuts or almonds, so the pipeline now keeps every flagged candy out of peanut-free and nut-free bowls, no matter what the labels say. A dbt test enforces it on every run.&lt;/p&gt;
&lt;p&gt;The change feed later confirmed that this rule was correct: the current Butterfinger labels list peanuts, milk and soy.&lt;/p&gt;
&lt;h3 id=&quot;three-more-matching-bugs&quot;&gt;Three more matching bugs&lt;/h3&gt;
&lt;p&gt;Mixed packs made one candy look like it contained another candy’s allergens. A “Reese’s &amp;amp; Kit Kat Halloween Candy Assortment” made Kit Kat look like it contains peanuts, so the pipeline now excludes assortments and variety packs.&lt;/p&gt;
&lt;p&gt;A couple of bad records could override dozens of good ones. The pipeline prefers US labels because US and European recipes differ. With the threshold at two products, Snickers’ only two current US records (a popcorn listing named “Snickers” and a wrapper scan of customer-service text) decided the result over &lt;strong&gt;25 complete labels&lt;/strong&gt; from other countries and made Snickers look peanut-free. US labels now decide only when there are at least three.&lt;/p&gt;
&lt;p&gt;A company name matched the wrong candy. The rule for Tootsie Roll Juniors looked for “Tootsie Roll” and “Junior” anywhere in a product’s name or brand. Junior Mints are made by Tootsie Roll Industries, so all five Junior Mints products counted as Tootsie Roll Juniors, and since Junior Mints list no milk, Tootsie Roll Juniors looked milk-free even though they are made with condensed milk. The rule now excludes Junior Mints, and a test pins it.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Every one of these bugs made a candy look safer than it is, which is the dangerous direction for allergy data.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;is-the-2017-answer-still-true&quot;&gt;Is the 2017 answer still true?&lt;/h2&gt;
&lt;p&gt;Both Kaggle files are from 2017, so the obvious question is whether the labels on shelves today still agree. The daily change feed answers it. Its first two weeks held &lt;strong&gt;98,694&lt;/strong&gt; product edits, &lt;strong&gt;348&lt;/strong&gt; of them for ranked candies, and &lt;strong&gt;21 candies&lt;/strong&gt; had at least two current products with ingredient lists.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Figure 1.9&lt;/strong&gt; groups the 83 candies by how their allergen status in the 2017 data compares with their current labels.&lt;/p&gt;
&lt;astro-island uid=&quot;2r6A9i&quot; data-solid-render-id=&quot;s8&quot; component-url=&quot;/vercel/path0/src/components/charts/ChartFigure.tsx&quot; component-export=&quot;default&quot; renderer-url=&quot;@astrojs/solid-js/client.js&quot; props=&quot;{&amp;quot;kind&amp;quot;:[0,&amp;quot;hbar&amp;quot;],&amp;quot;title&amp;quot;:[0,&amp;quot;12 of 19 candies with current data changed allergen status&amp;quot;],&amp;quot;subtitle&amp;quot;:[0,&amp;quot;Each candy&amp;#39;s 2017 status compared with products edited since the daily change feed started. Hover a bar to see the candies.&amp;quot;],&amp;quot;data&amp;quot;:[0,{&amp;quot;rows&amp;quot;:[1,[[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Changed&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,12],&amp;quot;color&amp;quot;:[0,&amp;quot;red&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Changed: 12 candies\n\nHershey&amp;#39;s Milk Chocolate, Kit Kat, M&amp;amp;M&amp;#39;s, Milky Way, Nestle Crunch, Nestle Smarties, Peanut M&amp;amp;Ms, Peanut butter M&amp;amp;M&amp;#39;s, Rolo, Snickers, Twix, Werther&amp;#39;s Original Caramel&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;12&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Unchanged&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,7],&amp;quot;color&amp;quot;:[0,&amp;quot;aqua&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Unchanged: 7 candies\n\nHaribo Gold Bears, Haribo Happy Cola, Reese&amp;#39;s Miniatures, Reese&amp;#39;s Peanut Butter cup, Skittles original, Sour Patch Kids, Welch&amp;#39;s Fruit Snacks&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;7&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Newly covered&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,2],&amp;quot;color&amp;quot;:[0,&amp;quot;fg2&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Newly covered: 2 candies\n\n3 Musketeers, Nestle Butterfinger&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;2&amp;quot;]}],[0,{&amp;quot;label&amp;quot;:[0,&amp;quot;Not enough current data&amp;quot;],&amp;quot;bars&amp;quot;:[1,[[0,{&amp;quot;value&amp;quot;:[0,62],&amp;quot;color&amp;quot;:[0,&amp;quot;gray&amp;quot;],&amp;quot;tip&amp;quot;:[0,&amp;quot;Not enough current data: 62 candies&amp;quot;]}]]],&amp;quot;valueText&amp;quot;:[0,&amp;quot;62&amp;quot;]}]]]}],&amp;quot;options&amp;quot;:[0,{&amp;quot;max&amp;quot;:[0,70],&amp;quot;step&amp;quot;:[0,10],&amp;quot;xTitle&amp;quot;:[0,&amp;quot;Candies&amp;quot;],&amp;quot;yTitle&amp;quot;:[0,&amp;quot;Compared with current labels&amp;quot;],&amp;quot;rightPad&amp;quot;:[0,40]}],&amp;quot;height&amp;quot;:[0,340]}&quot; ssr client=&quot;load&quot; before-hydration-url=&quot;astro:scripts/before-hydration.js&quot; opts=&quot;{&amp;quot;name&amp;quot;:&amp;quot;ChartFigure&amp;quot;,&amp;quot;value&amp;quot;:true}&quot; await-children&gt;&lt;figure data-hk=&quot;s80000&quot; class=&quot;cjs-chart&quot;&gt;&lt;div class=&quot;chart-title&quot;&gt;12 of 19 candies with current data changed allergen status&lt;/div&gt;&lt;!--$--&gt;&lt;div data-hk=&quot;s800010&quot; class=&quot;chart-sub&quot;&gt;Each candy&apos;s 2017 status compared with products edited since the daily change feed started. Hover a bar to see the candies.&lt;/div&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;!--$--&gt;&lt;!--/--&gt;&lt;div class=&quot;chart-canvas&quot; style=&quot;height:340px&quot;&gt;&lt;canvas role=&quot;img&quot; aria-label=&quot;12 of 19 candies with current data changed allergen status&quot;&gt;&lt;/canvas&gt;&lt;/div&gt;&lt;/figure&gt;&lt;!--astro:end--&gt;&lt;/astro-island&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.9:&lt;/strong&gt; How each candy’s allergen status in the 2017 data compares with its current labels from the daily change feed.&lt;/p&gt;
&lt;p&gt;Most changes add allergen warnings. Snickers and Milky Way moved from &lt;code&gt;varies&lt;/code&gt; to &lt;code&gt;contains&lt;/code&gt; for egg, which matches their egg-white nougat. Hershey’s milk chocolate now carries a tree-nut “may contain” warning that the 2017 records did not show. Butterfinger, unknown in 2017, now has labels that list peanuts, milk and soy.&lt;/p&gt;
&lt;p&gt;The bowls stay on the pinned 2017 data, so the results above are reproducible. The comparison grows every morning as the job archives another day of the feed, and a dbt test warns if a day is ever missed.&lt;/p&gt;
&lt;h2 id=&quot;what-this-means-for-anyone-handing-out-candy&quot;&gt;What this means for anyone handing out candy&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Keep the bowl you were going to buy and swap one candy for Starburst. Every kid with a peanut, milk or tree-nut allergy then has something to eat, and the bowl barely loses any popularity.&lt;/li&gt;
&lt;li&gt;If you know a peanut-allergic kid is coming, build the bowl around Starburst, Rolo, Skittles and Sour Patch Kids. That bowl keeps a &lt;strong&gt;78% popularity score&lt;/strong&gt;, so you give up only &lt;strong&gt;about a fifth&lt;/strong&gt; of the popularity.&lt;/li&gt;
&lt;li&gt;Swap favorites one for one: Hershey’s Special Dark for Twix, Mounds for Kit Kat, Charleston Chew for Snickers, and Junior Mints for Reese’s Pieces.&lt;/li&gt;
&lt;li&gt;Check the “may contain” line as well as the ingredients. These warnings vary from one candy maker to the next, and they are why Kit Kat and M&amp;amp;M’s drop out of a peanut-free bowl even though neither lists peanuts.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;a name=&quot;references&quot;&gt;&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.kaggle.com/datasets/fivethirtyeight/the-ultimate-halloween-candy-power-ranking&quot;&gt;The Ultimate Halloween Candy Power Ranking, FiveThirtyEight, via Kaggle (MIT)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.kaggle.com/datasets/openfoodfacts/world-food-facts&quot;&gt;Open Food Facts world-food-facts, Open Food Facts, via Kaggle (ODbL)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://static.openfoodfacts.org/data/delta/index.txt&quot;&gt;Open Food Facts daily change feed index, Open Food Facts (ODbL)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.chowhound.com/2299896/best-selling-halloween-candy-america-reeses/&quot;&gt;America’s Bestselling Halloween Candy Is An Absolute Classic, Chowhound (citing Instacart’s 2025 orders)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.cdc.gov/nchs/products/databriefs/db459.htm&quot;&gt;Diagnosed Allergic Conditions in Children Aged 0-17 Years: United States, 2021, CDC National Center for Health Statistics, Data Brief No. 459&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://nationalaglawcenter.org/food-labeling-the-regulation-of-food-allergen-labels/&quot;&gt;Food Labeling: The Regulation of Food Allergen Labels, National Agricultural Law Center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://pubmed.ncbi.nlm.nih.gov/30455345/&quot;&gt;The Public Health Impact of Parent-Reported Childhood Food Allergies in the United States, Gupta et al., Pediatrics 2018&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.foodallergy.org/media-room/bring-magic-halloween-teal-pumpkin-project&quot;&gt;Teal Pumpkin Project, Food Allergy Research &amp;amp; Education (FARE)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.ferrero.com/news/ferrero-to-acquire-nestle-s-us-confectionary-business&quot;&gt;Ferrero to acquire Nestlé’s US confectionery business, Ferrero&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/kidskoding/candyops&quot;&gt;candyops source code, dbt models and results, GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.pexels.com/photo/candies-and-chocolate-bars-on-black-surface-14147300/&quot;&gt;Cover photo: Candies and Chocolate Bars on Black Surface, Pexels&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item><item><title>Two Months In: Learn It Again</title><link>https://anirudh-konidala.vercel.app/blog/learn-it-again/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/learn-it-again/</guid><description>What Effect, Nix, and Cloudflare Workers taught me in my first two months at Brunswick</description><pubDate>Fri, 16 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;hr/&gt;
&lt;p&gt;I had used Drizzle ORM before starting this internship.&lt;/p&gt;
&lt;p&gt;Then I had to make it work alongside Effect.&lt;/p&gt;
&lt;p&gt;And suddenly I wasn’t sure I actually knew Drizzle.&lt;/p&gt;
&lt;p&gt;That happened early in my fall 2026 internship as a Software Development Engineering Intern at &lt;a href=&quot;https://www.brunswick.com/our-company/bi-designlab&quot;&gt;Brunswick’s Boating Intelligence Design Lab&lt;/a&gt;, which I joined through the &lt;a href=&quot;https://researchpark.illinois.edu/&quot;&gt;University of Illinois Urbana-Champaign’s Research Park&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As I was wrapping up my summer internship with T-Mobile, I received an offer to join Brunswick, and it was hard to say no to a chance to keep building real software alongside my classes.&lt;/p&gt;
&lt;p&gt;I’m now two months in, and the Drizzle moment turned out not to be a one-off. &lt;strong&gt;The same thing has kept happening in different parts of the stack.&lt;/strong&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;a-familiar-tool-that-felt-new-again&quot;&gt;A familiar tool that felt new again&lt;/h2&gt;
&lt;p&gt;One of the full-stack apps I worked on needed an ORM (object-relational mapper), which is a library for writing database queries in code instead of raw SQL. My manager’s request was simple: let’s use &lt;a href=&quot;https://orm.drizzle.team&quot;&gt;Drizzle ORM&lt;/a&gt; for the database layer.&lt;/p&gt;
&lt;p&gt;That made sense for a TypeScript app, and since I’d used Drizzle before, I figured that part was covered. &lt;strong&gt;The challenge wasn’t using Drizzle, but rather making Drizzle fit alongside &lt;a href=&quot;https://effect.website&quot;&gt;Effect&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The queries themselves were fine, because &lt;code&gt;select&lt;/code&gt;, &lt;code&gt;from&lt;/code&gt;, and &lt;code&gt;where&lt;/code&gt; were the same API I’d used before. &lt;strong&gt;What changed was everything around the query:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Where should the database actually live?&lt;/li&gt;
&lt;li&gt;What should the rest of the application know about Drizzle?&lt;/li&gt;
&lt;li&gt;When a query fails, what does that failure look like to the code that called it?&lt;/li&gt;
&lt;li&gt;How do I swap the database out in a test?&lt;/li&gt;
&lt;li&gt;Where does infrastructure stop and the application begin?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;None of those are really Drizzle questions, but I couldn’t answer them without understanding Drizzle better than I did.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Using a library teaches you its API. Integrating it with something unfamiliar teaches you its model.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-checklist-in-my-head&quot;&gt;The checklist in my head&lt;/h2&gt;
&lt;p&gt;I think a lot of developers keep a mental checklist like this:&lt;/p&gt;
&lt;div class=&quot;my-4 grid w-fit grid-cols-[auto_auto] gap-x-8 gap-y-1 rounded-md bg-nvim-bg-hard px-4 py-3 font-mono text-sm text-text-primary&quot;&gt;&lt;span&gt;TypeScript&lt;/span&gt;&lt;span class=&quot;text-nvim-green&quot;&gt;✓ learned&lt;/span&gt;&lt;span&gt;Drizzle&lt;/span&gt;&lt;span class=&quot;text-nvim-green&quot;&gt;✓ learned&lt;/span&gt;&lt;span&gt;Nix&lt;/span&gt;&lt;span class=&quot;text-nvim-green&quot;&gt;✓ learned&lt;/span&gt;&lt;span&gt;Serverless&lt;/span&gt;&lt;span class=&quot;text-nvim-green&quot;&gt;✓ learned&lt;/span&gt;&lt;span&gt;Effect&lt;/span&gt;&lt;span class=&quot;text-nvim-red&quot;&gt;✗ not learned&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Once something gets a checkmark, it stops being interesting.&lt;/strong&gt; You already know it, so why not move on to the next thing?&lt;/p&gt;
&lt;p&gt;Two months of this internship have made me doubt that checklist. Each time, I picked up something I thought I already knew, &lt;strong&gt;put it under a constraint I hadn’t worked with before&lt;/strong&gt;, and found out how much of my “knowing” was assumptions I’d never had to look at.&lt;/p&gt;
&lt;p&gt;The first time was in the code, starting with a single import.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;what-one-import-assumes&quot;&gt;What one import assumes&lt;/h2&gt;
&lt;p&gt;Here is roughly how I’d have written a database call in the past:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; db &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; from&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;./db&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; async&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; findUser&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; db&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(users)&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;eq&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(users&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; id))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There’s nothing wrong with this code, and it works.&lt;/p&gt;
&lt;p&gt;But the first line quietly assumes that there is exactly one database, that it was created when this module was imported, and that it’s always available. Anyone reading &lt;code&gt;findUser&lt;/code&gt; from the outside can’t tell any of that, because the signature only says it returns a &lt;code&gt;Promise&lt;/code&gt;. &lt;strong&gt;The type doesn’t tell you how it can fail, and it doesn’t tell you what it needs.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Effect makes you spell those things out. Its core type is &lt;code&gt;Effect&amp;lt;Success, Error, Requirements&amp;gt;&lt;/code&gt;, which describes a computation that produces a value, can fail in specific ways, and needs specific things to run. So instead of &lt;code&gt;doSomething() → value&lt;/code&gt;, every operation answers three questions:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1. What can this return?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2. How can this fail?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3. What does it require?&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here’s a simplified version of the same function written with Effect:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;// How can this fail?: a named error, not a bare rejected promise&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; DatabaseError&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; extends&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; Data&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;TaggedError&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;DatabaseError&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; cause&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; unknown&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; }&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;// What does it require?: a Database service, provided by the caller&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; Database&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; extends&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; Context&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;Tag&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;Database&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;Database&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; DrizzleClient&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; findUser&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  Effect&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;gen&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;function*&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; ()&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;    // ask for the database instead of importing it&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; db &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; yield*&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; Database&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; yield*&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; Effect&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;tryPromise&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;      // same Drizzle query as the previous example&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;      try&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; ()&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; db&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(users)&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;where&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;eq&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(users&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; id))&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;      catch&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;cause&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-macchiato-font-weight:bold;--shiki-latte:#8839EF;--shiki-latte-font-weight:bold;--shiki-frappe:#CA9EE6;--shiki-frappe-font-weight:bold;--shiki-mocha:#CBA6F7;--shiki-mocha-font-weight:bold&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; DatabaseError&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; cause &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;    }&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  }&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;// Effect.Effect&amp;lt;User[], DatabaseError, Database&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;//               │       │              │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;//               │       │              └─ what does it require?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;//               │       └─ how can this fail?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;//               └─ what can this return?&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The Drizzle part is identical, with the same query and the same builder. What changed is that &lt;strong&gt;the database stopped being something the function grabs from a module and became something it asks for&lt;/strong&gt;. The failure stopped being a rejected promise somebody might remember to catch, and became a named error in the type.&lt;/p&gt;
&lt;p&gt;And because &lt;code&gt;Database&lt;/code&gt; is a requirement rather than an import, a test can hand it a different implementation with &lt;code&gt;Effect.provideService&lt;/code&gt; and never touch a real database.&lt;/p&gt;
&lt;figure class=&quot;mermaid-diagram&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 576.4 520.1999999999999&quot; width=&quot;576.4&quot; height=&quot;520.1999999999999&quot; style=&quot;--bg:var(--color-nvim-bg-hard);--fg:var(--color-nvim-fg);--line:var(--color-nvim-gray);--accent:var(--color-nvim-orange);--muted:var(--color-nvim-fg2);--surface:var(--color-nvim-bg1);--border:var(--color-nvim-bg3)&quot;&gt; &lt;defs&gt; &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;7&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt; &lt;polygon points=&quot;0 0, 8 2.5, 0 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;marker id=&quot;arrowhead-start&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;1&quot; refY=&quot;2.5&quot; orient=&quot;auto-start-reverse&quot;&gt; &lt;polygon points=&quot;8 0, 0 2.5, 8 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;/defs&gt; &lt;g class=&quot;subgraph&quot; data-id=&quot;Before&quot; data-label=&quot;Before&quot;&gt; &lt;rect x=&quot;16&quot; y=&quot;16&quot; width=&quot;190.95&quot; height=&quot;335&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;rect x=&quot;16&quot; y=&quot;16&quot; width=&quot;190.95&quot; height=&quot;28&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-hdr)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;28&quot; y=&quot;30&quot; font-size=&quot;12&quot; font-weight=&quot;600&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;4.199999999999999&quot;&gt;Before&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;subgraph&quot; data-id=&quot;After&quot; data-label=&quot;After&quot;&gt; &lt;rect x=&quot;234.95&quot; y=&quot;16&quot; width=&quot;325.45&quot; height=&quot;488.19999999999993&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;rect x=&quot;234.95&quot; y=&quot;16&quot; width=&quot;325.45&quot; height=&quot;28&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-hdr)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;246.95&quot; y=&quot;30&quot; font-size=&quot;12&quot; font-weight=&quot;600&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;4.199999999999999&quot;&gt;After&lt;/text&gt; &lt;/g&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;F1&quot; data-to=&quot;G&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;import db&quot; points=&quot;111.475,96.9 111.475,213.2&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;G&quot; data-to=&quot;D1&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;111.475,250.1 111.475,298.1&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;F2&quot; data-to=&quot;S&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;requires Database, fails with DatabaseError&quot; points=&quot;397.95,96.9 397.95,213.2&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;S&quot; data-to=&quot;Z&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;provided by a Layer&quot; points=&quot;397.95,250.1 397.95,366.4&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;Z&quot; data-to=&quot;D2&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;397.95,403.29999999999995 397.95,451.29999999999995&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;F1&quot; data-to=&quot;G&quot; data-label=&quot;import db&quot;&gt; &lt;rect x=&quot;72.475&quot; y=&quot;139.9&quot; width=&quot;77.05&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;111&quot; y=&quot;155.05&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;import db&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;F2&quot; data-to=&quot;S&quot; data-label=&quot;requires Database, fails with DatabaseError&quot;&gt; &lt;rect x=&quot;246.94999999999996&quot; y=&quot;139.9&quot; width=&quot;301.45&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;397.67499999999995&quot; y=&quot;155.05&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;requires Database, fails with DatabaseError&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;S&quot; data-to=&quot;Z&quot; data-label=&quot;provided by a Layer&quot;&gt; &lt;rect x=&quot;325.95000000000005&quot; y=&quot;293.1&quot; width=&quot;143.05&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;397.475&quot; y=&quot;308.25&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;provided by a Layer&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;F1&quot; data-label=&quot;findUser&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;59.3&quot; y=&quot;60&quot; width=&quot;104.35&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;111.475&quot; y=&quot;78.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;findUser&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;G&quot; data-label=&quot;Drizzle, global&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;32&quot; y=&quot;213.2&quot; width=&quot;158.95&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;111.475&quot; y=&quot;231.64999999999998&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Drizzle, global&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;D1&quot; data-label=&quot;Database&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;59.3&quot; y=&quot;298.1&quot; width=&quot;104.35&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;111.475&quot; y=&quot;316.55&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Database&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;F2&quot; data-label=&quot;findUser&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;345.775&quot; y=&quot;60&quot; width=&quot;104.35&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;397.95&quot; y=&quot;78.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;findUser&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;S&quot; data-label=&quot;Database service&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;314.575&quot; y=&quot;213.2&quot; width=&quot;166.75&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;397.95&quot; y=&quot;231.64999999999998&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Database service&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;Z&quot; data-label=&quot;Drizzle&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;349.67499999999995&quot; y=&quot;366.4&quot; width=&quot;96.55000000000001&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;397.94999999999993&quot; y=&quot;384.84999999999997&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Drizzle&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;D2&quot; data-label=&quot;Database&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;345.775&quot; y=&quot;451.29999999999995&quot; width=&quot;104.35&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;397.95&quot; y=&quot;469.74999999999994&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Database&lt;/text&gt; &lt;/g&gt; &lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;That’s when Drizzle started to look different to me. Before, it was the thing I talked to the database through. Now it was an implementation detail behind a service boundary, and I had to decide what that boundary promised: which errors cross it, who creates the client, and who closes the connection when the program shuts down. Effect has answers for those (layers and scoped resources), but it doesn’t let you skip the question.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Writing the query was never the hard part, and deciding where the query belonged was.&lt;/strong&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;where-the-development-environment-lives&quot;&gt;Where the development environment lives&lt;/h2&gt;
&lt;p&gt;The second time was one level down, in the environment the code runs in.&lt;/p&gt;
&lt;p&gt;I already liked &lt;strong&gt;Nix&lt;/strong&gt; before this job. My personal machine runs NixOS, and this site has a &lt;code&gt;flake.nix&lt;/code&gt;. I could have told you why Nix is nice: &lt;strong&gt;declarative configuration&lt;/strong&gt;, &lt;strong&gt;pinned dependencies&lt;/strong&gt;, &lt;strong&gt;isolated packages&lt;/strong&gt;, and &lt;strong&gt;environments as code&lt;/strong&gt;. What I hadn’t felt was why any of that matters to anyone besides me.&lt;/p&gt;
&lt;p&gt;That changed when I made my entire computer setup at work reproducible with Nix. We develop on Ubuntu under WSL, where setting up a machine is usually imperative: you run &lt;code&gt;apt install&lt;/code&gt; for one tool, an install script for another, and a few more commands from a setup guide, and the result depends on the order you ran them in and on whatever was already installed.&lt;/p&gt;
&lt;p&gt;I declared everything I need for the job in Nix instead, so &lt;strong&gt;a new employee can install Nix on the same Ubuntu WSL machine, run one command, and have the same working setup from day one&lt;/strong&gt;. Instead of spending their first days piecing a machine together, they can start on the actual work right away.&lt;/p&gt;
&lt;p&gt;Building that showed me why it matters, because “it works on my machine” is almost never about the code. &lt;strong&gt;It’s about everything the code silently depends on:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;your app&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;├── Node version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;├── package manager (and its version)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;├── CLI tools&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;├── system libraries&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;├── environment variables&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;└── whatever happens to be on your PATH&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On most projects, that list doesn’t live in one place. Part of it lives in the README, part in a setup script, part in someone’s shell config, and part in a Slack thread from eight months ago, and the rest is “ask the person who set it up.” Each piece is an assumption about your machine that nobody wrote down where a computer can check it.&lt;/p&gt;
&lt;p&gt;A stripped-down development shell looks something like this:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;nix&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;devShells&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;default = pkgs&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;mkShell &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;  packages&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    pkgs&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;nodejs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    pkgs&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;pnpm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    pkgs&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;git&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  ];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next to it sits &lt;code&gt;flake.lock&lt;/code&gt;, which pins the exact versions of everything that shell pulls in. Getting a working environment goes from a page of setup steps to roughly:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;nix&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;develop&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The command itself isn’t the point, though. What matters is where the environment lives now.&lt;/p&gt;
&lt;figure class=&quot;mermaid-diagram&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 701.25 367&quot; width=&quot;701.25&quot; height=&quot;367&quot; style=&quot;--bg:var(--color-nvim-bg-hard);--fg:var(--color-nvim-fg);--line:var(--color-nvim-gray);--accent:var(--color-nvim-orange);--muted:var(--color-nvim-fg2);--surface:var(--color-nvim-bg1);--border:var(--color-nvim-bg3)&quot;&gt; &lt;defs&gt; &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;7&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt; &lt;polygon points=&quot;0 0, 8 2.5, 0 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;marker id=&quot;arrowhead-start&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;1&quot; refY=&quot;2.5&quot; orient=&quot;auto-start-reverse&quot;&gt; &lt;polygon points=&quot;8 0, 0 2.5, 8 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;/defs&gt; &lt;g class=&quot;subgraph&quot; data-id=&quot;Before&quot; data-label=&quot;Before&quot;&gt; &lt;rect x=&quot;16&quot; y=&quot;16&quot; width=&quot;323.54999999999995&quot; height=&quot;250.1&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;rect x=&quot;16&quot; y=&quot;16&quot; width=&quot;323.54999999999995&quot; height=&quot;28&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-hdr)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;28&quot; y=&quot;30&quot; font-size=&quot;12&quot; font-weight=&quot;600&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;4.199999999999999&quot;&gt;Before&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;subgraph&quot; data-id=&quot;After&quot; data-label=&quot;After&quot;&gt; &lt;rect x=&quot;367.54999999999995&quot; y=&quot;16&quot; width=&quot;317.7&quot; height=&quot;335&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;rect x=&quot;367.54999999999995&quot; y=&quot;16&quot; width=&quot;317.7&quot; height=&quot;28&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-hdr)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;379.54999999999995&quot; y=&quot;30&quot; font-size=&quot;12&quot; font-weight=&quot;600&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;4.199999999999999&quot;&gt;After&lt;/text&gt; &lt;/g&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;R&quot; data-to=&quot;M&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;describes&quot; points=&quot;177.77499999999998,96.9 177.77499999999998,213.2&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;F&quot; data-to=&quot;E&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;defines&quot; points=&quot;504.22499999999997,96.9 504.22499999999997,213.2&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;E&quot; data-to=&quot;Y&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;504.2249999999999,250.1 504.2249999999999,274.1 504.22499999999997,274.1 504.22499999999997,298.1&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;E&quot; data-to=&quot;T&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;504.2249999999999,250.1 504.2249999999999,274.1 617.0749999999999,274.1 617.0749999999999,298.1&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;E&quot; data-to=&quot;C&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;504.2249999999999,250.1 504.2249999999999,274.1 413.54999999999995,274.1 413.54999999999995,298.1&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;R&quot; data-to=&quot;M&quot; data-label=&quot;describes&quot;&gt; &lt;rect x=&quot;138.77499999999998&quot; y=&quot;139.9&quot; width=&quot;77.05&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;177.29999999999998&quot; y=&quot;155.05&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;describes&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;F&quot; data-to=&quot;E&quot; data-label=&quot;defines&quot;&gt; &lt;rect x=&quot;472.22499999999997&quot; y=&quot;139.9&quot; width=&quot;63.849999999999994&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;504.15&quot; y=&quot;155.05&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;defines&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;R&quot; data-label=&quot;README, setup script, memory&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;47.599999999999966&quot; y=&quot;60&quot; width=&quot;260.35&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;177.77499999999998&quot; y=&quot;78.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;README, setup script, memory&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;M&quot; data-label=&quot;every machine slightly different&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;32&quot; y=&quot;213.2&quot; width=&quot;291.54999999999995&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;177.77499999999998&quot; y=&quot;231.64999999999998&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;every machine slightly different&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;F&quot; data-label=&quot;flake.nix + flake.lock&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;397.44999999999993&quot; y=&quot;60&quot; width=&quot;213.54999999999998&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;504.2249999999999&quot; y=&quot;78.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;flake.nix + flake.lock&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;E&quot; data-label=&quot;declared environment&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;405.24999999999994&quot; y=&quot;213.2&quot; width=&quot;197.95&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;504.2249999999999&quot; y=&quot;231.64999999999998&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;declared environment&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;Y&quot; data-label=&quot;you&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;471.54999999999995&quot; y=&quot;298.1&quot; width=&quot;65.35&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;504.22499999999997&quot; y=&quot;316.55&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;you&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;T&quot; data-label=&quot;teammate&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;564.9&quot; y=&quot;298.1&quot; width=&quot;104.35&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;617.0749999999999&quot; y=&quot;316.55&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;teammate&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;C&quot; data-label=&quot;CI&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;383.54999999999995&quot; y=&quot;298.1&quot; width=&quot;60&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;413.54999999999995&quot; y=&quot;316.55&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;CI&lt;/text&gt; &lt;/g&gt; &lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;A README can describe an environment, but Nix can define one.&lt;/strong&gt; Once the environment is in the repository, it gets the same treatment as the code: it’s versioned, reviewed, and the same for everyone who checks it out.&lt;/p&gt;
&lt;p&gt;That’s what made me start thinking of &lt;strong&gt;reproducibility as a team feature&lt;/strong&gt; instead of a Linux hobbyist feature. CI runs the same toolchain you ran locally, so a failure in CI means something. And coming back to a project after a few months doesn’t start with an hour of figuring out which Node version it wanted.&lt;/p&gt;
&lt;p&gt;That said, I don’t think every team needs Nix. Docker solves a lot of the same problems from a different direction, language package managers already pin a lot, and CI systems have their own ways of describing environments, and Nix sits fine alongside all of them. The more useful takeaway is the question it made me ask:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Which parts of your development environment currently depend on undocumented machine state?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;a-runtime-without-a-long-lived-process&quot;&gt;A runtime without a long-lived process&lt;/h2&gt;
&lt;p&gt;The third time was one more level down, in the runtime itself. Most of my work has been on Cloudflare Workers, and this is where the pattern got bigger than any one codebase.&lt;/p&gt;
&lt;p&gt;I knew what serverless meant: functions, no servers to manage, and paying per request. In my head, it already had a checkmark. What I didn’t have was the mental model the runtime is built around, which is different from the one I’d absorbed from years of traditional backends:&lt;/p&gt;
&lt;figure class=&quot;mermaid-diagram&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 566.6999999999999 383.6&quot; width=&quot;566.6999999999999&quot; height=&quot;383.6&quot; style=&quot;--bg:var(--color-nvim-bg-hard);--fg:var(--color-nvim-fg);--line:var(--color-nvim-gray);--accent:var(--color-nvim-orange);--muted:var(--color-nvim-fg2);--surface:var(--color-nvim-bg1);--border:var(--color-nvim-bg3)&quot;&gt; &lt;defs&gt; &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;7&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt; &lt;polygon points=&quot;0 0, 8 2.5, 0 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;marker id=&quot;arrowhead-start&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;1&quot; refY=&quot;2.5&quot; orient=&quot;auto-start-reverse&quot;&gt; &lt;polygon points=&quot;8 0, 0 2.5, 8 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;/defs&gt; &lt;g class=&quot;subgraph&quot; data-id=&quot;Traditional&quot; data-label=&quot;Traditional&quot;&gt; &lt;rect x=&quot;16&quot; y=&quot;16&quot; width=&quot;300.15&quot; height=&quot;351.6&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;rect x=&quot;16&quot; y=&quot;16&quot; width=&quot;300.15&quot; height=&quot;28&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-hdr)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;28&quot; y=&quot;30&quot; font-size=&quot;12&quot; font-weight=&quot;600&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;4.199999999999999&quot;&gt;Traditional&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;subgraph&quot; data-id=&quot;Workers&quot; data-label=&quot;Workers&quot;&gt; &lt;rect x=&quot;344.15&quot; y=&quot;16&quot; width=&quot;206.54999999999998&quot; height=&quot;266.70000000000005&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;rect x=&quot;344.15&quot; y=&quot;16&quot; width=&quot;206.54999999999998&quot; height=&quot;28&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_group-hdr)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;356.15&quot; y=&quot;30&quot; font-size=&quot;12&quot; font-weight=&quot;600&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;4.199999999999999&quot;&gt;Workers&lt;/text&gt; &lt;/g&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;A&quot; data-to=&quot;B&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;166.075,96.9 166.075,144.9&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;C&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;166.075,181.8 166.075,229.8&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;C&quot; data-to=&quot;D&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;166.075,266.70000000000005 166.075,314.70000000000005&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;W1&quot; data-to=&quot;W2&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;447.42499999999995,96.9 447.42499999999995,144.9&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;W2&quot; data-to=&quot;W3&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;447.42499999999995,181.8 447.42499999999995,229.8&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;g class=&quot;node&quot; data-id=&quot;A&quot; data-label=&quot;server starts&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;94.39999999999999&quot; y=&quot;60&quot; width=&quot;143.35&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;166.075&quot; y=&quot;78.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;server starts&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;B&quot; data-label=&quot;app starts, opens connections&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;32&quot; y=&quot;144.9&quot; width=&quot;268.15&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;166.075&quot; y=&quot;163.35000000000002&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;app starts, opens connections&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;C&quot; data-label=&quot;process stays alive&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;71&quot; y=&quot;229.8&quot; width=&quot;190.14999999999998&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;166.075&quot; y=&quot;248.25&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;process stays alive&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;D&quot; data-label=&quot;requests arrive, share memory&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;32&quot; y=&quot;314.70000000000005&quot; width=&quot;268.15&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;166.075&quot; y=&quot;333.15000000000003&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;requests arrive, share memory&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;W1&quot; data-label=&quot;request arrives&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;367.95&quot; y=&quot;60&quot; width=&quot;158.95&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;447.42499999999995&quot; y=&quot;78.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;request arrives&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;W2&quot; data-label=&quot;your code runs&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;371.84999999999997&quot; y=&quot;144.9&quot; width=&quot;151.15&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;447.42499999999995&quot; y=&quot;163.35000000000002&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;your code runs&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;W3&quot; data-label=&quot;response goes out&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;360.15&quot; y=&quot;229.8&quot; width=&quot;174.54999999999998&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;447.42499999999995&quot; y=&quot;248.25&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;response goes out&lt;/text&gt; &lt;/g&gt; &lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;On the left, a lot comes for free without anyone deciding it should. The process lives a long time, so you can keep a connection pool in a global, cache things in memory, and set something up at boot and assume it’s still there. &lt;strong&gt;Those are assumptions too, just ones built into the shape of the server.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Workers run in lightweight isolates that Cloudflare can start and stop whenever it wants. A global variable might still be there on the next request, or it might not, and Cloudflare’s own docs tell you not to rely on it. So &lt;strong&gt;the question changes from “what server is running this?” to “what does this request need?”&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The runtime makes you answer that explicitly. A Worker’s entry point looks like this:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;ts&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;  async&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; fetch&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; Request&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt; env&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; Env&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;Response&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;    // env holds this Worker&amp;#39;s bindings: databases, storage,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;    // other services, secrets. They&amp;#39;re declared in config,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;    // not discovered from whatever machine this runs on.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; handle&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(request&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; env)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That &lt;code&gt;env&lt;/code&gt; parameter is what made it click for me. &lt;strong&gt;The dependencies are handed to your code, declared ahead of time, instead of reached for.&lt;/strong&gt; It’s the same move Effect makes with its &lt;code&gt;Requirements&lt;/code&gt; type, one level down: Effect does it inside the type system, and Workers do it in the runtime, but both refuse to let a dependency stay implicit.&lt;/p&gt;
&lt;p&gt;That’s the part I’ve come to appreciate most. &lt;strong&gt;The constraint isn’t just a restriction you work around, but something that changes how you structure things.&lt;/strong&gt; If you can’t assume a long-lived process, you end up thinking about request boundaries, about where state actually lives, and about small units of computation with clear inputs. The runtime makes some bad assumptions harder to make.&lt;/p&gt;
&lt;p&gt;I can also see why this model fits a company like Brunswick, which talks publicly about connected boats: a lot of that software sits between systems, and small, well-bounded units are a natural fit for that kind of work.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;same-question-three-levels-up&quot;&gt;Same question, three levels up&lt;/h2&gt;
&lt;p&gt;Looking back, the three tools weren’t three separate topics, but &lt;strong&gt;the same question asked at three levels of the stack:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;text&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;APPLICATION     Effect     What does this code need? How can it fail?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;ENVIRONMENT     Nix        What does this project need from my machine?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;     ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;RUNTIME         Workers    What does this request need? Where does state live?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;                    ↓&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;         Make the assumptions explicit.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Each one took something that’s usually implicit (a module-level import, a machine’s installed tools, a long-running process) and made it something you have to declare. &lt;strong&gt;A lot of what makes systems hard to work on is assumptions nobody wrote down&lt;/strong&gt;, so I think that’s a good engineering lesson to take away.&lt;/p&gt;
&lt;p&gt;But there’s a second lesson underneath it, and it’s the one I keep coming back to. &lt;strong&gt;Every time a tool forced a system’s assumptions into the open, it exposed some of mine too.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I assumed I knew Drizzle, I assumed I knew why Nix mattered, and I assumed “serverless” was a complete description of Workers. None of those were exactly wrong, but &lt;strong&gt;they were incomplete in ways I couldn’t see until something familiar ended up somewhere unfamiliar&lt;/strong&gt;.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;relearning-with-a-knowledge-graph&quot;&gt;Relearning with a knowledge graph&lt;/h2&gt;
&lt;p&gt;Relearning this many tools at once meant I needed somewhere to put what I was learning, so I started keeping it in &lt;a href=&quot;https://obsidian.md&quot;&gt;&lt;strong&gt;Obsidian&lt;/strong&gt;&lt;/a&gt;. Each part of the stack, like the Cloudflare developer platform, Drizzle ORM, and Postgres, got its own notes, and the notes link to each other wherever one tool touches another. Over time, those links turned the notes into a knowledge graph of the stack I was working in.&lt;/p&gt;

&lt;p&gt;The part that made it useful was pairing it with AI. While I was developing, I built a custom agent skill that has an AI assistant explain things by referencing that graph. When I ask about something I don’t understand yet, the explanation starts from notes I’ve already written, so &lt;strong&gt;instead of a generic answer, I get one that connects the new idea to the tools I already know&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;That fits the rest of this post, because &lt;strong&gt;the interesting part of the graph is the links between notes rather than the notes themselves&lt;/strong&gt;. A note on Drizzle by itself is a summary of an API, but a link from Drizzle to Effect, or from Effect to Workers, records a place where two tools had to meet, and that’s where most of my relearning happened.&lt;/p&gt;
&lt;p&gt;I think that’s what people mean when they say &lt;strong&gt;learning happens at the seams&lt;/strong&gt;: not inside one tool, but where two things that each make sense on their own have to fit together. The graph is where I can actually see those seams.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;another-kind-of-learning&quot;&gt;Another kind of learning&lt;/h2&gt;
&lt;p&gt;I used to think learning mostly meant encountering something new, like a new language, a new framework, or a new tool.&lt;/p&gt;
&lt;p&gt;These first two months showed me another kind that’s just as useful, and &lt;strong&gt;easier to miss because it doesn’t feel like learning at first&lt;/strong&gt;.&lt;/p&gt;
&lt;figure class=&quot;mermaid-diagram&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 719 170.7&quot; width=&quot;719&quot; height=&quot;170.7&quot; style=&quot;--bg:var(--color-nvim-bg-hard);--fg:var(--color-nvim-fg);--line:var(--color-nvim-gray);--accent:var(--color-nvim-orange);--muted:var(--color-nvim-fg2);--surface:var(--color-nvim-bg1);--border:var(--color-nvim-bg3)&quot;&gt; &lt;defs&gt; &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;7&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt; &lt;polygon points=&quot;0 0, 8 2.5, 0 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;marker id=&quot;arrowhead-start&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;1&quot; refY=&quot;2.5&quot; orient=&quot;auto-start-reverse&quot;&gt; &lt;polygon points=&quot;8 0, 0 2.5, 8 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;/defs&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;C&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;312.1,59.35 360.1,59.35&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;A&quot; data-to=&quot;B&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;136.15,59.35 192.15,59.35&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;C&quot; data-to=&quot;D&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;558.05,59.35 614.05,59.35&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;D&quot; data-to=&quot;A&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;614.05,82.91666666666667 586.05,82.91666666666667 586.05,122.7 164.15,122.7 164.15,82.91666666666667 136.15,82.91666666666667&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;g class=&quot;node&quot; data-id=&quot;B&quot; data-label=&quot;Put it somewhere unfamiliar&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;192.15&quot; y=&quot;24&quot; width=&quot;119.95&quot; height=&quot;70.7&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;252.125&quot; y=&quot;59.35&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;252.125&quot; dy=&quot;-12.350000000000001&quot;&gt;Put it&lt;/tspan&gt;&lt;tspan x=&quot;252.125&quot; dy=&quot;16.900000000000002&quot;&gt;somewhere&lt;/tspan&gt;&lt;tspan x=&quot;252.125&quot; dy=&quot;16.900000000000002&quot;&gt;unfamiliar&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;C&quot; data-label=&quot;Find the assumptions you didn&apos;t know you were making&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;360.1&quot; y=&quot;24&quot; width=&quot;197.95&quot; height=&quot;70.7&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;459.07500000000005&quot; y=&quot;59.35&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;459.07500000000005&quot; dy=&quot;-12.350000000000001&quot;&gt;Find the assumptions&lt;/tspan&gt;&lt;tspan x=&quot;459.07500000000005&quot; dy=&quot;16.900000000000002&quot;&gt;you didn&amp;#39;t know&lt;/tspan&gt;&lt;tspan x=&quot;459.07500000000005&quot; dy=&quot;16.900000000000002&quot;&gt;you were making&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;A&quot; data-label=&quot;Take something familiar&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;24&quot; y=&quot;35.78333333333333&quot; width=&quot;112.15&quot; height=&quot;70.7&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;80.075&quot; y=&quot;71.13333333333333&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;80.075&quot; dy=&quot;-12.350000000000001&quot;&gt;Take&lt;/tspan&gt;&lt;tspan x=&quot;80.075&quot; dy=&quot;16.900000000000002&quot;&gt;something&lt;/tspan&gt;&lt;tspan x=&quot;80.075&quot; dy=&quot;16.900000000000002&quot;&gt;familiar&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;D&quot; data-label=&quot;Learn it again&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;614.05&quot; y=&quot;35.78333333333333&quot; width=&quot;80.95&quot; height=&quot;70.7&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;654.525&quot; y=&quot;71.13333333333333&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;654.525&quot; dy=&quot;-12.350000000000001&quot;&gt;Learn&lt;/tspan&gt;&lt;tspan x=&quot;654.525&quot; dy=&quot;16.900000000000002&quot;&gt;it&lt;/tspan&gt;&lt;tspan x=&quot;654.525&quot; dy=&quot;16.900000000000002&quot;&gt;again&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;/svg&gt;&lt;/figure&gt;
&lt;p&gt;Drizzle is the same library it was before this internship, with the same &lt;code&gt;select&lt;/code&gt;, &lt;code&gt;from&lt;/code&gt;, and &lt;code&gt;where&lt;/code&gt; I started with. What changed is what I see when I use it: a client that something has to create and close, queries that can fail in ways the caller should know about, and a boundary that I get to decide on. &lt;strong&gt;I didn’t pick up a new tool there, but rather learned an old one again.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I expect a few more of the checkmarks in my head to turn out to be incomplete. &lt;strong&gt;I’d rather find that out than keep the checkmark.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I had used Drizzle before this internship.&lt;/p&gt;
&lt;p&gt;Two months in, I’m learning it again.&lt;/p&gt;</content:encoded></item><item><title>Why I Use Neovim When AI Writes the Code</title><link>https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/</guid><description>AI agents now code in the terminal, so why not have your editor live there too? Here&apos;s why Neovim fits well, along with a guided setup to start using Neovim right away!</description><pubDate>Sun, 11 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;Vim is famous for one joke: nobody can figure out how to quit it&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While this is still relevant to this day, it mostly stemmed from back when an editor’s main job involved lots of typing. Today, AI agents running in the terminal (or CLI) write most of your code, so &lt;strong&gt;your job is really to use the editor to read AI’s code, check it, and then fix what’s wrong&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Many of y’all probably use VSCode or some AI Editor, like Cursor, as your code editor. While that sounds great, those are graphical code editors! But why not have your editor live in the same terminal as your agentic coding tools, so that you can check their work without ever having to even switch windows!&lt;/p&gt;
&lt;p&gt;I’ve used &lt;a href=&quot;https://neovim.io/&quot;&gt;&lt;strong&gt;Neovim&lt;/strong&gt;&lt;/a&gt; on and off since 2022, but for a long time it never really stuck to me, mostly because I didn’t believe it could replace a real IDE, like &lt;strong&gt;VSCode&lt;/strong&gt; or &lt;strong&gt;JetBrains’s IntelliJ&lt;/strong&gt;. Every few months I went back and forth between VSCode, IntelliJ, and Neovim sometimes using Vim keybindings for the former 2 whenever I felt like it.&lt;/p&gt;
&lt;p&gt;During that time, I held back from Neovim for the same reason many people do: &lt;strong&gt;making the UI and UX feel like a graphical editor such as VSCode, IntelliJ, or Zed took a lot of hands-on configuration&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;However, after a year or so, Neovim finally stuck for me when I stopped trying to build a configuration from scratch and started from a complete batteries included configuration that already included everything I needed. Later in this post, I will show you how you can get the exact same thing that kickstarted my Neovim journey: &lt;strong&gt;a ready-made starter setup you can install, use right away, and change as you learn&lt;/strong&gt;. &lt;strong&gt;Figure 1.1&lt;/strong&gt; shows the finished result, &lt;a href=&quot;https://codeberg.org/kidskoding/nvimforge&quot;&gt;nvimforge&lt;/a&gt;, in about half a minute:&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/tour.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.1:&lt;/strong&gt; nvimforge from the start screen to the Claude panel, the file tree, the terminal, and lazygit, with every key shown at the bottom&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-editors-job-changed&quot;&gt;The editor’s job changed&lt;/h2&gt;
&lt;p&gt;If you’ve used an AI coding tool like &lt;a href=&quot;https://docs.anthropic.com/en/docs/claude-code&quot;&gt;Claude Code&lt;/a&gt; (Anthropic’s coding agent) or GitHub Copilot (the AI assistant built into editors like VSCode), you know how this goes: you describe a change, and the agent writes it. What’s left for you is everything around that: reading the diff (the list of lines it added and removed), opening the files it touched, checking that the code does what you asked, and fixing the parts it got wrong before you accept anything.&lt;/p&gt;
&lt;p&gt;Some of that happens right in the agent’s own terminal: Claude Code prints each diff and asks before it applies anything, so a plain yes or no never needs an editor. But an agent that writes a function in five seconds still isn’t really that efficient if correcting one wrong line of it costs you a minute of selecting and clicking. &lt;strong&gt;As soon as a change needs more than yes or no, such as fixing one line, reading the function it calls, or finding every place it renamed something, you’re editing, and the editor decides how fast that goes.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;an-almost-right-change&quot;&gt;An almost-right change&lt;/h3&gt;
&lt;p&gt;Consider asking an agent to rename the function &lt;code&gt;total_value&lt;/code&gt; to &lt;code&gt;inventory_total&lt;/code&gt;. Three files use that function, but the agent only renames it in two of them, and since the diff looks clean, you accept it. The third file still calls &lt;code&gt;total_value&lt;/code&gt;, a name that no longer exists, so it crashes with an error the next time it runs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Searching the whole project for &lt;code&gt;total_value&lt;/code&gt; finds that third file right away:&lt;/strong&gt; it’s quick to fix before anything breaks, and your hands never leave the keyboard to click through a search panel like you might in a graphical editor such as VSCode.&lt;/p&gt;
&lt;p&gt;In Neovim, that search is &lt;code&gt;&amp;lt;Leader&amp;gt;fw&lt;/code&gt;. Meet the &lt;strong&gt;leader key&lt;/strong&gt;, which you’ll see a lot in this post: it’s a key you press before a shortcut, and in this setup it’s &lt;strong&gt;Space&lt;/strong&gt;. So &lt;code&gt;&amp;lt;Leader&amp;gt;fw&lt;/code&gt; means pressing Space, then &lt;code&gt;f&lt;/code&gt;, then &lt;code&gt;w&lt;/code&gt; (think &lt;strong&gt;“find word”&lt;/strong&gt;).&lt;/p&gt;
&lt;p&gt;The leader can be any key you like (Vim’s own default is the backslash, &lt;code&gt;\&lt;/code&gt;), but most Neovim setups, like AstroNvim, choose Space: it’s the biggest key on the keyboard, your thumbs already rest on it, and in Normal mode it only moves the cursor one character to the right, which &lt;code&gt;l&lt;/code&gt; already does.&lt;/p&gt;
&lt;p&gt;The same thing happens inside a single function. Below is the kind of diff an agent hands back all the time, and &lt;strong&gt;it’s dangerous because it’s almost right:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;diff&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; def total_value(items: list[Item]) -&amp;gt; float:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;&lt;span style=&quot;user-select:none&quot;&gt;-&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt;    return sum(item.price * item.quantity for item in items)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;&lt;span style=&quot;user-select:none&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;    total = 0.0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;&lt;span style=&quot;user-select:none&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;    for item in items:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;&lt;span style=&quot;user-select:none&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;        total += item.price * item.quantity * 1.08  # tax??&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;&lt;span style=&quot;user-select:none&quot;&gt;+&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;    return round(total, 2)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here, the agent turned a one-line sum into a loop and also added an 8% sales tax, which changes every total the function returns. In &lt;strong&gt;Figure 1.2&lt;/strong&gt;, I asked Claude for that same rewrite on purpose, so you can see how a change like this shows up in Neovim. For this demonstration, I also asked it to make the whole change in one edit, since Claude can otherwise split a rewrite into several smaller diffs. Claude proposes the change as a diff right beside the code, &lt;code&gt;/for item&lt;/code&gt; jumps to the new loop, and pressing &lt;code&gt;&amp;lt;Leader&amp;gt;an&lt;/code&gt; (think &lt;strong&gt;“AI: no”&lt;/strong&gt;) rejects it.&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/review.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.2:&lt;/strong&gt; asked for a tax-rate rewrite, Claude proposes it as a diff in Neovim, and &lt;code&gt;&amp;lt;Leader&amp;gt;an&lt;/code&gt; rejects it&lt;/p&gt;
&lt;p&gt;Every change an agent makes goes through the same steps: you read it, check it against the code around it, fix it or reject it, and then ask the agent for the next change. Because you repeat those steps for every change, I’ll refer to them as &lt;strong&gt;the review loop&lt;/strong&gt;, as shown in &lt;strong&gt;Figure 1.3&lt;/strong&gt;, which draws it with the Neovim keys for each step:&lt;/p&gt;
&lt;figure class=&quot;mermaid-diagram&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 371.375 459.20000000000005&quot; width=&quot;371.375&quot; height=&quot;459.20000000000005&quot; style=&quot;--bg:var(--color-nvim-bg-hard);--fg:var(--color-nvim-fg);--line:var(--color-nvim-gray);--accent:var(--color-nvim-orange);--muted:var(--color-nvim-fg2);--surface:var(--color-nvim-bg1);--border:var(--color-nvim-bg3)&quot;&gt; &lt;defs&gt; &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;7&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt; &lt;polygon points=&quot;0 0, 8 2.5, 0 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;marker id=&quot;arrowhead-start&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;1&quot; refY=&quot;2.5&quot; orient=&quot;auto-start-reverse&quot;&gt; &lt;polygon points=&quot;8 0, 0 2.5, 8 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;/defs&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;A&quot; data-to=&quot;B&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;161.02083333333331,52.900000000000006 161.02083333333331,88.9 111.07499999999999,88.9 111.07499999999999,100.9&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;C&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;111.07499999999999,137.8 111.07499999999999,185.8&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;C&quot; data-to=&quot;D&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;111.07499999999999,239.60000000000002 111.07499999999999,287.6&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;D&quot; data-to=&quot;E&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;111.07499999999999,341.40000000000003 111.07499999999999,377.40000000000003 157.12083333333334,377.40000000000003 157.12083333333334,389.40000000000003&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;E&quot; data-to=&quot;A&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; data-label=&quot;next change&quot; points=&quot;225.70416666666662,389.40000000000003 225.70416666666662,377.40000000000003 271.75,377.40000000000003 271.75,309.1 221.80416666666665,309.1 221.80416666666665,52.900000000000006&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;E&quot; data-to=&quot;A&quot; data-label=&quot;next change&quot;&gt; &lt;rect x=&quot;226.25&quot; y=&quot;316.1&quot; width=&quot;90.25&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;271.375&quot; y=&quot;331.25&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;next change&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;A&quot; data-label=&quot;AI proposes a diff&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;100.23749999999998&quot; y=&quot;16&quot; width=&quot;182.35&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;191.41249999999997&quot; y=&quot;34.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;AI proposes a diff&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;B&quot; data-label=&quot;Read it&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;62.79999999999998&quot; y=&quot;100.9&quot; width=&quot;96.55000000000001&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;111.07499999999999&quot; y=&quot;119.35000000000001&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Read it&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;C&quot; data-label=&quot;Check the code gd · K · Leader fw&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;19.89999999999999&quot; y=&quot;185.8&quot; width=&quot;182.35&quot; height=&quot;53.800000000000004&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;111.07499999999999&quot; y=&quot;212.70000000000002&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;111.07499999999999&quot; dy=&quot;-3.9000000000000012&quot;&gt;Check the code&lt;/tspan&gt;&lt;tspan x=&quot;111.07499999999999&quot; dy=&quot;16.900000000000002&quot;&gt;gd · K · Leader fw&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;D&quot; data-label=&quot;Fix it ciw · ci&amp;quot; · daf · .&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;16&quot; y=&quot;287.6&quot; width=&quot;190.14999999999998&quot; height=&quot;53.800000000000004&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;111.07499999999999&quot; y=&quot;314.5&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;111.07499999999999&quot; dy=&quot;-3.9000000000000012&quot;&gt;Fix it&lt;/tspan&gt;&lt;tspan x=&quot;111.07499999999999&quot; dy=&quot;16.900000000000002&quot;&gt;ciw · ci&amp;quot; · daf · .&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;E&quot; data-label=&quot;Accept or reject Leader ay / Leader an&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;88.53750000000002&quot; y=&quot;389.40000000000003&quot; width=&quot;205.74999999999997&quot; height=&quot;53.800000000000004&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;191.41250000000002&quot; y=&quot;416.3&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot;&gt;&lt;tspan x=&quot;191.41250000000002&quot; dy=&quot;-3.9000000000000012&quot;&gt;Accept or reject&lt;/tspan&gt;&lt;tspan x=&quot;191.41250000000002&quot; dy=&quot;16.900000000000002&quot;&gt;Leader ay / Leader an&lt;/tspan&gt;&lt;/text&gt; &lt;/g&gt; &lt;/svg&gt;&lt;/figure&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.3:&lt;/strong&gt; the review loop when an agent writes the code, with the Neovim keys for each step (no need to learn them yet: the guide below introduces each key when you first use it)&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;ai-coding-moved-into-the-terminal&quot;&gt;AI coding moved into the terminal&lt;/h2&gt;
&lt;p&gt;If the editor’s job is now reviewing an agent’s work, it matters where that agent runs, and more and more it runs in a terminal. When your editor lives in that same terminal, the agent, the code, and the editor share one folder and one shell, &lt;strong&gt;so going from the agent’s answer to the line it changed is a keypress instead of a switch to another window.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;agents-are-command-line-programs&quot;&gt;Agents are command-line programs&lt;/h3&gt;
&lt;p&gt;Claude Code, OpenAI’s Codex, Google’s Gemini CLI, and OpenCode (an open-source agent that works with many AI models) all run in a terminal. Even the companies that build AI editors ship terminal agents now: the sidekick.nvim picker later in this post lists Cursor’s and GitHub Copilot’s command-line agents right beside Claude’s.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Because these agents are terminal programs, each one works like any other Unix tool:&lt;/strong&gt; &lt;code&gt;claude -p&lt;/code&gt; (print mode) runs a single prompt and prints the answer, and it reads anything you pipe into it, so it combines with every other command you already use:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;diff&lt;/span&gt; &lt;span class=&quot;sh-end&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;sh-cmd&quot;&gt;claude&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;sh-quote&quot;&gt;&amp;quot;review this diff for bugs and missing tests&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since all it needs is text in and text out, the same agent you chat with in a panel can also run inside a script or a CI job (the checks that run automatically every time you push code).&lt;/p&gt;
&lt;h3 id=&quot;agents-work-through-the-same-tools-you-do&quot;&gt;Agents work through the same tools you do&lt;/h3&gt;
&lt;p&gt;An agent doesn’t need a graphical interface, because most of what it does is run commands and read what they print: &lt;code&gt;git diff&lt;/code&gt;, &lt;code&gt;rg&lt;/code&gt;, the test suite, the compiler. All of those already print plain text in a terminal.&lt;/p&gt;
&lt;p&gt;While I recorded &lt;strong&gt;Figure 1.2&lt;/strong&gt;, Claude read two files and then tested its own change from the shell before proposing anything. In one of the runs, this is the command it chose:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;python3&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;report.py&lt;/span&gt; &lt;span class=&quot;sh-op&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sh-cmd&quot;&gt;python3&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;sh-quote&quot;&gt;&amp;quot;from models import *; assert total_value([])==0; assert total_value([Item(&amp;#39;a&amp;#39;,10,1)])==10.8; print(&amp;#39;ok&amp;#39;)&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;I never asked for that check:&lt;/strong&gt; the agent reached for the same tools a developer would, running the script and then asserting on the result, because the terminal is where all of its tools already are.&lt;/p&gt;
&lt;h3 id=&quot;so-your-editor-should-live-there-too&quot;&gt;So your editor should live there too&lt;/h3&gt;
&lt;p&gt;An editor that runs in the same terminal as the agent shares everything with it: the folder, the files, the Git state, and the shell. In Neovim the agent sits in a split next to your code, so reading its change, opening a file it mentioned, and running its test are all keys in one window instead of trips between an IDE and a terminal.&lt;/p&gt;
&lt;p&gt;That split is also a real Neovim &lt;strong&gt;buffer&lt;/strong&gt;, which is Neovim’s name for anything it has open, so the agent’s output is text like any other file. Neovim has a few different &lt;strong&gt;modes&lt;/strong&gt; (more on those soon), and while you’re talking to the agent, it’s in &lt;span class=&quot;vim-mode vim-mode-terminal&quot;&gt;Terminal&lt;/span&gt; mode, where every key you type goes to the agent. Once you press &lt;code&gt;Ctrl+\&lt;/code&gt; and then &lt;code&gt;Ctrl+N&lt;/code&gt; to leave it, &lt;code&gt;/&lt;/code&gt; searches what the agent wrote, &lt;code&gt;y&lt;/code&gt; copies from it, and &lt;code&gt;gF&lt;/code&gt; on a location it printed, like &lt;code&gt;models.py:11&lt;/code&gt;, opens that file at line 11.&lt;/p&gt;
&lt;p&gt;Neovim gets new features from &lt;strong&gt;plugins&lt;/strong&gt;, which is Neovim’s version of &lt;strong&gt;extensions&lt;/strong&gt; you’d install in VSCode or Zed. One of them, &lt;a href=&quot;https://github.com/folke/sidekick.nvim&quot;&gt;sidekick.nvim&lt;/a&gt;, was written by &lt;a href=&quot;https://github.com/folke&quot;&gt;folke&lt;/a&gt; (who also wrote Lazy, Snacks, and which-key, three more plugins you’ll meet later in this setup!), and it opens twelve AI CLIs in splits like that and shows Copilot’s next edit suggestions, where Copilot guesses the change you’re about to make and shows it right in your code, ready to apply with &lt;code&gt;Tab&lt;/code&gt;. &lt;strong&gt;If an agent runs in a shell, it already runs in a Neovim split.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This works the same way on machines with no desktop at all. Agents increasingly run on remote servers and in containers you reach over SSH, and Neovim runs there unchanged, right next to the agent in &lt;a href=&quot;https://github.com/tmux/tmux&quot;&gt;tmux&lt;/a&gt; or &lt;a href=&quot;https://zellij.dev&quot;&gt;Zellij&lt;/a&gt;, two programs that split a single terminal into several panes.&lt;/p&gt;
&lt;p&gt;Neovim stays fast with all of this installed: the start screen in &lt;strong&gt;Figure 1.1&lt;/strong&gt; reports that Neovim loaded 10 of this setup’s 52 plugins in about 88 ms, and the rest load only when you first need them.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Wherever an agent comes from, it now ships as a program you run in a terminal, so the editor belongs in that terminal too.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;why-neovim-is-the-right-terminal-editor&quot;&gt;Why Neovim is the right terminal editor&lt;/h2&gt;
&lt;p&gt;Plenty of editors run in a terminal, but Neovim is the one I’d pick for this work because of three things: &lt;strong&gt;how it edits, how it connects to Claude, and how much of it you can change.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;modal-editing-is-built-for-fixing-code&quot;&gt;Modal editing is built for fixing code&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://neovim.io&quot;&gt;Neovim&lt;/a&gt; is a modern fork of Vim, and like Vim it’s a &lt;strong&gt;modal&lt;/strong&gt; editor. This means the editor switches between &lt;strong&gt;modes&lt;/strong&gt;, and the same key does something different in each one: in one mode, pressing &lt;code&gt;d&lt;/code&gt; starts a delete, while in another it just types the letter d.&lt;/p&gt;
&lt;p&gt;Most of the time you’re in &lt;span class=&quot;vim-mode vim-mode-normal&quot;&gt;Normal&lt;/span&gt; mode, where keys move around and change text, and you switch to &lt;span class=&quot;vim-mode vim-mode-insert&quot;&gt;Insert&lt;/span&gt; mode only when you want to type. &lt;strong&gt;Most other editors are modeless:&lt;/strong&gt; you’re always in typing mode, and the mouse, shortcuts, and multiple cursors handle everything else.&lt;/p&gt;
&lt;p&gt;Those movement keys are known as Vim &lt;strong&gt;motions&lt;/strong&gt; and they trace back to the idea behind &lt;strong&gt;touch typing&lt;/strong&gt;, where your fingers rest on the home row (the middle row of letters - &lt;code&gt;asdf&lt;/code&gt; and &lt;code&gt;jkl;&lt;/code&gt;) and reach every key without haivng to look down on your keyboard or lift your hands.&lt;/p&gt;
&lt;p&gt;In &lt;span class=&quot;vim-mode vim-mode-normal&quot;&gt;Normal&lt;/span&gt; mode, &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, and &lt;code&gt;l&lt;/code&gt; move left, down, up, and right respectively. All four sit on the home row, so your hands stay right there instead of reaching for the arrow keys or the mouse.&lt;/p&gt;
&lt;p&gt;Having multiple modes sounds like extra work in a modal editor, but they actually end up removing steps. In a modeless editor (like VSCode or Zed), fixing one word means grabbing the mouse, selecting the word, typing, and clicking somewhere else. In Neovim you type &lt;code&gt;ciw&lt;/code&gt; (“change inner word”), which deletes the word under the cursor, placing you in &lt;span class=&quot;vim-mode vim-mode-insert&quot;&gt;Insert&lt;/span&gt; mode where you can then type the new word and press &lt;code&gt;Esc&lt;/code&gt; to go back.&lt;/p&gt;
&lt;p&gt;This works because Neovim’s commands combine: operators like &lt;code&gt;c&lt;/code&gt; (change), &lt;code&gt;d&lt;/code&gt; (delete), and &lt;code&gt;y&lt;/code&gt; (yank, Vim’s word for copy) pair with text objects like &lt;code&gt;iw&lt;/code&gt; (inner word), &lt;code&gt;i(&lt;/code&gt; (inside parentheses), &lt;code&gt;i&amp;quot;&lt;/code&gt; (inside quotes), and &lt;code&gt;af&lt;/code&gt; (a function). &lt;strong&gt;You describe the edit you want instead of selecting the text by hand:&lt;/strong&gt; a handful of operators and objects covers the corrections AI output needs again and again, as &lt;strong&gt;Table 1.1&lt;/strong&gt; shows:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fix to AI-written code&lt;/th&gt;
&lt;th&gt;With the mouse&lt;/th&gt;
&lt;th&gt;In Neovim&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Replace a wrong argument&lt;/td&gt;
&lt;td&gt;select inside the parentheses, then type&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ci(&lt;/code&gt; with the cursor inside, then type&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fix a string&lt;/td&gt;
&lt;td&gt;select inside the quotes, then type&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ci&amp;quot;&lt;/code&gt;, then type&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Delete a function the agent invented&lt;/td&gt;
&lt;td&gt;select the whole function, then delete&lt;/td&gt;
&lt;td&gt;&lt;code&gt;daf&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Make the same fix in several places&lt;/td&gt;
&lt;td&gt;select each place again, or add cursors&lt;/td&gt;
&lt;td&gt;fix it once, move to the next place, then &lt;code&gt;.&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Undo a change you accepted&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Ctrl/Cmd+Z&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;u&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.1:&lt;/strong&gt; common fixes to AI-written code, done each way&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;Figure 1.4&lt;/strong&gt;, &lt;code&gt;ci(&lt;/code&gt; rewrites an argument list, &lt;code&gt;ci&amp;quot;&lt;/code&gt; replaces a string, and &lt;code&gt;ciw&lt;/code&gt; changes a number before &lt;code&gt;.&lt;/code&gt; repeats that change on the line above:&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/modal.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.4:&lt;/strong&gt; &lt;code&gt;ci(&lt;/code&gt;, &lt;code&gt;ci”&lt;/code&gt;, &lt;code&gt;ciw&lt;/code&gt;, and &lt;code&gt;.&lt;/code&gt; fixing a list of items, with the keys shown at the bottom&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;.&lt;/code&gt; key repeats your last change, so once you’ve fixed one bad call, every other copy of it takes a move and a single &lt;code&gt;.&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;claude-talks-to-neovim-the-same-way-it-talks-to-vs-code&quot;&gt;Claude talks to Neovim the same way it talks to VS Code&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/coder/claudecode.nvim&quot;&gt;claudecode.nvim&lt;/a&gt; is the plugin that connects Neovim to Claude Code. It uses the same WebSocket protocol (a live, two-way connection between two programs) that Anthropic’s own &lt;strong&gt;VS Code&lt;/strong&gt; and JetBrains extensions use. When it starts, it writes a small lock file to &lt;code&gt;~/.claude/ide/&lt;/code&gt; that says where to connect, and Claude Code finds Neovim there exactly the way it finds VS Code. Over that connection, Claude can call the tools the editor exposes, as &lt;strong&gt;Figure 1.5&lt;/strong&gt; shows:&lt;/p&gt;
&lt;figure class=&quot;mermaid-diagram&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 1068.1 212.25&quot; width=&quot;1068.1&quot; height=&quot;212.25&quot; style=&quot;--bg:var(--color-nvim-bg-hard);--fg:var(--color-nvim-fg);--line:var(--color-nvim-gray);--accent:var(--color-nvim-orange);--muted:var(--color-nvim-fg2);--surface:var(--color-nvim-bg1);--border:var(--color-nvim-bg3)&quot;&gt; &lt;defs&gt; &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;7&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt; &lt;polygon points=&quot;0 0, 8 2.5, 0 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;marker id=&quot;arrowhead-start&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;1&quot; refY=&quot;2.5&quot; orient=&quot;auto-start-reverse&quot;&gt; &lt;polygon points=&quot;8 0, 0 2.5, 8 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;/defs&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;A&quot; data-to=&quot;B&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;true&quot; data-arrow-end=&quot;true&quot; data-label=&quot;WebSocket, found through ~/.claude/ide/&quot; points=&quot;190.54999999999998,99.35000000000001 553.5999999999999,99.35000000000001&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot; marker-start=&quot;url(#arrowhead-start)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;C&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;712.55,99.35000000000001 730.55,99.35000000000001 730.55,34.45 748.55,34.45&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;D&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;712.55,99.35000000000001 730.55,99.35000000000001 730.55,99.35000000000001 748.55,99.35000000000001&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;E&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;712.55,99.35000000000001 730.55,99.35000000000001 730.55,164.25 748.55,164.25&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;g class=&quot;edge-label&quot; data-from=&quot;A&quot; data-to=&quot;B&quot; data-label=&quot;WebSocket, found through ~/.claude/ide/&quot;&gt; &lt;rect x=&quot;234.54999999999995&quot; y=&quot;83.35000000000001&quot; width=&quot;275.04999999999995&quot; height=&quot;30.3&quot; rx=&quot;2&quot; ry=&quot;2&quot; fill=&quot;var(--bg)&quot; stroke=&quot;var(--_inner-stroke)&quot; stroke-width=&quot;1&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;372.07499999999993&quot; y=&quot;98.50000000000001&quot; text-anchor=&quot;middle&quot; font-size=&quot;11&quot; font-weight=&quot;400&quot; fill=&quot;var(--_text-sec)&quot; dy=&quot;3.8499999999999996&quot;&gt;WebSocket, found through ~/.claude/ide/&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;A&quot; data-label=&quot;Claude Code (CLI)&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;16&quot; y=&quot;80.9&quot; width=&quot;174.54999999999998&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;103.27499999999999&quot; y=&quot;99.35000000000001&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Claude Code (CLI)&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;B&quot; data-label=&quot;claudecode.nvim&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;553.5999999999999&quot; y=&quot;80.9&quot; width=&quot;158.95&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;633.0749999999999&quot; y=&quot;99.35000000000001&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;claudecode.nvim&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;C&quot; data-label=&quot;openDiff: show a change for review&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;748.55&quot; y=&quot;16&quot; width=&quot;307.15&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;902.125&quot; y=&quot;34.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;openDiff: show a change for review&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;D&quot; data-label=&quot;getDiagnostics: read ty&apos;s errors&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;748.55&quot; y=&quot;80.9&quot; width=&quot;291.54999999999995&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;894.3249999999999&quot; y=&quot;99.35000000000001&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;getDiagnostics: read ty&amp;#39;s errors&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;E&quot; data-label=&quot;getCurrentSelection / openFile&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;748.55&quot; y=&quot;145.8&quot; width=&quot;275.95&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;886.525&quot; y=&quot;164.25&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;getCurrentSelection / openFile&lt;/text&gt; &lt;/g&gt; &lt;/svg&gt;&lt;/figure&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.5:&lt;/strong&gt; how Claude Code connects to Neovim, and some of the editor tools it can call&lt;/p&gt;
&lt;p&gt;&lt;code&gt;openDiff&lt;/code&gt; produced the diff in &lt;strong&gt;Figure 1.2&lt;/strong&gt;, and &lt;code&gt;getDiagnostics&lt;/code&gt; hands Claude the same type errors your language server shows you. A language server is a program that reads your code and tells the editor about its errors, types, and definitions; in this setup it’s ty, a fast type checker for &lt;strong&gt;Python&lt;/strong&gt; that you’ll install in step 2. That means &lt;strong&gt;when Claude fixes an error, it’s working from exactly the diagnostics on your screen.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;the-editor-is-code-you-and-the-agent-can-change&quot;&gt;The editor is code you and the agent can change&lt;/h3&gt;
&lt;p&gt;Neovim’s whole configuration is a folder of &lt;strong&gt;Lua&lt;/strong&gt; files. When I added sidekick.nvim to this setup, I asked Claude to do it, and it read the plugin’s source, noticed that the ready-made sidekick pack would fight Claude Code over the same &lt;code&gt;&amp;lt;Leader&amp;gt;A&lt;/code&gt; keys, moved every AI key into one &lt;code&gt;&amp;lt;Leader&amp;gt;a&lt;/code&gt; group, and tested the result in a headless Neovim (one running with no window) before I ever opened it. &lt;strong&gt;Every one of those changes showed up as an ordinary Git diff in my config repo, so I could read all of it before committing anything.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can also drive Neovim itself from code: starting it with &lt;code&gt;nvim --listen&lt;/code&gt; exposes its whole API on a socket, so another program can send it keys and read its state. That’s how every clip in this post was recorded: a script started Neovim with &lt;code&gt;--listen&lt;/code&gt;, typed the keystrokes with &lt;code&gt;nvim --server &amp;lt;socket&amp;gt; --remote-send&lt;/code&gt;, and checked the editor’s state with &lt;code&gt;--remote-expr&lt;/code&gt; before each step.&lt;/p&gt;
&lt;p&gt;Neovim still has real costs: you’ll be slower for the first week, you have to maintain your own config, and big &lt;strong&gt;Java&lt;/strong&gt; or &lt;strong&gt;Kotlin&lt;/strong&gt; refactors (and design work) still go better in a full IDE. &lt;strong&gt;Use an IDE on those days, and make Neovim the editor for the ordinary ones.&lt;/strong&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;build-it-around-the-review-loop&quot;&gt;Build it around the review loop&lt;/h2&gt;
&lt;p&gt;For the rest of this post, I’ll build the editor with you step by step: a theme first, so everything after it looks right, and then &lt;strong&gt;the parts of the review loop from Figure 1.3, in order.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Before we install anything, though, let’s look at how the pieces of a Neovim setup fit together, so you know what each one does.&lt;/p&gt;
&lt;h3 id=&quot;how-a-neovim-setup-fits-together&quot;&gt;How a Neovim setup fits together&lt;/h3&gt;
&lt;p&gt;Every time Neovim starts, it reads one folder: &lt;code&gt;~/.config/nvim&lt;/code&gt; on Linux and macOS, or &lt;code&gt;%LOCALAPPDATA%\nvim&lt;/code&gt; on Windows. It begins with a file called &lt;code&gt;init.lua&lt;/code&gt;, and everything you add in this post is another file in that folder.&lt;/p&gt;
&lt;p&gt;If you’ve used &lt;strong&gt;VS Code&lt;/strong&gt; or &lt;strong&gt;Zed&lt;/strong&gt;, you’ve configured an editor this way before. When you change a setting in VS Code’s Settings screen, VS Code writes the change into a file called &lt;code&gt;settings.json&lt;/code&gt; (in &lt;code&gt;~/.config/Code/User/&lt;/code&gt; on Linux, &lt;code&gt;~/Library/Application Support/Code/User/&lt;/code&gt; on macOS, or &lt;code&gt;%APPDATA%\Code\User\&lt;/code&gt; on Windows), and Zed works the same way with its own &lt;code&gt;~/.config/zed/settings.json&lt;/code&gt;. &lt;strong&gt;The settings screen is only a front end for that file, so you can skip it and edit the JSON directly:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;jsonc&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;// VS Code: ~/.config/Code/User/settings.json&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  &amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;workbench.colorTheme&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;Catppuccin Macchiato&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  &amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;editor.lineNumbers&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;on&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  &amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;editor.formatOnSave&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Neovim works the same way, except that its settings files are &lt;strong&gt;Lua&lt;/strong&gt; code instead of JSON. Here are the same three settings in this setup, each in the AstroNvim file where it lives:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;lua&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/astroui.lua&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;opts &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { colorscheme &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;catppuccin-macchiato&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/astrocore.lua&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;opts &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { options &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { opt &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { relativenumber &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; } } },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/astrolsp.lua&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;opts &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { formatting &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { format_on_save &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { enabled &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt; true&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; } } },&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Because Lua is a programming language, a setting can compute its value instead of only storing it:&lt;/strong&gt; the status bar in step 6 reads its pink from the theme’s palette by name, and the sidekick keys in step 3 are small functions that call the plugin when you press them.&lt;/p&gt;
&lt;p&gt;On its own, Neovim is a fast editor without a file tree, a fuzzy finder, or an AI panel. Those all come from plugins, the Neovim version of extensions from earlier. Each one is a small &lt;strong&gt;Lua&lt;/strong&gt; project that usually lives on GitHub and is named &lt;code&gt;owner/repo&lt;/code&gt;, like &lt;code&gt;catppuccin/nvim&lt;/code&gt;. Four more pieces sit around them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A plugin manager downloads and loads them:&lt;/strong&gt; this setup uses &lt;a href=&quot;https://github.com/folke/lazy.nvim&quot;&gt;lazy.nvim&lt;/a&gt;, or &lt;strong&gt;Lazy&lt;/strong&gt;. It’s named for how it works, since it loads each plugin only when you first need it, such as when you open a &lt;strong&gt;Python&lt;/strong&gt; file or press a key, and that’s how 52 plugins start in under a tenth of a second.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A distribution gives you a tested starting point:&lt;/strong&gt; choosing and configuring dozens of plugins yourself takes weeks, so this setup starts from &lt;a href=&quot;https://astronvim.com&quot;&gt;AstroNvim&lt;/a&gt;, a set of plugins and defaults that you add your own files on top of.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Packs add whole features in one line:&lt;/strong&gt; &lt;a href=&quot;https://github.com/AstroNvim/astrocommunity&quot;&gt;AstroCommunity&lt;/a&gt; is AstroNvim’s catalog of ready-made bundles, such as &lt;strong&gt;Python&lt;/strong&gt; support or the Claude Code panel.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mason installs the programs plugins call:&lt;/strong&gt; language servers like ty, formatters like Ruff, and debuggers like debugpy aren’t Neovim plugins at all, so &lt;a href=&quot;https://github.com/williamboman/mason.nvim&quot;&gt;mason.nvim&lt;/a&gt;, or &lt;strong&gt;Mason&lt;/strong&gt;, downloads them for you.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Figure 1.6&lt;/strong&gt; shows the order they load in: Neovim reads &lt;code&gt;init.lua&lt;/code&gt;, &lt;code&gt;init.lua&lt;/code&gt; starts Lazy, and Lazy loads everything else.&lt;/p&gt;
&lt;figure class=&quot;mermaid-diagram&quot;&gt;&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 1032.85 299.6&quot; width=&quot;1032.85&quot; height=&quot;299.6&quot; style=&quot;--bg:var(--color-nvim-bg-hard);--fg:var(--color-nvim-fg);--line:var(--color-nvim-gray);--accent:var(--color-nvim-orange);--muted:var(--color-nvim-fg2);--surface:var(--color-nvim-bg1);--border:var(--color-nvim-bg3)&quot;&gt; &lt;defs&gt; &lt;marker id=&quot;arrowhead&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;7&quot; refY=&quot;2.5&quot; orient=&quot;auto&quot;&gt; &lt;polygon points=&quot;0 0, 8 2.5, 0 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;marker id=&quot;arrowhead-start&quot; markerWidth=&quot;8&quot; markerHeight=&quot;5&quot; refX=&quot;1&quot; refY=&quot;2.5&quot; orient=&quot;auto-start-reverse&quot;&gt; &lt;polygon points=&quot;8 0, 0 2.5, 8 5&quot; fill=&quot;var(--_arrow)&quot; stroke=&quot;var(--_arrow)&quot; stroke-width=&quot;0.75&quot; stroke-linejoin=&quot;round&quot;&gt;&lt;/polygon&gt; &lt;/marker&gt; &lt;/defs&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;A&quot; data-to=&quot;B&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;532.0249999999999,52.900000000000006 532.025,100.9&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;C&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;532.025,137.8 532.025,155.8 169.575,155.8 169.575,173.8&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;D&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;532.025,137.8 532.025,155.8 532.025,155.8 532.025,173.8&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;B&quot; data-to=&quot;E&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;532.025,137.8 532.025,155.8 878.875,155.8 878.875,173.8&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;polyline class=&quot;edge&quot; data-from=&quot;C&quot; data-to=&quot;F&quot; data-style=&quot;solid&quot; data-arrow-start=&quot;false&quot; data-arrow-end=&quot;true&quot; points=&quot;169.575,210.70000000000002 169.575,246.70000000000002&quot; fill=&quot;none&quot; stroke=&quot;var(--_line)&quot; stroke-width=&quot;1&quot; marker-end=&quot;url(#arrowhead)&quot;&gt;&lt;/polyline&gt; &lt;g class=&quot;node&quot; data-id=&quot;A&quot; data-label=&quot;init.lua in ~/.config/nvim&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;409.6499999999999&quot; y=&quot;16&quot; width=&quot;244.74999999999997&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;532.0249999999999&quot; y=&quot;34.45&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;init.lua in ~/.config/nvim&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;B&quot; data-label=&quot;Lazy: downloads and loads plugins&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;382.34999999999997&quot; y=&quot;100.9&quot; width=&quot;299.34999999999997&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;532.025&quot; y=&quot;119.35000000000001&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Lazy: downloads and loads plugins&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;C&quot; data-label=&quot;AstroNvim: the base set of plugins&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;16&quot; y=&quot;173.8&quot; width=&quot;307.15&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;169.575&quot; y=&quot;192.25&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;AstroNvim: the base set of plugins&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;D&quot; data-label=&quot;AstroCommunity packs: Python, Claude Code&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;351.15&quot; y=&quot;173.8&quot; width=&quot;361.75&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;532.025&quot; y=&quot;192.25&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;AstroCommunity packs: Python, Claude Code&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;E&quot; data-label=&quot;your own files in lua/plugins/&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;740.9&quot; y=&quot;173.8&quot; width=&quot;275.95&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;878.875&quot; y=&quot;192.25&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;your own files in lua/plugins/&lt;/text&gt; &lt;/g&gt; &lt;g class=&quot;node&quot; data-id=&quot;F&quot; data-label=&quot;Mason: installs ty, Ruff, debugpy&quot; data-shape=&quot;rectangle&quot;&gt; &lt;rect x=&quot;19.89999999999999&quot; y=&quot;246.70000000000002&quot; width=&quot;299.34999999999997&quot; height=&quot;36.900000000000006&quot; rx=&quot;0&quot; ry=&quot;0&quot; fill=&quot;var(--_node-fill)&quot; stroke=&quot;var(--_node-stroke)&quot; stroke-width=&quot;0.75&quot;&gt;&lt;/rect&gt; &lt;text x=&quot;169.575&quot; y=&quot;265.15000000000003&quot; text-anchor=&quot;middle&quot; font-size=&quot;13&quot; font-weight=&quot;500&quot; fill=&quot;var(--_text)&quot; dy=&quot;4.55&quot;&gt;Mason: installs ty, Ruff, debugpy&lt;/text&gt; &lt;/g&gt; &lt;/svg&gt;&lt;/figure&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.6:&lt;/strong&gt; how the pieces of this setup load when Neovim starts&lt;/p&gt;
&lt;p&gt;Every file you add to &lt;code&gt;lua/plugins/&lt;/code&gt; has the same shape, a &lt;strong&gt;Lua&lt;/strong&gt; table that names one plugin and puts its settings in &lt;code&gt;opts&lt;/code&gt;. &lt;strong&gt;Once this shape makes sense, every config file in this post will too:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;lua&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/example.lua&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;  &amp;quot;owner/repo&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  opts &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You don’t have to configure anything from inside Neovim on day one, since you can edit these files in whatever editor you use today and restart &lt;code&gt;nvim&lt;/code&gt; to see each change.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You don’t need to memorize keys first, either:&lt;/strong&gt; most shortcuts start with the leader key from earlier, Space in this setup, which config files write as &lt;code&gt;&amp;lt;Leader&amp;gt;&lt;/code&gt;. Press Space and wait a moment, and &lt;a href=&quot;https://github.com/folke/which-key.nvim&quot;&gt;which-key&lt;/a&gt; lists every key that can come next.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Table 1.2&lt;/strong&gt; maps each step of the review loop to the parts of the setup it uses:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step in the loop&lt;/th&gt;
&lt;th&gt;What you need&lt;/th&gt;
&lt;th&gt;In this setup&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ask the agent&lt;/td&gt;
&lt;td&gt;an AI panel beside the code&lt;/td&gt;
&lt;td&gt;claudecode.nvim and sidekick.nvim, on &lt;code&gt;&amp;lt;Leader&amp;gt;a&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read what changed&lt;/td&gt;
&lt;td&gt;find files, browse the tree, see the diff&lt;/td&gt;
&lt;td&gt;Snacks picker &lt;code&gt;&amp;lt;Leader&amp;gt;ff&lt;/code&gt;, Neo-tree &lt;code&gt;&amp;lt;Leader&amp;gt;e&lt;/code&gt;, lazygit &lt;code&gt;&amp;lt;Leader&amp;gt;gg&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Check it&lt;/td&gt;
&lt;td&gt;type errors, lint, running, debugging&lt;/td&gt;
&lt;td&gt;ty and Ruff from &lt;code&gt;:Mason&lt;/code&gt;, terminal &lt;code&gt;F7&lt;/code&gt;, debugger &lt;code&gt;F9&lt;/code&gt; / &lt;code&gt;F5&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fix it&lt;/td&gt;
&lt;td&gt;precise edits&lt;/td&gt;
&lt;td&gt;Neovim’s operators and text objects, built in&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Accept and commit&lt;/td&gt;
&lt;td&gt;accept / reject keys, Git&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;ay&lt;/code&gt; / &lt;code&gt;&amp;lt;Leader&amp;gt;an&lt;/code&gt;, lazygit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stay comfortable&lt;/td&gt;
&lt;td&gt;a theme, a status bar, key hints&lt;/td&gt;
&lt;td&gt;Catppuccin, lualine, bufferline, which-key&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.2:&lt;/strong&gt; what each step of the review loop needs, and where it lives in this setup&lt;/p&gt;
&lt;h3 id=&quot;start-from-astronvim&quot;&gt;Start from AstroNvim&lt;/h3&gt;
&lt;p&gt;Before we install it, let’s talk about AstroNvim. &lt;a href=&quot;https://astronvim.com&quot;&gt;AstroNvim&lt;/a&gt; is a &lt;strong&gt;Neovim distribution&lt;/strong&gt;, a complete, batteries-included, community-maintained configuration that turns plain Neovim into a full editor as soon as you install it. It comes with a file tree (Neo-tree), a fuzzy finder and start screen (Snacks), key hints (which-key), a terminal (toggleterm), Git markers (gitsigns), a debugger (nvim-dap), and language server support that Mason installs for you, all set up to work together. If you’ve used VSCode, the closest comparison is installing VSCode along with a set of extensions someone has already configured for you. &lt;a href=&quot;https://www.lazyvim.org&quot;&gt;LazyVim&lt;/a&gt; and &lt;a href=&quot;https://nvchad.com&quot;&gt;NvChad&lt;/a&gt; are two other popular distributions that work the same way.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What makes AstroNvim easy to customize is how it’s installed:&lt;/strong&gt; AstroNvim itself loads as a plugin, and you start from its small &lt;em&gt;template&lt;/em&gt;, which holds only your own files. Most of its settings live in three of them: &lt;code&gt;astrocore.lua&lt;/code&gt; for options and keymaps, &lt;code&gt;astroui.lua&lt;/code&gt; for the theme and icons, and &lt;code&gt;astrolsp.lua&lt;/code&gt; for language servers. Because your files sit on top of AstroNvim instead of inside it, updating AstroNvim never overwrites your changes.&lt;/p&gt;
&lt;p&gt;Now let’s get Neovim running. If you already have an existing Neovim config, &lt;a href=&quot;#if-you-already-have-a-neovim-config&quot;&gt;move it aside&lt;/a&gt; and then clone AstroNvim’s template into the config folder and start Neovim once so it can download everything the template lists:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;clone&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;--depth&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;https://github.com/AstroNvim/template&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.config/nvim&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.config/nvim/.git&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;nvim&lt;/span&gt;   &lt;span class=&quot;sh-comment&quot;&gt;# wait for the download UI to finish&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That first start is &lt;strong&gt;Lazy&lt;/strong&gt; downloading AstroNvim’s plugins, so you will give it a minute to let it finish while leaving the terminal open. When it finishes, you’ll land on AstroNvim’s &lt;strong&gt;dashboard&lt;/strong&gt;, its start screen. Any file you open from there is called a &lt;strong&gt;buffer&lt;/strong&gt;, the same idea as a file you open in a tab.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/dashboard.png&quot; alt=&quot;Stock AstroNvim dashboard after the first launch&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;To quit, use a &lt;strong&gt;colon command&lt;/strong&gt;: press &lt;code&gt;:&lt;/code&gt;, type the command, and press Enter. &lt;code&gt;:qa&lt;/code&gt; (“quit all”) closes everything. Until the setup is finished, keep editing the config in the editor you already use, since the files live in &lt;code&gt;~/.config/nvim&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Many of the template’s files start with a &lt;strong&gt;guard line&lt;/strong&gt;, &lt;code&gt;if true then return {} end&lt;/code&gt;, which tells Neovim to skip the rest of the file. &lt;strong&gt;Delete it from every file you edit, or Neovim will never load your changes.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;From here on, every step that needs configuring works the same way: &lt;strong&gt;open or create a small file, write a few lines, and restart &lt;code&gt;nvim&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;h3 id=&quot;1-pick-a-theme-and-a-start-screen&quot;&gt;1. Pick a theme and a start screen&lt;/h3&gt;
&lt;p&gt;Let’s start with the part of the editor that is the most conspicuous: the theme, since you’ll be looking at this editor all day. This setup uses &lt;a href=&quot;https://github.com/catppuccin/nvim&quot;&gt;catppuccin/nvim&lt;/a&gt;, the official Neovim port of the pastel &lt;a href=&quot;https://catppuccin.com&quot;&gt;Catppuccin&lt;/a&gt; color scheme, in its Macchiato flavour. &lt;strong&gt;If those colors look familiar, that’s because this blog and website are styled with the same theme!&lt;/strong&gt; Like any other theme, it takes two steps: &lt;strong&gt;install the theme plugin, then select it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you’ve ever switched themes in VSCode or Zed, this will feel familiar. In those editors, you’d open the Extensions page, install the Catppuccin extension, and then pick Catppuccin Macchiato from the theme picker (&lt;code&gt;Ctrl+K&lt;/code&gt;, then &lt;code&gt;Ctrl+T&lt;/code&gt;). &lt;strong&gt;Neovim follows the same two steps:&lt;/strong&gt; the extension becomes a plugin you add via a small &lt;strong&gt;Lua&lt;/strong&gt; file, and picking the theme becomes one line in another file.&lt;/p&gt;
&lt;p&gt;Create &lt;code&gt;lua/plugins/catppuccin.lua&lt;/code&gt; with the lines below: &lt;code&gt;&amp;quot;catppuccin/nvim&amp;quot;&lt;/code&gt; is the plugin’s &lt;code&gt;owner/repo&lt;/code&gt; id, &lt;code&gt;name = &amp;quot;catppuccin&amp;quot;&lt;/code&gt; gives it a readable name in Lazy, and &lt;code&gt;priority = 1000&lt;/code&gt; loads it before every other plugin so everything draws in the right colors:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;lua&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/catppuccin.lua&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- Catppuccin styles the gutters and which-key itself, so no overrides.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;  &amp;quot;catppuccin/nvim&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  name &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;catppuccin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  priority &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 1000&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Installing a theme doesn’t turn it on, so open &lt;code&gt;lua/plugins/astroui.lua&lt;/code&gt;, delete the guard line, and set &lt;code&gt;colorscheme&lt;/code&gt; to &lt;code&gt;&amp;quot;catppuccin-macchiato&amp;quot;&lt;/code&gt;. Write out the flavour in full, because recent Neovim versions include a built-in colorscheme that’s also called &lt;code&gt;catppuccin&lt;/code&gt;, and plain &lt;code&gt;&amp;quot;catppuccin&amp;quot;&lt;/code&gt; can load that one instead:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;lua&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/astroui.lua (template, trimmed)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;  &amp;quot;AstroNvim/astroui&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  opts &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    colorscheme &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;catppuccin-macchiato&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Restart, and the dashboard comes back in Catppuccin’s colors:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/dashboard-catppuccin.png&quot; alt=&quot;Stock AstroNvim dashboard in Catppuccin Macchiato, with Find Word and Bookmarks still in the menu&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;Now let’s make the start screen yours. The dashboard is drawn by &lt;a href=&quot;https://github.com/folke/snacks.nvim&quot;&gt;Snacks.nvim&lt;/a&gt; (&lt;code&gt;folke/snacks.nvim&lt;/code&gt;), a plugin AstroNvim already installed that also provides the file picker and the terminal helpers, so this time you aren’t installing anything. &lt;strong&gt;To change a plugin you already have, you create a file that names it again, and Lazy merges your settings into its existing ones.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By default, the menu has New File, Find File, Recents, Find Word, Bookmarks, and Last Session, but no Quit. We’ll trim it to the rows you’ll actually use and add a Quit row. Find Word can go, because &lt;code&gt;&amp;lt;Leader&amp;gt;fw&lt;/code&gt; does the same search once a file is open, and Bookmarks can go too.&lt;/p&gt;
&lt;p&gt;The rows live in &lt;code&gt;dashboard.preset.keys&lt;/code&gt;, and each row has four fields: &lt;code&gt;key&lt;/code&gt; is the letter you press, &lt;code&gt;action&lt;/code&gt; is the command or leader mapping it runs, &lt;code&gt;icon&lt;/code&gt; is the glyph, and &lt;code&gt;desc&lt;/code&gt; is the label. Here &lt;code&gt;opts&lt;/code&gt; is a function instead of a table, so it receives AstroNvim’s existing Snacks settings and changes only the menu, rather than replacing everything. Create &lt;code&gt;lua/plugins/snacks.lua&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;lua&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/snacks.lua&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- Trim the dashboard to five rows and add Quit.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;---&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;@type&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; LazySpec&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;  &amp;quot;folke/snacks.nvim&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;  opts&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;_&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt; opts&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    local&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; get_icon &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;astroui&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;).get_icon&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    opts.dashboard &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; opts.dashboard &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;or&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    opts.dashboard.preset &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; opts.dashboard.preset &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;or&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    opts.dashboard.preset.keys &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;      { key &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, action &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;&amp;lt;Leader&amp;gt;n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, icon &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; get_icon&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;FileNew&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;), desc &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;New File  &amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;      { key &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;f&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, action &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;&amp;lt;Leader&amp;gt;ff&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, icon &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; get_icon&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;Search&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;), desc &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;Find File  &amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;      { key &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;o&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, action &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;&amp;lt;Leader&amp;gt;fo&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, icon &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; get_icon&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;DefaultFile&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;), desc &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;Recents  &amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;      { key &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;s&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, action &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;&amp;lt;Leader&amp;gt;Sl&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, icon &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; get_icon&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;Refresh&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;), desc &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;Last Session  &amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;      { key &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;q&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, action &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;:qa&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, icon &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; get_icon&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;BufferClose&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;), desc &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;Quit  &amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;    -- Lazy can merge leftover stock rows onto the list, so clear anything past ours&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; #&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;opts.dashboard.preset.keys &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; do&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;      opts.dashboard.preset.keys[i] &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt; nil&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    end&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;  end&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;get_icon(...)&lt;/code&gt; borrows AstroNvim’s Nerd Font glyphs, so the new rows match the rest of the editor, and the Quit row runs the same &lt;code&gt;:qa&lt;/code&gt; from earlier. Restart, and the dashboard shows just your five rows, with Quit right on &lt;code&gt;q&lt;/code&gt;, so nobody has to wonder how to quit this Vim!&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/dashboard-splash.png&quot; alt=&quot;Catppuccin dashboard with New File, Find File, Recents, Last Session, and Quit&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;h3 id=&quot;2-turn-on-the-packs&quot;&gt;2. Turn on the packs&lt;/h3&gt;
&lt;p&gt;Now that the editor looks right, let’s turn on the features themselves. Most of the review loop comes from AstroCommunity packs, and each pack turns on with a single &lt;code&gt;{ import = &amp;quot;...&amp;quot; }&lt;/code&gt; line. That means one file turns on the agent panel, the language tools, the status bar, the tabs, and session restore all at once.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Python&lt;/strong&gt; part is three packs: &lt;code&gt;python.base&lt;/code&gt; adds syntax highlighting, debugger wiring, and a picker for your project’s virtual environment, &lt;code&gt;python.ty&lt;/code&gt; brings in ty for type checking, jump-to-definition, and hover docs, and &lt;code&gt;python.ruff&lt;/code&gt; brings in Ruff for linting (catching style problems and likely bugs) and formatting on save. &lt;strong&gt;These are the packs that check an agent’s Python the moment it lands.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Open &lt;code&gt;lua/community.lua&lt;/code&gt;, delete the guard line, and paste in the whole file:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;lua&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/community.lua&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- AstroCommunity: ready-made plugin packs, turned on with one `import` line each&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- browse everything available here: https://github.com/AstroNvim/astrocommunity&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;---&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;@type&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; LazySpec&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;  &amp;quot;AstroNvim/astrocommunity&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  { import &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;astrocommunity.pack.lua&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}, &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- helps when editing these config files&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  { import &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;astrocommunity.bars-and-lines.lualine-nvim&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}, &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- the status bar&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  { import &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;astrocommunity.bars-and-lines.bufferline-nvim&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}, &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- the tabs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  -- languages (uncomment the languages you use!)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  -- check out all available language extension packs here: https://github.com/AstroNvim/astrocommunity/tree/main/lua/astrocommunity/pack&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  { import &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;astrocommunity.pack.python.base&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}, &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- Python syntax, the debugger, and a virtualenv picker&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  { import &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;astrocommunity.pack.python.ty&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}, &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- ty: type checking, go-to-definition, and hover docs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  { import &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;astrocommunity.pack.python.ruff&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}, &lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- Ruff: linting and formatting for Python&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  -- { import = &amp;quot;astrocommunity.pack.typescript&amp;quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;  -- { import = &amp;quot;astrocommunity.pack.rust&amp;quot; },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  { import &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;astrocommunity.ai.claudecode-nvim&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  { import &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;astrocommunity.recipes.auto-session-restore&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Don’t add a plain &lt;code&gt;pack.python&lt;/code&gt; import on top of these, or the two &lt;strong&gt;Python&lt;/strong&gt; toolchains will conflict. Then quit with &lt;code&gt;:qa&lt;/code&gt; and start &lt;code&gt;nvim&lt;/code&gt; again so Lazy can download what the new imports added, and run &lt;code&gt;:Lazy&lt;/code&gt; to see every plugin and whether it has loaded yet:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/lazy.png&quot; alt=&quot;lazy.nvim home showing loaded and not-loaded plugins&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;You won’t find &lt;code&gt;ruff&lt;/code&gt; or &lt;code&gt;ty&lt;/code&gt; in that list, because Lazy only manages Neovim plugins, and &lt;strong&gt;ty and Ruff are separate programs that Mason installs:&lt;/strong&gt; run &lt;code&gt;:Mason&lt;/code&gt; and check that &lt;code&gt;ty&lt;/code&gt;, &lt;code&gt;ruff&lt;/code&gt;, &lt;code&gt;lua_ls&lt;/code&gt;, and &lt;code&gt;debugpy&lt;/code&gt; are marked installed. If one isn’t, move to it with &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt;, press the install key shown in the footer (usually &lt;code&gt;i&lt;/code&gt;), and wait:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/mason.png&quot; alt=&quot;Mason with ty, Ruff, lua_ls, and debugpy installed&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;If jump-to-definition or format-on-save ever stops working, check &lt;code&gt;:Mason&lt;/code&gt; before you touch the config, since Lazy can look perfectly fine while Mason never installed the program behind it.&lt;/p&gt;
&lt;h3 id=&quot;a-small-project-to-try-things-on&quot;&gt;A small project to try things on&lt;/h3&gt;
&lt;p&gt;Before we go any further, let’s make something to work on: a tiny two-file &lt;strong&gt;Python&lt;/strong&gt; project. &lt;strong&gt;It’s the same code as the diff near the top of this post, so you can watch the whole loop happen to it:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;# inventory/models.py&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; dataclasses &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; dataclass&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;@dataclass&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; Item&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    name&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; str&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    price&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; float&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    quantity&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; int&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; total_value&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;items&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt; list&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;Item&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; -&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; float&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; sum&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;price &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; item&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;quantity &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; item &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; items&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;# inventory/report.py&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; models &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; Item&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; total_value&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;items &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt; [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;    Item&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;keyboard&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 49.99&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;    Item&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;mouse&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 19.99&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 5&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;f&amp;quot;Inventory value: &lt;/span&gt;&lt;span style=&quot;color:#F5BDE6;--shiki-latte:#EA76CB;--shiki-frappe:#F4B8E4;--shiki-mocha:#F5C2E7&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;total_value&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;items&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;:.2f&lt;/span&gt;&lt;span style=&quot;color:#F5BDE6;--shiki-latte:#EA76CB;--shiki-frappe:#F4B8E4;--shiki-mocha:#F5C2E7&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Commit it so lazygit, a terminal app for Git that you’ll use in step 4, has some history to show, then open Neovim inside the folder (on a Mac, Neovim’s shortcuts use Ctrl, not Cmd):&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;inventory&lt;/span&gt; &lt;span class=&quot;sh-op&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sh-cmd&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;init&lt;/span&gt; &lt;span class=&quot;sh-op&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sh-cmd&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;sh-op&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sh-cmd&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;commit&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-m&lt;/span&gt; &lt;span class=&quot;sh-quote&quot;&gt;&amp;quot;Initial inventory&amp;quot;&lt;/span&gt; &lt;span class=&quot;sh-op&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;sh-cmd&quot;&gt;nvim&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;your-first-five-minutes-with-the-motions&quot;&gt;Your first five minutes with the motions&lt;/h3&gt;
&lt;p&gt;The motions are the part of Neovim that feels strangest at first, so before any AI shows up, let’s take them one small step at a time on real code. Open &lt;code&gt;report.py&lt;/code&gt; from the dashboard by pressing &lt;code&gt;f&lt;/code&gt;, typing &lt;code&gt;rep&lt;/code&gt;, and pressing Enter. You’re in &lt;span class=&quot;vim-mode vim-mode-normal&quot;&gt;Normal&lt;/span&gt; mode now, so every key you press is a command instead of text, and you can’t break anything here: &lt;code&gt;u&lt;/code&gt; undoes your last change as many times as you need.&lt;/p&gt;
&lt;h4 id=&quot;1-move-with-h-j-k-and-l&quot;&gt;1. Move with h, j, k, and l&lt;/h4&gt;
&lt;p&gt;Start with the four keys from earlier. Press &lt;code&gt;j&lt;/code&gt; three times to move down to the &lt;code&gt;keyboard&lt;/code&gt; row, &lt;code&gt;l&lt;/code&gt; to move right, &lt;code&gt;h&lt;/code&gt; to move back left, and &lt;code&gt;k&lt;/code&gt; to go back up, just like in &lt;strong&gt;Figure 1.7&lt;/strong&gt;:&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/motions-hjkl.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.7:&lt;/strong&gt; &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;l&lt;/code&gt;, &lt;code&gt;h&lt;/code&gt;, and &lt;code&gt;k&lt;/code&gt; moving the cursor one line or one character at a time&lt;/p&gt;
&lt;h4 id=&quot;2-jump-instead-of-crawling&quot;&gt;2. Jump instead of crawling&lt;/h4&gt;
&lt;p&gt;Once single steps feel natural, try bigger jumps. &lt;code&gt;w&lt;/code&gt; hops forward a word and &lt;code&gt;b&lt;/code&gt; hops back, &lt;code&gt;$&lt;/code&gt; goes to the end of the line and &lt;code&gt;0&lt;/code&gt; to the start, and &lt;code&gt;G&lt;/code&gt; and &lt;code&gt;gg&lt;/code&gt; go to the bottom and top of the file. Vim counts punctuation like &lt;code&gt;(&amp;quot;&lt;/code&gt; as its own word, so watch where &lt;code&gt;w&lt;/code&gt; lands in &lt;strong&gt;Figure 1.8&lt;/strong&gt;:&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/motions-jump.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.8:&lt;/strong&gt; &lt;code&gt;w&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; jump by word, &lt;code&gt;$&lt;/code&gt; and &lt;code&gt;0&lt;/code&gt; jump to the end and start of the line, and &lt;code&gt;G&lt;/code&gt; and &lt;code&gt;gg&lt;/code&gt; jump to the bottom and top of the file&lt;/p&gt;
&lt;h4 id=&quot;3-type-something-then-take-it-back&quot;&gt;3. Type something, then take it back&lt;/h4&gt;
&lt;p&gt;To type, you switch to &lt;span class=&quot;vim-mode vim-mode-insert&quot;&gt;Insert&lt;/span&gt; mode. On the &lt;code&gt;mouse&lt;/code&gt; row, press &lt;code&gt;o&lt;/code&gt;: Neovim opens a new line below it and puts you in Insert mode, so you can type a comment like &lt;code&gt;# add a monitor here&lt;/code&gt;. Press &lt;code&gt;Esc&lt;/code&gt; to go back to Normal mode, then &lt;code&gt;u&lt;/code&gt; to take the whole line back out, as in &lt;strong&gt;Figure 1.9&lt;/strong&gt;:&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/motions-insert.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.9:&lt;/strong&gt; &lt;code&gt;o&lt;/code&gt; opens a new line in Insert mode, &lt;code&gt;Esc&lt;/code&gt; returns to Normal mode, and &lt;code&gt;u&lt;/code&gt; undoes the whole line&lt;/p&gt;
&lt;h4 id=&quot;4-change-a-word-without-selecting-it&quot;&gt;4. Change a word without selecting it&lt;/h4&gt;
&lt;p&gt;This is the step you’ll use the most when fixing AI-written code. On the &lt;code&gt;keyboard&lt;/code&gt; row, press &lt;code&gt;$&lt;/code&gt; to jump to the end of the line and &lt;code&gt;h&lt;/code&gt; twice to land on the &lt;code&gt;3&lt;/code&gt;. Then type &lt;code&gt;ciw&lt;/code&gt; (“change inner word”): the &lt;code&gt;3&lt;/code&gt; disappears and you’re in Insert mode, so type &lt;code&gt;4&lt;/code&gt; and press &lt;code&gt;Esc&lt;/code&gt;. &lt;strong&gt;The same idea works inside quotes:&lt;/strong&gt; press &lt;code&gt;0&lt;/code&gt; to go back to the start of the line and type &lt;code&gt;ci&amp;quot;&lt;/code&gt;, and Neovim clears &lt;code&gt;keyboard&lt;/code&gt; so you can type &lt;code&gt;laptop&lt;/code&gt;. &lt;strong&gt;Figure 1.10&lt;/strong&gt; shows both:&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/motions-change.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.10:&lt;/strong&gt; &lt;code&gt;ciw&lt;/code&gt; changes the quantity from 3 to 4, and &lt;code&gt;ci”&lt;/code&gt; changes &lt;code&gt;keyboard&lt;/code&gt; to &lt;code&gt;laptop&lt;/code&gt;&lt;/p&gt;
&lt;h4 id=&quot;5-delete-a-line-and-put-it-back&quot;&gt;5. Delete a line and put it back&lt;/h4&gt;
&lt;p&gt;Last one. On the &lt;code&gt;mouse&lt;/code&gt; row, &lt;code&gt;dd&lt;/code&gt; deletes the whole line, and &lt;code&gt;P&lt;/code&gt; puts it right back above the cursor. Neovim keeps whatever you delete, so &lt;code&gt;dd&lt;/code&gt; and then &lt;code&gt;p&lt;/code&gt; somewhere else is how you move a line, as in &lt;strong&gt;Figure 1.11&lt;/strong&gt;:&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/motions-delete.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.11:&lt;/strong&gt; &lt;code&gt;dd&lt;/code&gt; deletes the &lt;code&gt;mouse&lt;/code&gt; row, and &lt;code&gt;P&lt;/code&gt; puts it back&lt;/p&gt;
&lt;p&gt;When you’re done, press &lt;code&gt;u&lt;/code&gt; until &lt;code&gt;report.py&lt;/code&gt; looks the way it did when you opened it, or type &lt;code&gt;:e!&lt;/code&gt; and press Enter to throw away every unsaved change at once.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Those few keys already cover most of the fixes in this post:&lt;/strong&gt; the rest of this guide teaches each new key the first time you need it. When you want more practice, type &lt;code&gt;:Tutor&lt;/code&gt; and press Enter. It’s an interactive tutorial built into Neovim, where each lesson is a short exercise you do right inside the text, and it takes about half an hour.&lt;/p&gt;
&lt;h3 id=&quot;3-ask-the-agent&quot;&gt;3. Ask the agent&lt;/h3&gt;
&lt;p&gt;With the packs in place, let’s bring in the agent. The &lt;code&gt;claudecode-nvim&lt;/code&gt; import from step 2 already installed claudecode.nvim, which runs the Claude Code CLI in a side panel and opens Claude’s proposed changes as diffs you accept or reject. It only hosts the CLI, so &lt;code&gt;claude&lt;/code&gt; itself still has to be installed and on your PATH (see the appendix). sidekick.nvim, which you’ll copy in below, does the same job for every other AI CLI.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The ready-made packs for these two plugins both claim the same &lt;code&gt;&amp;lt;Leader&amp;gt;A&lt;/code&gt; keys, so nvimforge moves every AI action into one lowercase &lt;code&gt;&amp;lt;Leader&amp;gt;a&lt;/code&gt; group instead:&lt;/strong&gt; the actions you use most get the shortest keys, and accepting or rejecting a diff is &lt;code&gt;y&lt;/code&gt; or &lt;code&gt;n&lt;/code&gt;, as in yes or no. &lt;strong&gt;Table 1.3&lt;/strong&gt; lists the whole group:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;Plugin&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;aa&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Open or close the Claude panel&lt;/td&gt;
&lt;td&gt;claudecode.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;as&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send the selection to Claude (in &lt;span class=&quot;vim-mode vim-mode-visual&quot;&gt;Visual&lt;/span&gt; mode)&lt;/td&gt;
&lt;td&gt;claudecode.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;ab&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Add the current file to Claude’s context&lt;/td&gt;
&lt;td&gt;claudecode.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;ay&lt;/code&gt; / &lt;code&gt;&amp;lt;Leader&amp;gt;an&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Accept / reject Claude’s diff&lt;/td&gt;
&lt;td&gt;claudecode.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;af&lt;/code&gt; · &lt;code&gt;&amp;lt;Leader&amp;gt;ar&lt;/code&gt; · &lt;code&gt;&amp;lt;Leader&amp;gt;am&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Focus the panel · resume a session · pick a model&lt;/td&gt;
&lt;td&gt;claudecode.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;ao&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Open another AI CLI (Codex, Gemini, OpenCode, …)&lt;/td&gt;
&lt;td&gt;sidekick.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;ad&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Close that CLI’s session (&lt;code&gt;Ctrl+.&lt;/code&gt; only hides it)&lt;/td&gt;
&lt;td&gt;sidekick.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;at&lt;/code&gt; / &lt;code&gt;&amp;lt;Leader&amp;gt;ap&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send the code under the cursor / pick a saved prompt&lt;/td&gt;
&lt;td&gt;sidekick.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Ctrl+.&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show or hide that CLI from any mode (it keeps running)&lt;/td&gt;
&lt;td&gt;sidekick.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Tab&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Jump to or apply Copilot’s next edit suggestion&lt;/td&gt;
&lt;td&gt;sidekick.nvim&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.3:&lt;/strong&gt; every AI key in nvimforge, grouped under &lt;code&gt;&amp;lt;Leader&amp;gt;a&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Copy &lt;a href=&quot;https://codeberg.org/kidskoding/nvimforge/src/branch/master/nvim/lua/plugins/claudecode.lua&quot;&gt;&lt;code&gt;claudecode.lua&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://codeberg.org/kidskoding/nvimforge/src/branch/master/nvim/lua/plugins/sidekick.lua&quot;&gt;&lt;code&gt;sidekick.lua&lt;/code&gt;&lt;/a&gt; from nvimforge into your &lt;code&gt;lua/plugins/&lt;/code&gt; folder. The sidekick file stays short, because each key is one line in its &lt;code&gt;keys&lt;/code&gt; list:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;lua&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/sidekick.lua (trimmed)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;  &amp;quot;folke/sidekick.nvim&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  event &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;VeryLazy&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  opts &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  keys &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    { &lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;&amp;lt;Leader&amp;gt;ao&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;sidekick.cli&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, desc &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;Open another AI CLI&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    { &lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;&amp;lt;Leader&amp;gt;ad&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;sidekick.cli&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, desc &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;Close an AI CLI session&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    { &lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;&amp;lt;Leader&amp;gt;at&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;sidekick.cli&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;send&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { msg &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;{this}&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;} &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, mode &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;x&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}, desc &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;Send this to AI CLI&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    { &lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;&amp;lt;Leader&amp;gt;ap&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;sidekick.cli&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;prompt&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, mode &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;&amp;quot;x&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}, desc &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt; &amp;quot;Pick an AI prompt&amp;quot; &lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;},&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;    -- Ctrl+. and Tab are in the full file&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;One more small file stops the Claude panel from stacking a second title bar under the tabs. heirline (&lt;code&gt;rebelot/heirline.nvim&lt;/code&gt;), the plugin AstroNvim uses for its status line, draws a title strip above every window, and this file turns it off:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;lua&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/heirline.lua&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- No title bar above each window, so the Claude panel shows only one.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;  &amp;quot;rebelot/heirline.nvim&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;  opts&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;_&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt; opts&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    opts.winbar &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt; nil&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; opts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;  end&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Restart, and &lt;code&gt;&amp;lt;Leader&amp;gt;aa&lt;/code&gt; opens Claude next to your code:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/claude-code.png&quot; alt=&quot;Claude Code panel beside report.py&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;ao&lt;/code&gt; lists every other AI CLI that sidekick can open and marks the ones already installed on your machine:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/sidekick.png&quot; alt=&quot;sidekick.nvim picker listing AI CLIs it can open&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;In &lt;strong&gt;Figure 1.12&lt;/strong&gt;, &lt;code&gt;&amp;lt;Leader&amp;gt;ao&lt;/code&gt; picks OpenCode from that list, &lt;code&gt;&amp;lt;Leader&amp;gt;at&lt;/code&gt; sends the function under the cursor to it, and OpenCode answers a question about the code:&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/sidekick-opencode.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.12:&lt;/strong&gt; sidekick.nvim opens OpenCode, sends it &lt;code&gt;total_value&lt;/code&gt; with &lt;code&gt;&amp;lt;Leader&amp;gt;at&lt;/code&gt;, and OpenCode explains the function&lt;/p&gt;
&lt;h3 id=&quot;4-read-what-changed&quot;&gt;4. Read what changed&lt;/h3&gt;
&lt;p&gt;Once the agent has changed something, our first job is finding everything it touched, including files we’ve never opened. AstroNvim already ships the three tools we need for that, so let’s try each one on the project.&lt;/p&gt;
&lt;p&gt;The first is a &lt;strong&gt;picker&lt;/strong&gt; from Snacks, a plugin AstroNvim installs: a search box with a live preview of each result. &lt;code&gt;&amp;lt;Leader&amp;gt;ff&lt;/code&gt; finds files by name and &lt;code&gt;&amp;lt;Leader&amp;gt;fo&lt;/code&gt; reopens recent files, while &lt;code&gt;Ctrl+J&lt;/code&gt; and &lt;code&gt;Ctrl+K&lt;/code&gt; move through the results and &lt;code&gt;Esc&lt;/code&gt; closes the picker.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;fw&lt;/code&gt; searches the text of every file in the project (it needs &lt;a href=&quot;https://github.com/BurntSushi/ripgrep&quot;&gt;ripgrep&lt;/a&gt;), which is how you find every place an agent renamed something:&lt;/strong&gt;&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/finder.png&quot; alt=&quot;Snacks file picker searching the inventory project for rep&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;The second is &lt;a href=&quot;https://github.com/nvim-neo-tree/neo-tree.nvim&quot;&gt;Neo-tree&lt;/a&gt;, the file tree. &lt;code&gt;&amp;lt;Leader&amp;gt;e&lt;/code&gt; (Space, then &lt;code&gt;e&lt;/code&gt;) opens and closes it, and &lt;code&gt;&amp;lt;Leader&amp;gt;o&lt;/code&gt; moves the cursor between the tree and your code. Inside the tree, Enter opens a file, &lt;code&gt;a&lt;/code&gt; creates one (end the name with &lt;code&gt;/&lt;/code&gt; to make a folder), &lt;code&gt;r&lt;/code&gt; renames, &lt;code&gt;d&lt;/code&gt; deletes, and &lt;code&gt;?&lt;/code&gt; shows every other key:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/explorer.png&quot; alt=&quot;Neo-tree open on the inventory project beside report.py&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;The third covers Git: &lt;a href=&quot;https://github.com/lewis6991/gitsigns.nvim&quot;&gt;gitsigns&lt;/a&gt; marks changed lines in the column to the left of the line numbers, and &lt;code&gt;]g&lt;/code&gt; and &lt;code&gt;[g&lt;/code&gt; jump between those changes. &lt;strong&gt;When an agent has edited several files, &lt;code&gt;&amp;lt;Leader&amp;gt;gg&lt;/code&gt; opens &lt;a href=&quot;https://github.com/jesseduffield/lazygit&quot;&gt;lazygit&lt;/a&gt;, where you can see every change before you commit any of them.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;lazygit is a separate program, so install it from the appendix. Inside it, Space stages a file, &lt;code&gt;c&lt;/code&gt; commits, and &lt;code&gt;q&lt;/code&gt; closes it:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/lazygit.png&quot; alt=&quot;lazygit over the inventory project showing a one-line change&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;While we’re in the editor, let’s also fix the line numbers, since agents and error messages refer to code by line number. By default, AstroNvim numbers each line by its distance from the cursor, which makes jumps like &lt;code&gt;5j&lt;/code&gt; easy to count but makes “line 42” hard to find, and it also hides the command line, so whatever you type after &lt;code&gt;:&lt;/code&gt; covers the status bar.&lt;/p&gt;
&lt;p&gt;Both settings live in astrocore (&lt;code&gt;AstroNvim/astrocore&lt;/code&gt;), the file for AstroNvim’s options, keymaps, and autocommands, so open &lt;code&gt;lua/plugins/astrocore.lua&lt;/code&gt;, delete the guard line, and set &lt;code&gt;cmdheight = 1&lt;/code&gt; and &lt;code&gt;relativenumber = false&lt;/code&gt; under &lt;code&gt;options.opt&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;lua&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;-- lua/plugins/astrocore.lua (template, trimmed; delete the guard line)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#A6DA95;--shiki-latte:#40A02B;--shiki-frappe:#A6D189;--shiki-mocha:#A6E3A1&quot;&gt;  &amp;quot;AstroNvim/astrocore&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  opts &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    options &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;      opt &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;        cmdheight &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;        relativenumber &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;5-check-it&quot;&gt;5. Check it&lt;/h3&gt;
&lt;p&gt;Next, let’s make sure the change is correct. &lt;strong&gt;The language packs from step 2 already check every file you open, so this step is mostly about knowing where to look:&lt;/strong&gt; in &lt;strong&gt;Figure 1.13&lt;/strong&gt;, a number becomes a string, ty flags the type error as soon as the file is saved, &lt;code&gt;gl&lt;/code&gt; shows the full message, &lt;code&gt;K&lt;/code&gt; shows a function’s signature, and &lt;code&gt;gd&lt;/code&gt; jumps to where it’s defined:&lt;/p&gt;
&lt;video src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/check.mp4&quot; width=&quot;1920&quot; height=&quot;1200&quot; autoplay loop muted playsinline&gt;&lt;/video&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.13:&lt;/strong&gt; ty flags a type error on save, then &lt;code&gt;gl&lt;/code&gt;, &lt;code&gt;K&lt;/code&gt;, and &lt;code&gt;gd&lt;/code&gt; check the code&lt;/p&gt;
&lt;p&gt;To run the code, AstroNvim ships &lt;a href=&quot;https://github.com/akinsho/toggleterm.nvim&quot;&gt;toggleterm&lt;/a&gt;. &lt;strong&gt;&lt;code&gt;F7&lt;/code&gt; opens a terminal in a split along the bottom, and pressing &lt;code&gt;F7&lt;/code&gt; again hides it&lt;/strong&gt; without stopping the shell, so a long command keeps running while you edit. &lt;code&gt;&amp;lt;Leader&amp;gt;tf&lt;/code&gt; opens a floating terminal instead, and &lt;code&gt;&amp;lt;Leader&amp;gt;tv&lt;/code&gt; opens one in a vertical split:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/terminal.png&quot; alt=&quot;Terminal in a split under report.py after running python3 report.py&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;When running the code isn’t enough, AstroNvim also ships &lt;a href=&quot;https://github.com/mfussenegger/nvim-dap&quot;&gt;nvim-dap&lt;/a&gt;, Neovim’s client for the Debug Adapter Protocol, and the &lt;strong&gt;Python&lt;/strong&gt; packs connect it to &lt;code&gt;debugpy&lt;/code&gt;. &lt;code&gt;F9&lt;/code&gt; sets a breakpoint, &lt;code&gt;F5&lt;/code&gt; starts the debugger, &lt;code&gt;F10&lt;/code&gt; steps over a line, and &lt;code&gt;F11&lt;/code&gt; steps into a function. Move to the &lt;code&gt;print&lt;/code&gt; line in &lt;code&gt;report.py&lt;/code&gt;, press &lt;code&gt;F9&lt;/code&gt;, then press &lt;code&gt;F5&lt;/code&gt; and choose &lt;code&gt;file&lt;/code&gt; the first time it asks what to run:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/debugger.png&quot; alt=&quot;Debugger stopped on a breakpoint in report.py with the variables panel open&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;Pressing &lt;code&gt;F5&lt;/code&gt; again runs the program to the end, and the debugger’s panels close by themselves when it finishes.&lt;/p&gt;
&lt;h3 id=&quot;6-finish-the-look&quot;&gt;6. Finish the look&lt;/h3&gt;
&lt;p&gt;Finally, let’s finish the look. The packs from step 2 also added lualine, the status bar along the bottom, and bufferline, which shows a tab for each open buffer along the top. nvimforge restyles both in &lt;a href=&quot;https://codeberg.org/kidskoding/nvimforge/src/branch/master/nvim/lua/plugins/lualine.lua&quot;&gt;&lt;code&gt;lualine.lua&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://codeberg.org/kidskoding/nvimforge/src/branch/master/nvim/lua/plugins/bufferline.lua&quot;&gt;&lt;code&gt;bufferline.lua&lt;/code&gt;&lt;/a&gt;, with one bar across the whole screen, a pink badge for &lt;span class=&quot;vim-mode vim-mode-terminal&quot;&gt;Terminal&lt;/span&gt; mode so the AI panels stand out, and the active tab on a raised background. Copy those two files if you like the look:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/statusline-normal.png&quot; alt=&quot;lualine in Normal mode with the bufferline tab for report.py&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;Last, which-key, the menu that appears when you press Space, comes with AstroNvim, and Catppuccin colors it for you. Press Space and you’ll see a readable list of keys, with the AI group on &lt;code&gt;a&lt;/code&gt;:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/which-key.png&quot; alt=&quot;which-key menu after pressing Space, with the AI group on a&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;If icons show up as empty boxes, install a &lt;a href=&quot;#fonts-and-icons&quot;&gt;Nerd Font&lt;/a&gt;. &lt;strong&gt;To get this exact editor on another machine, keep &lt;code&gt;~/.config/nvim&lt;/code&gt; in Git&lt;/strong&gt;, including &lt;code&gt;lazy-lock.json&lt;/code&gt;, which pins every plugin to the version you tested.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-loop-start-to-finish&quot;&gt;The loop, start to finish&lt;/h2&gt;
&lt;p&gt;With everything installed, let’s run the whole loop once on the &lt;code&gt;inventory&lt;/code&gt; project: open &lt;code&gt;nvim&lt;/code&gt;, press &lt;code&gt;&amp;lt;Leader&amp;gt;ff&lt;/code&gt;, type &lt;code&gt;rep&lt;/code&gt;, and choose &lt;code&gt;report.py&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;First, let’s make the kind of mistake an agent makes. Put the cursor on the &lt;code&gt;5&lt;/code&gt; in the mouse row and type &lt;code&gt;ciw&lt;/code&gt;, which deletes the number and switches to &lt;span class=&quot;vim-mode vim-mode-insert&quot;&gt;Insert&lt;/span&gt; mode (a plain &lt;code&gt;i&lt;/code&gt; switches without deleting anything). Type &lt;code&gt;&amp;quot;5&amp;quot;&lt;/code&gt; in its place, press &lt;code&gt;Esc&lt;/code&gt; to return to &lt;span class=&quot;vim-mode vim-mode-normal&quot;&gt;Normal&lt;/span&gt; mode, and save with &lt;code&gt;Ctrl+S&lt;/code&gt;. &lt;strong&gt;ty flags the type error immediately&lt;/strong&gt;, and &lt;code&gt;gl&lt;/code&gt; shows the full message:&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/why-i-use-neovim-with-ai/ty-error.png&quot; alt=&quot;ty error after changing the quantity to a string with ciw&quot; width=&quot;1920&quot; height=&quot;1200&quot; loading=&quot;eager&quot; decoding=&quot;async&quot;/&gt;
&lt;p&gt;Press &lt;code&gt;u&lt;/code&gt; to undo that. Then, to check code you didn’t write, put the cursor on &lt;code&gt;total_value&lt;/code&gt; and press &lt;code&gt;K&lt;/code&gt; to see its signature, or &lt;code&gt;gd&lt;/code&gt; to jump to its definition in &lt;code&gt;models.py&lt;/code&gt; and &lt;code&gt;Ctrl+O&lt;/code&gt; to jump back. To rename it everywhere, press &lt;code&gt;&amp;lt;Leader&amp;gt;lr&lt;/code&gt;, type the new name, press Enter, and save the other files it changed with &lt;code&gt;:wa&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now let’s bring in the agent: &lt;code&gt;&amp;lt;Leader&amp;gt;aa&lt;/code&gt; opens the Claude panel, and &lt;code&gt;&amp;lt;Leader&amp;gt;as&lt;/code&gt; sends whatever you’ve selected. &lt;strong&gt;When Claude proposes something like the tax-rate diff from the top of this post, &lt;code&gt;&amp;lt;Leader&amp;gt;an&lt;/code&gt; rejects it and &lt;code&gt;&amp;lt;Leader&amp;gt;ay&lt;/code&gt; accepts it.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If a bad change already got in, &lt;code&gt;daf&lt;/code&gt; deletes the whole function and &lt;code&gt;u&lt;/code&gt; brings the old one back. The rest of the loop uses keys from the build: &lt;code&gt;F7&lt;/code&gt; runs the script, &lt;code&gt;F9&lt;/code&gt; and &lt;code&gt;F5&lt;/code&gt; step through it, and &lt;code&gt;&amp;lt;Leader&amp;gt;gg&lt;/code&gt; shows the full diff so you can commit. Quit with &lt;code&gt;:qa&lt;/code&gt;, and the next time you run a bare &lt;code&gt;nvim&lt;/code&gt; in this folder, session restore reopens your files.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Once that loop feels normal, combining commands is where Neovim pulls ahead:&lt;/strong&gt; &lt;code&gt;c&lt;/code&gt;, &lt;code&gt;d&lt;/code&gt;, and &lt;code&gt;y&lt;/code&gt; work with &lt;code&gt;iw&lt;/code&gt;, &lt;code&gt;i(&lt;/code&gt;, &lt;code&gt;i&amp;quot;&lt;/code&gt;, and &lt;code&gt;af&lt;/code&gt; to change, delete, or copy exactly the text you mean, &lt;code&gt;dd&lt;/code&gt; deletes a line and &lt;code&gt;p&lt;/code&gt; pastes it, &lt;code&gt;]f&lt;/code&gt; jumps to the next function, and &lt;code&gt;.&lt;/code&gt; repeats your last change. &lt;strong&gt;Table 1.4&lt;/strong&gt; collects every key from this section:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Do&lt;/th&gt;
&lt;th&gt;Keys&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Find file / search the project&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;ff&lt;/code&gt; / &lt;code&gt;&amp;lt;Leader&amp;gt;fw&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;File tree&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;e&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span class=&quot;vim-mode vim-mode-insert&quot;&gt;Insert&lt;/span&gt; / &lt;span class=&quot;vim-mode vim-mode-normal&quot;&gt;Normal&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;i&lt;/code&gt; / &lt;code&gt;Esc&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Change a word, an argument, a string&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ciw&lt;/code&gt;, &lt;code&gt;ci(&lt;/code&gt;, &lt;code&gt;ci&amp;quot;&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Delete a function / undo / repeat&lt;/td&gt;
&lt;td&gt;&lt;code&gt;daf&lt;/code&gt; / &lt;code&gt;u&lt;/code&gt; / &lt;code&gt;.&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full diagnostic&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gl&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hover / go to definition&lt;/td&gt;
&lt;td&gt;&lt;code&gt;K&lt;/code&gt; / &lt;code&gt;gd&lt;/code&gt; (&lt;code&gt;Ctrl+O&lt;/code&gt; back)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rename symbol&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;lr&lt;/code&gt;, then &lt;code&gt;:wa&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;Leader&amp;gt;aa&lt;/code&gt; Claude · &lt;code&gt;&amp;lt;Leader&amp;gt;ay&lt;/code&gt; / &lt;code&gt;&amp;lt;Leader&amp;gt;an&lt;/code&gt; accept / reject · &lt;code&gt;&amp;lt;Leader&amp;gt;ao&lt;/code&gt; / &lt;code&gt;&amp;lt;Leader&amp;gt;ad&lt;/code&gt; open / close other CLIs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Terminal / debug / Git&lt;/td&gt;
&lt;td&gt;&lt;code&gt;F7&lt;/code&gt; · &lt;code&gt;F9&lt;/code&gt;/&lt;code&gt;F5&lt;/code&gt;/&lt;code&gt;F10&lt;/code&gt; · &lt;code&gt;&amp;lt;Leader&amp;gt;gg&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Quit&lt;/td&gt;
&lt;td&gt;&lt;code&gt;:qa&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.4:&lt;/strong&gt; the keys from the full loop, for quick reference&lt;/p&gt;
&lt;p&gt;It took me years of switching back and forth before I was as fast in Neovim as I was in my old editor. &lt;strong&gt;What finally made it stick was starting from a setup that already worked:&lt;/strong&gt; once I stopped spending my time configuring Neovim, I could spend it writing code instead, and this guide gives you that same head start.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;where-to-start&quot;&gt;Where to start&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Keep your AI tools:&lt;/strong&gt; Claude Code works the same in the Neovim panel, and sidekick.nvim covers the other agents and Copilot, so switching editors doesn’t cost you any of them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Learn the fixing keys first:&lt;/strong&gt; &lt;code&gt;ciw&lt;/code&gt;, &lt;code&gt;ci&amp;quot;&lt;/code&gt;, &lt;code&gt;daf&lt;/code&gt;, &lt;code&gt;u&lt;/code&gt;, and &lt;code&gt;.&lt;/code&gt; cover the corrections AI output needs most often, and they’ll help you more than any plugin.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check every claim in the editor:&lt;/strong&gt; read the diff, press the key, run the code, and let ty and Ruff flag mistakes the moment a change lands (that’s if you are using Python!).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Start from a complete editor:&lt;/strong&gt; use AstroNvim or nvimforge, then change one part only when it slows you down, not because a plugin looks interesting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grow into it:&lt;/strong&gt; do one small, real task in Neovim each day until it becomes the editor you open first.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When you forget a key, &lt;code&gt;&amp;lt;Leader&amp;gt;fk&lt;/code&gt; searches every keymap and &lt;code&gt;&amp;lt;Leader&amp;gt;fh&lt;/code&gt; searches Neovim’s help.&lt;/p&gt;
&lt;p&gt;Eventually, once Neovim starts to feel like home, you might get curious about building your own setup from the ground up. When that day comes, &lt;a href=&quot;https://github.com/nvim-lua/kickstart.nvim&quot;&gt;kickstart.nvim&lt;/a&gt; is a friendly place to start: it’s a single, heavily commented file that explains every piece as you read through it. There’s no rush, though, and plenty of people happily stay on AstroNvim for years.&lt;/p&gt;
&lt;p&gt;If you want to keep exploring the config we just built, it all lives in &lt;a href=&quot;https://codeberg.org/kidskoding/nvimforge&quot;&gt;nvimforge&lt;/a&gt;, which is freely available on my Codeberg for you to tweak and make your own! And if you’re curious as to how I’ve set up Neovim for myself entirely from scratch, you can check out &lt;a href=&quot;https://codeberg.org/kidskoding/kidskoding.nvim&quot;&gt;kidskoding.nvim&lt;/a&gt;, which is also freely available on my Codeberg.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;wrapping-up&quot;&gt;Wrapping up&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Vim is still famous for being hard to quit&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With an agent running in the terminal beside it, it’s also the fastest place I know to read, check, and fix what that agent wrote.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt; Funnily enough, this whole website is built to look like Neovim, with a tab bar of open files along the top, a status bar along the bottom, and even a &lt;a href=&quot;https://anirudh-konidala.vercel.app/checkhealth&quot;&gt;&lt;code&gt;:checkhealth&lt;/code&gt;&lt;/a&gt; page. Now that you know the motions, try them right here: &lt;code&gt;j&lt;/code&gt; and &lt;code&gt;k&lt;/code&gt; scroll this post, and &lt;code&gt;:q&lt;/code&gt; closes it just like a buffer. If you’d rather not, your mouse works exactly like it does on any other website.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;appendix-installing-everything&quot;&gt;Appendix: installing everything&lt;/h2&gt;
&lt;h3 id=&quot;what-you-need&quot;&gt;What you need&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Neovim 0.11+&lt;/td&gt;
&lt;td&gt;Editor (AstroNvim v6 min; written against 0.12)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nvim --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Git&lt;/td&gt;
&lt;td&gt;Config and plugins&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Node.js&lt;/td&gt;
&lt;td&gt;Most language servers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;node --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C compiler&lt;/td&gt;
&lt;td&gt;Tree-sitter parsers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;gcc --version&lt;/code&gt; or &lt;code&gt;clang --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tree-sitter CLI&lt;/td&gt;
&lt;td&gt;Parsers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tree-sitter --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ripgrep&lt;/td&gt;
&lt;td&gt;Project search&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rg --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fd&lt;/td&gt;
&lt;td&gt;File search&lt;/td&gt;
&lt;td&gt;&lt;code&gt;fd --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Nerd Font&lt;/td&gt;
&lt;td&gt;Icons&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;#fonts-and-icons&quot;&gt;Fonts&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;lazygit&lt;/td&gt;
&lt;td&gt;Git UI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;lazygit --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;td&gt;Agent&lt;/td&gt;
&lt;td&gt;&lt;code&gt;claude --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Python 3&lt;/td&gt;
&lt;td&gt;Examples&lt;/td&gt;
&lt;td&gt;&lt;code&gt;python3 --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Neovide&lt;/td&gt;
&lt;td&gt;Optional GUI&lt;/td&gt;
&lt;td&gt;&lt;code&gt;neovide --version&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;On Linux, also install &lt;code&gt;wl-clipboard&lt;/code&gt; or &lt;code&gt;xclip&lt;/code&gt; so Neovim can use the system clipboard. nvimforge’s Nix flake already includes ripgrep, fd, tree-sitter, lazygit, Node, and a C compiler.&lt;/p&gt;
&lt;h3 id=&quot;installing-the-tools&quot;&gt;Installing the tools&lt;/h3&gt;
&lt;p&gt;These steps follow Neovim’s &lt;a href=&quot;https://github.com/neovim/neovim/blob/master/INSTALL.md&quot;&gt;install guide&lt;/a&gt;, and Claude Code has &lt;a href=&quot;https://docs.anthropic.com/en/docs/claude-code&quot;&gt;its own setup docs&lt;/a&gt;.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;# macOS&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;xcode-select&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;--install&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;brew&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;neovim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;node&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;ripgrep&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;fd&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;lazygit&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;brew&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;--cask&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;font-jetbrains-mono-nerd-font&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;# Windows (PowerShell)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;winget&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;Neovim.Neovim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;Git.Git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;OpenJS.NodeJS.LTS&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;sh-param&quot;&gt;BurntSushi.ripgrep.MSVC&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;sharkdp.fd&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;JesseDuffield.lazygit&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;# Arch&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;pacman&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-S&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;neovim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;nodejs&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;npm&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;base-devel&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;sh-param&quot;&gt;ripgrep&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;fd&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;tree-sitter-cli&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;lazygit&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;# Debian / Ubuntu (Neovim from tarball below)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;apt&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;nodejs&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;npm&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;build-essential&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;ripgrep&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;fd-find&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;unzip&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;# Other Linux x86_64&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-LO&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;sh-param&quot;&gt;https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-C&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;/opt&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-xzf&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;nvim-linux-x86_64.tar.gz&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;PATH=&amp;quot;$PATH:/opt/nvim-linux-x86_64/bin&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If &lt;code&gt;nvim --version&lt;/code&gt; reports anything older than 0.11, install from the tarball and add the &lt;code&gt;export&lt;/code&gt; line to your shell’s startup file.&lt;/p&gt;
&lt;p&gt;On Debian and Ubuntu, &lt;code&gt;fd&lt;/code&gt; installs under the name &lt;code&gt;fdfind&lt;/code&gt;, and on Windows you’ll also need a C compiler, such as Visual Studio Build Tools. If the tree-sitter CLI is missing, delete the guard line in the template’s &lt;code&gt;lua/plugins/mason.lua&lt;/code&gt; and Mason will install it for you.&lt;/p&gt;
&lt;h3 id=&quot;fonts-and-icons&quot;&gt;Fonts and icons&lt;/h3&gt;
&lt;p&gt;Icons need a &lt;a href=&quot;https://www.nerdfonts.com/font-downloads&quot;&gt;Nerd Font&lt;/a&gt; set as your terminal font. If you’d rather not install one, set &lt;code&gt;icons_enabled = false&lt;/code&gt; in &lt;code&gt;lua/lazy_setup.lua&lt;/code&gt; to turn icons off.&lt;/p&gt;
&lt;h3 id=&quot;neovide&quot;&gt;Neovide&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://neovide.dev/installation.html&quot;&gt;Neovide&lt;/a&gt; is an optional graphical window for this same config. Set its font in &lt;code&gt;lua/polish.lua&lt;/code&gt; with a line like &lt;code&gt;vim.o.guifont = &amp;quot;JetBrainsMono Nerd Font:h14&amp;quot;&lt;/code&gt;, and on Nix you can launch it with &lt;code&gt;nix run .#neovide&lt;/code&gt; from the nvimforge folder.&lt;/p&gt;
&lt;h3 id=&quot;windows-template-path&quot;&gt;Windows template path&lt;/h3&gt;
&lt;p&gt;On Windows the config lives under &lt;code&gt;%LOCALAPPDATA%&lt;/code&gt;, but the steps don’t change: clone the template, start Neovim once, quit, and then edit the files.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;powershell&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;clone&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;--depth&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;https://github.com/AstroNvim/template&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;$env:LOCALAPPDATA\nvim&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;Remove-Item&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;$env:LOCALAPPDATA\nvim\.git&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-Recurse&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-Force&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;nvim&lt;/span&gt;   &lt;span class=&quot;sh-comment&quot;&gt;# wait for plugins, then :qa&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;when-it-doesnt-work&quot;&gt;When it doesn’t work&lt;/h3&gt;
&lt;p&gt;Most problems come down to a missing program or a guard line you forgot to delete:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If icons show up as boxes, install a Nerd Font or set &lt;code&gt;icons_enabled = false&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If there’s no syntax highlighting, make sure a C compiler and the tree-sitter CLI are on your &lt;code&gt;PATH&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If language features don’t work, check &lt;code&gt;:Mason&lt;/code&gt; and the language’s own toolchain.&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;&amp;lt;Leader&amp;gt;fw&lt;/code&gt; finds nothing, install ripgrep.&lt;/li&gt;
&lt;li&gt;If Neovim ignores your config, one of your files still has its &lt;code&gt;if true then return {} end&lt;/code&gt; guard line.&lt;/li&gt;
&lt;li&gt;If errors stay red after you fix them, save with &lt;code&gt;:w&lt;/code&gt; or run &lt;code&gt;:LspRestart&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If the Claude panel won’t open, check that &lt;code&gt;claude&lt;/code&gt; runs in a normal shell.&lt;/li&gt;
&lt;li&gt;If nothing else helps, run &lt;code&gt;:checkhealth&lt;/code&gt;, or start &lt;code&gt;nvim --clean&lt;/code&gt; to rule out your config.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;if-you-already-have-a-neovim-config&quot;&gt;If you already have a Neovim config&lt;/h3&gt;
&lt;p&gt;Move your existing config and data folders out of the way so the template starts clean:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.config/nvim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.config/nvim.bak&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.local/share/nvim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.local/share/nvim.bak&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.local/state/nvim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.local/state/nvim.bak&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.cache/nvim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.cache/nvim.bak&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;On Windows, move &lt;code&gt;%LOCALAPPDATA%\nvim&lt;/code&gt; and &lt;code&gt;%LOCALAPPDATA%\nvim-data&lt;/code&gt; instead.&lt;/p&gt;
&lt;h3 id=&quot;undoing-it&quot;&gt;Undoing it&lt;/h3&gt;
&lt;p&gt;To go back to your old setup, delete the new folders and restore the backups:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;sh&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;sh-opt&quot;&gt;-rf&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.config/nvim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;sh-param&quot;&gt;~/.local/share/nvim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;sh-param&quot;&gt;~/.local/state/nvim&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;\&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;  &lt;span class=&quot;sh-param&quot;&gt;~/.cache/nvim&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.config/nvim.bak&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.config/nvim&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.local/share/nvim.bak&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.local/share/nvim&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.local/state/nvim.bak&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.local/state/nvim&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;sh-prompt&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;sh-cmd&quot;&gt;mv&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.cache/nvim.bak&lt;/span&gt; &lt;span class=&quot;sh-param&quot;&gt;~/.cache/nvim&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;nix&quot;&gt;Nix&lt;/h3&gt;
&lt;p&gt;On Nix, you can try Neovim with &lt;code&gt;nix shell nixpkgs#neovim&lt;/code&gt;, or on NixOS add the packages to &lt;code&gt;environment.systemPackages&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The programs Mason downloads often won’t run on NixOS as they are, so you’ll usually need &lt;code&gt;programs.nix-ld&lt;/code&gt; or the nixpkgs versions of those tools. nvimforge’s &lt;code&gt;flake.nix&lt;/code&gt; can also run this config alongside an existing Neovim install.&lt;/p&gt;</content:encoded></item><item><title>Khan Academy&apos;s $10,000 Degree That Could Reshape Higher Education</title><link>https://anirudh-konidala.vercel.app/blog/khan-ted-institute-future-of-higher-ed/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/khan-ted-institute-future-of-higher-ed/</guid><description>Khan Academy, TED, and ETS announced a $10K bachelor&apos;s in Applied AI backed by Google and McKinsey at TED2026. As a CS and Education: Learning Sciences and Learning Tech student, here&apos;s what I believe the model actually changes, along with where it could break.</description><pubDate>Fri, 01 May 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I study Computer Science and Education at the University of Illinois Urbana-Champaign, concentrated in &lt;strong&gt;Learning Sciences&lt;/strong&gt; and &lt;strong&gt;Learning Technology&lt;/strong&gt;. This is a very unique major that focuses on &lt;strong&gt;how people learn with technology&lt;/strong&gt; and &lt;strong&gt;how emerging technology can be designed to improve student learning&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This major has helped me understand why the &lt;strong&gt;how&lt;/strong&gt; of learning matters, not just the &lt;em&gt;what&lt;/em&gt;. I’ve always believed in building systems that make quality education accessible to everyone, not just those who can afford a seat in the right classroom.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sal Khan&lt;/strong&gt; has spent two decades building toward that same belief. As the founder of &lt;strong&gt;Khan Academy&lt;/strong&gt;, the free online learning platform used by over &lt;strong&gt;150 million people worldwide&lt;/strong&gt;, accessible education is his life’s work&lt;/p&gt;
&lt;p&gt;And recently, at the &lt;strong&gt;TED 2026&lt;/strong&gt; conference in Vancouver, he announced his most ambitious answer yet&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;a bachelor’s degree in Applied AI for under &lt;strong&gt;$10,000&lt;/strong&gt;. Total. Not per year. &lt;strong&gt;Total&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Harvard&lt;/strong&gt; charges &lt;strong&gt;$62,226 per year&lt;/strong&gt;.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. &lt;strong&gt;Stanford&lt;/strong&gt; charges &lt;strong&gt;$67,731&lt;/strong&gt;.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. Sal Khan’s number is the entire degree&lt;/p&gt;
&lt;p&gt;But the price isn’t the full story&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;what-khan-ted-institute-actually-is&quot;&gt;What Khan TED Institute Actually Is&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Khan TED Institute&lt;/strong&gt; is a joint venture between &lt;strong&gt;Khan Academy&lt;/strong&gt;, &lt;strong&gt;TED&lt;/strong&gt;, and &lt;strong&gt;ETS&lt;/strong&gt; (Educational Testing Service). It will offer a bachelor’s degree in &lt;strong&gt;Applied AI&lt;/strong&gt; that is fully online, competency-based, and built with direct input from some of the biggest tech and consulting employers in the world&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;:
&lt;strong&gt;Google&lt;/strong&gt;, &lt;strong&gt;Microsoft&lt;/strong&gt;, &lt;strong&gt;Accenture&lt;/strong&gt;, &lt;strong&gt;Bain&lt;/strong&gt;, &lt;strong&gt;McKinsey&lt;/strong&gt;, and &lt;strong&gt;Replit&lt;/strong&gt;.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;. These aren’t just honorary advisors. They are working towards co-designing the curriculum that will significantly shape what the degree actually teaches.&lt;/p&gt;
&lt;p&gt;The curriculum spans mathematics, statistics, economics, computer science, history, and writing, all alongside applied AI work: building AI apps, developing agents, and running team-based simulations.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The goal is a degree that &lt;strong&gt;looks like a job&lt;/strong&gt;, &lt;strong&gt;not a classroom&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The format is built around asynchronous coursework, group projects across time zones, and live “dialogue sessions” with peer feedback. Occasional access to TED speakers. &lt;strong&gt;No lecture halls&lt;/strong&gt;. &lt;strong&gt;No commute&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Students advance by demonstrating mastery: the same philosophy baked into Khan Academy’s free platform, where a student doesn’t move into the next topic in the degree plan until they’ve proven they understand the current one. On Khan Academy, that means hitting a consistent accuracy threshold on exercises before the system unlocks what’s next. No shortcuts, no moving forward because the semester ended.
The degree applies the same logic at a higher level: you don’t earn credit by sitting through a module. Instead, you earn it by showing you can &lt;strong&gt;use&lt;/strong&gt; what it taught. The transcript that comes out the other side reflects skills demonstrated, not credit hours logged.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Applications are expected to open within &lt;strong&gt;12 to 18 months&lt;/strong&gt;, with a &lt;strong&gt;2027 target launch&lt;/strong&gt;.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;4&lt;/a&gt;&lt;/sup&gt; The program currently has not yet secured accreditation. It is currently pursuing approval from bodies like the Higher Learning Commission or the Western Association of Schools and Colleges&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;why-the-traditional-model-is-cracking&quot;&gt;Why the Traditional Model Is Cracking&lt;/h2&gt;
&lt;p&gt;Khan didn’t invent this pressure. He’s responding to it&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;51% of Gen Z graduates&lt;/strong&gt; say they regret their degree choice.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; &lt;strong&gt;42.5 million Americans&lt;/strong&gt; carry federal student loan debt, with an average balance of &lt;strong&gt;$39,000&lt;/strong&gt;.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; Among recent college graduates, &lt;strong&gt;5.6% are unemployed&lt;/strong&gt;, which is way above the national average,  and &lt;strong&gt;42.5% are underemployed&lt;/strong&gt; (working jobs that don’t require the degree they went into debt to earn)&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;These aren’t recession numbers. They’re structural. The traditional model was built for a labor market that assumed a degree was a reliable ticket to employment. That assumption is fraying, and its becoming less reliable as AI slowly emerges into the industry&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The traditional college degree was designed for a different era: one where four years of seat time, a fixed curriculum, and an institutional stamp were sufficient signals of competence. AI is compressing the skills at the rate of half-life of every profession. The traditional university model just can’t keep up&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Meanwhile, mid-career professionals who need to reskill for an AI-transformed job market can’t take four years off. Additionally, the on-campus, 18-year-old model excludes the majority of people who need education the most right now&lt;/p&gt;
&lt;p&gt;Sal Khan said it plainly: &lt;strong&gt;“Higher education has served many people very well, but not everyone has access.”&lt;/strong&gt;&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; The data suggests even those who got access aren’t satisfied with what they got&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;what-khans-model-actually-changes&quot;&gt;What Khan’s Model Actually Changes&lt;/h2&gt;
&lt;p&gt;Three things are genuinely different here, and they compound&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First: competency over seat time.&lt;/strong&gt; Traditional degrees measure credit hours: time spent in a chair. Khan and TED’s degree program advances students when they can &lt;em&gt;demonstrate mastery&lt;/em&gt;, not when they’ve waited long enough. This traces directly to &lt;strong&gt;Benjamin Bloom’s mastery learning research&lt;/strong&gt; in the 1960s, which showed that when students receive adequate time and targeted feedback, nearly all can reach high mastery. &lt;strong&gt;Credit hours were invented for scheduling, not for measuring learning.&lt;/strong&gt; Khan is building at scale what researchers have argued for decades.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Second: who co-signs the credential.&lt;/strong&gt; A Harvard degree signals “Harvard trusted this person.” A Khan TED degree signals “Google and McKinsey helped design what this person learned, and this person can demonstrate it.” That is a different trust chain entirely. Historically, institutional prestige has been the proxy for employer trust. But now, Khan is proposing a change that short-circuits this: to make the employer relationship direct instead of mediated by a university brand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Third: who college is for.&lt;/strong&gt; The online, asynchronous, flexible format isn’t a compromise: &lt;strong&gt;it’s a design choice&lt;/strong&gt;. It chooses to target those who can’t pause their lives: working adults, international students, mid-career professionals. Khan has mentioned the possibility of geo-based pricing and aggressive financial aid to extend access even further.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; That isn’t just a niche demographic. That is the majority of people who need access to higher education and currently can’t reach it.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;what-the-future-looks-like-if-this-works&quot;&gt;What the Future Looks Like If This Works&lt;/h2&gt;
&lt;p&gt;If Khan TED works, it doesn’t just add one more option to higher education. It triggers a sequence of shifts that puts pressure on every institution that hasn’t rethought its model. But each step depends on the one before it.&lt;/p&gt;
&lt;p&gt;If it secures &lt;strong&gt;accreditation&lt;/strong&gt;, it opens up &lt;strong&gt;FAFSA eligibility&lt;/strong&gt; (federal financial aid) and the ability for employers to list it as a satisfying “degree required” on job postings. Those two unlocks are the difference between a well-branded alternative and a mainstream credential that changes how people make decisions about college&lt;/p&gt;
&lt;p&gt;If the corporate partners, Google, Microsoft, McKinsey, actually hire graduates at scale, the signal value compounds. Other universities then have to face a hard question, regarding what exactly are they charging $200,000+ to provide&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The schools most at risk aren’t the ones at the top or the bottom.&lt;/strong&gt; Harvard, Stanford, and strong public research universities like UIUC survive because their value proposition is real &lt;strong&gt;if students expose themselves to those opportunities&lt;/strong&gt;: deep employer relationships, ranked programs, and networks that hold up in today’s job market&lt;/p&gt;
&lt;p&gt;However, the schools that will be the most exposed are the ones charging $40,000 to $60,000 a year that can’t point to any of those highly established perks. Private institutions where the degree’s value rests entirely on convention rather than outcomes. Instead, a credible $10,000 alternative with Google and McKinsey co-signing the curriculum is a direct challenge to that argument.&lt;/p&gt;
&lt;p&gt;In the longer term, the model points toward a different architecture for education entirely: employer-aligned curricula become standard, competency-based transcripts replace GPA, and stackable credentials let people build qualifications across a career rather than all at once at eighteen. The idea that you get one degree and it carries you for forty years is slowly dissolving&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If this model works, it doesn’t just create a cheaper college. It establishes that the authority to credential someone doesn’t have to reside in a university: it can reside in the demonstrated trust of the people doing the hiring&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;what-im-watching&quot;&gt;What I’m Watching&lt;/h2&gt;
&lt;p&gt;I chose to study CS and Education at UIUC because I believe the two fields have always been more connected than academia admits: that how you build learning systems and how people actually learn are the same question asked from different directions. Khan TED Institute is the most visible bet anyone has made on that idea at scale.&lt;/p&gt;
&lt;p&gt;The pedagogical model is defensible. Mastery-based learning works. Employer-aligned curriculum is more honest about what it’s preparing people for than gen-ed requirements designed for a different century. Asynchronous formats with structured collaboration are backed by decades of research.&lt;/p&gt;
&lt;p&gt;The politics: accreditation, employer adoption, and cultural legitimacy are the gamble.&lt;/p&gt;
&lt;p&gt;But here’s what I keep coming back to: every year, someone asks me why I didn’t just do CS. The subtext is always the same: education isn’t a real field, it’s a soft add-on. Khan and TED’s $10,000 AI degree argues that the opposite is true. That understanding &lt;strong&gt;how&lt;/strong&gt; people learn and building systems that respect that is exactly the lever that makes technical education worth anything at all&lt;/p&gt;
&lt;p&gt;Khan isn’t disrupting higher education by cutting the price. &lt;strong&gt;He’s refuting the idea that a university’s stamp is what makes knowledge legitimate&lt;/strong&gt;. If he’s right, the most important question in education for the next decade won’t be &lt;strong&gt;where&lt;/strong&gt; you learned. It’ll be &lt;strong&gt;what you can do&lt;/strong&gt;.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;a name=&quot;references&quot;&gt;&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://fortune.com/2026/04/15/sal-khan-ceo-khan-academy-google-microsoft-ted-ets-higher-education-institute-bachelors-applied-ai-gen-z-college-upskilling/&quot;&gt;This CEO has teamed up with Google, Microsoft, and McKinsey to build an AI degree that could rival Harvard — Fortune&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://sfstandard.com/2026/04/14/sal-khan-ted-ai-degree/&quot;&gt;Sal Khan launching a $10K AI degree, with help from Google, Microsoft, and Replit — SF Standard&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://builtin.com/articles/khan-ted-institute-ai-degree&quot;&gt;What Is the Khan TED Institute? AI School Explained — Built In&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://learnworkecosystemlibrary.com/initiatives/khan-ted-institute-bachelors-degree-in-applied-ai/&quot;&gt;Khan TED Institute (Bachelor’s Degree in Applied AI) — Learn &amp;amp; Work Ecosystem Library&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.nbcnews.com/video/khan-academy-to-launch-a-new-ai-degree-262503493628&quot;&gt;Khan Academy to launch a new AI degree — NBC News&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://e.vnexpress.net/news/tech/enterprises/khan-academy-to-launch-ai-degree-under-10-000-to-rival-harvard-stanford-5063698.html&quot;&gt;Khan Academy to launch AI degree under $10,000 to rival Harvard, Stanford — VnExpress International&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr/&gt;
&lt;p&gt;&lt;em&gt;Originally published on &lt;a href=&quot;https://dev.to/anikoni2010/khan-academys-10000-degree-that-could-reshape-higher-education-1n9n&quot;&gt;DEV&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title>SpaceX + Cursor: The $60B Bet that Redefines Vibe Coding and the AI Stack</title><link>https://anirudh-konidala.vercel.app/blog/spacex-cursor-60b-vibe-coding/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/spacex-cursor-60b-vibe-coding/</guid><description>SpaceX just secured an option to acquire AI coding giant Cursor for $60 billion. Here&apos;s why this deal is not only just big, but also a structural shift in who controls the future of software.</description><pubDate>Wed, 22 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;SpaceX&lt;/strong&gt; builds rockets, launches satellites, and is working to make humanity multiplanetary. They also plan to go IPO very soon 👀 👀&lt;/p&gt;
&lt;p&gt;Yesterday, they just did something that shocked the tech realm: &lt;strong&gt;a $60 billion bet on an AI code editor&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That contrast isn’t ironic, but rather the whole point. It tells you exactly where the real leverage in the AI era actually lives.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This isn’t a bet on a product, but rather a bet &lt;strong&gt;on how software will be written&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-deal&quot;&gt;The Deal&lt;/h2&gt;
&lt;p&gt;Yesterday, it was reported that SpaceX has secured an &lt;strong&gt;option to acquire Cursor&lt;/strong&gt;, the AI-native IDE built by Anysphere, for &lt;strong&gt;$60 billion&lt;/strong&gt; later this year.&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;This isn’t a straightforward acquisition announcement. SpaceX has two choices:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Pay $10 billion&lt;/strong&gt; for the work they are already doing together: a partnership payout&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exercise the option and acquire Cursor outright for $60 billion&lt;/strong&gt; later in 2026&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Think of it as an expensive try-before-you-buy. SpaceX is already working with Cursor. The $10B isn’t a deposit, but instead is a measure of what the collaboration itself is worth if they don’t follow through on the full acquisition. The $60B is the price of owning the whole thing.&lt;/p&gt;
&lt;p&gt;This structure, optionality with a high floor, shows us that &lt;strong&gt;SpaceX&lt;/strong&gt; isn’t playing around. They are deeply committed regardless of which path they choose. Obviously, you wouldn’t pay $10 billion for a partnership you’re not serious about.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;why-this-deal-exists&quot;&gt;Why This Deal Exists&lt;/h2&gt;
&lt;p&gt;To understand why SpaceX wants Cursor, you need to understand how the AI stack is structured.&lt;/p&gt;
&lt;p&gt;Building a dominant AI company requires three things:&lt;/p&gt;
&lt;p style=&quot;text-align: center; font-family: monospace; background: rgba(255,255,255,0.05); border-radius: 0.5rem; padding: 0.75rem 1rem; margin: 1rem 0 !important;&quot;&gt;Compute  →  Models  →  Interface&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Compute&lt;/strong&gt; is the raw infrastructure. This includes GPUs, data centers, training clusters&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Models&lt;/strong&gt; are the intelligence layer trained on that compute&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interface&lt;/strong&gt; is where users actually interact with the models, the product layer.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Most companies only own one of these&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;OpenAI&lt;/strong&gt; has strong models but relies on Microsoft’s compute and third-party interfaces&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hugging Face&lt;/strong&gt; has distribution but no proprietary compute or models. Even the best-funded AI labs tend to be missing at least one leg of the stool.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;SpaceX, after acquiring xAI back in February for $250 billion&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;, now controls two legs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Compute&lt;/strong&gt;: Colossus, SpaceX’s supercomputing cluster described as equivalent to one million H100 GPUs&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Models&lt;/strong&gt;: xAI’s Grok, and all the research and infrastructure that comes with it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What they don’t control is the &lt;strong&gt;interface&lt;/strong&gt;: the layer where developers actually work to spend their time&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cursor is what makes that layer happen for SpaceX&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;cursors-role&quot;&gt;Cursor’s Role&lt;/h2&gt;
&lt;p&gt;Cursor is not a plugin. It’s not an autocomplete tool bolted onto an existing editor.&lt;/p&gt;
&lt;p&gt;It is an &lt;strong&gt;AI-native IDE&lt;/strong&gt;, a development environment rebuilt from the ground up as a fork of Visual Studio Code, with the assumption that AI is a first-class participant in the programming process. It handles multi-file context, runs background agents, integrates with the terminal, and supports workflows where the human is directing rather than typing.&lt;/p&gt;
&lt;p&gt;By April 2026, Cursor is used by &lt;strong&gt;70% of Fortune 1000 companies&lt;/strong&gt;&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;, with 60% of its revenue coming from enterprise deployments. We’re talking &lt;strong&gt;Nvidia&lt;/strong&gt; (all 40,000 engineers), &lt;strong&gt;Salesforce&lt;/strong&gt; (90% of ~20,000 developers), &lt;strong&gt;Uber&lt;/strong&gt;, &lt;strong&gt;Adobe&lt;/strong&gt;, &lt;strong&gt;Shopify&lt;/strong&gt;, &lt;strong&gt;OpenAI&lt;/strong&gt;, and &lt;strong&gt;Perplexity&lt;/strong&gt;. Its ARR trajectory is the fastest ever recorded for a B2B software company:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;ARR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;January 2025&lt;/td&gt;
&lt;td&gt;$100M&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;June 2025&lt;/td&gt;
&lt;td&gt;$500M&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;November 2025&lt;/td&gt;
&lt;td&gt;$1B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;February 2026&lt;/td&gt;
&lt;td&gt;$2B&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;That growth isn’t just about a good product. It reflects a structural reality: &lt;strong&gt;when developers adopt a tool, they adopt it deeply&lt;/strong&gt;. Their muscle memory, their workflows, and their shortcuts all adapt to the tool. Switching costs are high, but retention is high. And the tool becomes the surface through which everything else reaches them.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Interface equals distribution. Whoever owns where developers work owns the channel to every capability built on top.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is why Cursor is worth $60 billion to SpaceX. Not because of the editor itself, but because of what the editor unlocks for big businesses.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-real-shift-from-vibe-coding-to-agentic-development&quot;&gt;The Real Shift: From Vibe Coding to Agentic Development&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;“Vibe coding”&lt;/strong&gt; entered the mainstream vocabulary in early 2025. It was coined by Andrej Karpathy, a founding member of OpenAI and former Director of AI at Tesla, where you could describe what you wanted in natural language and an AI would write the code. It was playful, accessible, and genuinely useful for prototyping.&lt;/p&gt;
&lt;p&gt;But vibe coding was only the start. Since then, things have evolved like crazy:&lt;/p&gt;
&lt;div style=&quot;display: flex; justify-content: center; font-family: monospace; background: rgba(255,255,255,0.05); border-radius: 0.5rem; padding: 0.75rem 1rem; margin: 1rem 0;&quot;&gt;&lt;div style=&quot;display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 0 0.5rem; text-align: center;&quot;&gt;&lt;span&gt;Autocomplete&lt;/span&gt;&lt;span&gt;→&lt;/span&gt;&lt;span&gt;Copilots&lt;/span&gt;&lt;span&gt;→&lt;/span&gt;&lt;span&gt;Agents&lt;/span&gt;&lt;span style=&quot;font-size: 0.8em; opacity: 0.7;&quot;&gt;(line-by-line)&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 0.8em; opacity: 0.7;&quot;&gt;(file-level)&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 0.8em; opacity: 0.7;&quot;&gt;(task-level)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Each step represents a shift in what the developer actually does. With autocomplete, you still write most of the code. With copilots, you accept or reject suggestions. With agents, you describe a goal and review the output.&lt;/p&gt;
&lt;p&gt;The workflow has inverted. The developer is no longer primarily a writer of code, but rather they are an &lt;strong&gt;orchestrator of AI systems&lt;/strong&gt;. They define requirements, review outputs, catch errors, redirect when the agent goes wrong. The cognitive work has shifted upward: less syntax, more architecture; less implementation, more judgment.&lt;/p&gt;
&lt;p&gt;This shift has a concrete consequence: &lt;strong&gt;the interface layer becomes dramatically more important&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;When developers were writing every line, the value of a tool was in how fast it helped you write. Now that agents handle more of the implementation, the value is in how well the tool helps you think, direct, and review. That’s a different product entirely — and Cursor is further along that curve than anyone else.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-spacex--xai-strategy&quot;&gt;The SpaceX / xAI Strategy&lt;/h2&gt;
&lt;p&gt;Put the pieces together and the thesis becomes clear.&lt;/p&gt;
&lt;p&gt;SpaceX acquired xAI to control the model and compute layers. The Colossus supercomputer gives them training capacity that few organizations on Earth can match. Grok gives them a model family to improve and deploy.&lt;/p&gt;
&lt;p&gt;But raw capability without distribution doesn’t win markets. Google has arguably the best AI research lab in the world. It still doesn’t dominate the developer tools space. Research excellence and product dominance are different problems.&lt;/p&gt;
&lt;p&gt;Cursor solves the distribution problem. It gives SpaceX/xAI a &lt;strong&gt;direct channel to the engineers at 70% of the world’s largest companies&lt;/strong&gt; — engineers who are already using the tool daily, already trusting it with their codebases, already building workflows around it.&lt;/p&gt;
&lt;p&gt;The long-term play writes itself: gradually integrate xAI models as the inference layer inside Cursor. Use Colossus to train models on the coding patterns flowing through the platform. Build a feedback loop where more usage generates better models, better models drive more usage.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is vertical integration applied to AI infrastructure: compute → models → interface, all inside one company.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It’s the same logic that made Apple powerful — own the hardware, the OS, and the app layer — applied to the AI developer stack.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-most-valuable-layer-is-the-interface&quot;&gt;The Most Valuable Layer Is the Interface&lt;/h2&gt;
&lt;p&gt;This is the core insight that makes the deal make sense.&lt;/p&gt;
&lt;p&gt;In technology, the layer that touches users most directly tends to capture the most value over time. Not because it’s the hardest to build, but because it shapes behavior. And behavior shapes everything else.&lt;/p&gt;
&lt;p&gt;Developers follow tools. They learn keyboard shortcuts, build mental models, develop preferences. Over time, the tool doesn’t just serve the workflow, but rather defines it. The tool becomes the lens through which developers understand what’s possible.&lt;/p&gt;
&lt;p&gt;When that tool is also the delivery mechanism for AI models, the stakes compound. Cursor doesn’t just influence how developers write code today. It shapes what kinds of AI capabilities they discover, adopt, and come to depend on. It determines which models feel natural and which feel foreign. It becomes the default.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The company that owns the default developer interface owns the on-ramp to the entire AI stack.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That’s worth $60 billion, maybe more.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;second-order-effects&quot;&gt;Second-Order Effects&lt;/h2&gt;
&lt;p&gt;If this deal closes, or even if the $10B partnership proceeds, several structural shifts will most certainly follow.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IDEs become strategic assets&lt;/strong&gt; — Until recently, development environments were productivity tools. Now they’re territory. Every major AI lab and cloud provider will look at their developer tooling and ask whether they own their on-ramp or rent it from someone else. Expect consolidation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AI labs will move up the stack&lt;/strong&gt; — The lesson of this deal is that model quality alone doesn’t guarantee distribution. Labs that want to avoid becoming commodity inference providers need a product layer. Anthropic has Claude Code. Google has Gemini Code Assist. The race to own the interface is now explicit.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The developer role continues to shift&lt;/strong&gt; — As agentic workflows mature, the skills that matter most change. Developers who thrive will be those who are good at directing AI systems — writing clear specifications, reviewing outputs critically, catching subtle errors. The demand for developers who can only write code mechanically will compress; the demand for developers who can architect and judge will grow.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Vendor lock-in gets embedded deeper&lt;/strong&gt; — When your IDE is also your model provider, switching costs multiply. Changing your AI coding tool no longer means just changing a plugin, but rather involves re-learning workflows, losing context, and migrating integrations. This is good for Cursor’s retention and potentially bad for developer autonomy.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;risks-and-tradeoffs&quot;&gt;Risks and Tradeoffs&lt;/h2&gt;
&lt;p&gt;This deal also introduces real concerns worth naming.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Model bias&lt;/strong&gt; — If Cursor defaults to xAI’s Grok, developers using the tool will have their defaults set by a company with its own interests. The model that autocompletes your code, drafts your documentation, and reviews your pull requests is not neutral. Whoever controls that model controls a subtle but pervasive influence over developer output.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Centralization of critical infrastructure&lt;/strong&gt; — Software development is already highly concentrated around a few tools and platforms. A world where a single company controls the compute, the models, and the primary developer interface is one with very little redundancy. That’s a systemic fragility, not just a competitive concern.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lock-in at the workflow level&lt;/strong&gt; — As developers build habits around Cursor’s agentic features, the switching cost grows. This is rational from a business perspective. But it means the developer community becomes increasingly dependent on the decisions of one company: its pricing, its model choices, its policy on what the tool can and cannot do.&lt;/p&gt;
&lt;p&gt;These aren’t reasons to dismiss the deal. They’re reasons to watch it carefully.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Software development is in the middle of a structural transition. The question is no longer just “how do we write code faster?” It’s “who owns the infrastructure through which intelligence is directed?”&lt;/p&gt;
&lt;p&gt;SpaceX’s bet on Cursor is an answer to that question, with a price sticker towards $60 billion. Getting there as one of the first companies to do so is worth even more, especially for a company that is going to go public very soon!&lt;/p&gt;
&lt;p&gt;The shift underway is real: developers are moving from writing code to directing intelligence, and the interface where that direction happens is not a peripheral concern, but rather the central strategic asset of today’s AI era.&lt;/p&gt;
&lt;p&gt;The companies that understand this are &lt;strong&gt;moving fast&lt;/strong&gt;, &lt;strong&gt;building fast&lt;/strong&gt;, and &lt;strong&gt;shipping fast&lt;/strong&gt;. The ones that don’t will find themselves building excellent models that reach developers only through someone else’s tool and on someone else’s terms.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The rocket company bought a code editor. That tells you everything about where the leverage is right now in today’s AI era.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;a name=&quot;references&quot;&gt;&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.cnbc.com/2026/04/21/spacex-says-it-can-buy-cursor-later-this-year-for-60-billion-or-pay-10-billion-for-our-work-together.html&quot;&gt;SpaceX says it can buy Cursor later this year for $60 billion or pay $10 billion for ‘our work together’ — CNBC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.cnbc.com/2026/02/03/musk-xai-spacex-biggest-merger-ever.html&quot;&gt;Musk’s xAI, SpaceX combo is the biggest merger of all time, valued at $1.25 trillion — CNBC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://techcrunch.com/2026/02/02/elon-musk-spacex-acquires-xai-data-centers-space-merger/&quot;&gt;Elon Musk’s SpaceX officially acquires Elon Musk’s xAI, with plan to build data centers in space — TechCrunch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.ai-supremacy.com/p/cursors-wild-trajectory-vibe-working-leader-enterprise-ai&quot;&gt;Cursor’s Wild Trajectory to being a Vibe Working Leader — AI Supremacy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://techcrunch.com/2026/04/17/sources-cursor-in-talks-to-raise-2b-at-50b-valuation-as-enterprise-growth-surges/&quot;&gt;Sources: Cursor in talks to raise $2B+ at $50B valuation as enterprise growth surges — TechCrunch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://techcrunch.com/2026/04/21/spacex-is-working-with-cursor-and-has-an-option-to-buy-the-startup-for-60-billion/&quot;&gt;SpaceX is working with Cursor and has an option to buy the startup for $60B — TechCrunch&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr/&gt;
&lt;p&gt;&lt;em&gt;Originally published on &lt;a href=&quot;https://dev.to/anikoni2010/&quot;&gt;DEV&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title>How My Team Forecasted Call Center Traffic and Placed Third at the 2026 Illinois Statistics Datathon</title><link>https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/</guid><description>Our weekend at the 2026 Illinois Statistics Datathon, from kickoff to third place: forecasting Synchrony&apos;s call center traffic for August 2025, and why we leaned the forecast high on purpose</description><pubDate>Wed, 08 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you have ever called your credit card company on a Monday morning, chances are you heard a lot of hold music. Somebody at that company had to guess, days or weeks earlier, how many people would call at 9:30 that morning, and then schedule enough agents to answer them. When the guess is too low, callers wait, and some of them give up and hang up.&lt;/p&gt;
&lt;p&gt;That guess was the challenge at this year’s Illinois Statistics Datathon. My team forecasted every 30 minutes of August 2025 for four of Synchrony’s call center queues, and we placed third out of more than 200 teams.&lt;/p&gt;
&lt;p&gt;Like in any data analysis, most of our takeaways came from the charts we made along the way, so I’ll walk through the weekend in the order we did things, from kickoff to the closing ceremony, along with the tradeoffs we weighed at each step. &lt;strong&gt;The idea that tied it all together was simple: being short-staffed costs more than being over-staffed, so our forecast leaned high on purpose.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-illinois-statistics-datathon&quot;&gt;The Illinois Statistics Datathon&lt;/h2&gt;
&lt;p&gt;The &lt;a href=&quot;https://stat.illinois.edu/datathon&quot;&gt;Illinois Statistics Datathon&lt;/a&gt; is an annual 36-hour data competition run by the University of Illinois Department of Statistics. This year it was sponsored by &lt;a href=&quot;https://www.synchrony.com/&quot;&gt;Synchrony&lt;/a&gt;, &lt;strong&gt;Databricks&lt;/strong&gt;, and &lt;strong&gt;Amazon Web Services&lt;/strong&gt; (AWS). Synchrony is a well-respected Fortune 500 consumer financial services company that provides store credit cards. As the primary sponsor, they also supplied the data we worked with, which came from their own call centers.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Number&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Students&lt;/td&gt;
&lt;td&gt;nearly 600&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Teams&lt;/td&gt;
&lt;td&gt;more than 200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hours&lt;/td&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rows each team had to predict&lt;/td&gt;
&lt;td&gt;1,488&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Our team&lt;/td&gt;
&lt;td&gt;Team 030, Databricks Aficionados&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Our result&lt;/td&gt;
&lt;td&gt;3rd place&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.1:&lt;/strong&gt; The 2026 Illinois Statistics Datathon at a glance&lt;/p&gt;
&lt;p&gt;I worked with Noemia Mahmud, a junior in Brain and Cognitive Science, and Victoria Nguyen, a senior in Information Sciences. I met both of them through &lt;strong&gt;Agentic AI @ UIUC&lt;/strong&gt;, the student organization where I spent most of my time that semester, playing a vital role in helping more than 200 students build AI agents that solve real business problems. &lt;strong&gt;So when the datathon came around, forming a team was easy.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Teams were judged on a recorded presentation as well as the forecast itself.&lt;/p&gt;
&lt;h2 id=&quot;kickoff-what-synchrony-asked-for&quot;&gt;Kickoff: what Synchrony asked for&lt;/h2&gt;
&lt;p&gt;We first saw the challenge at kickoff. Synchrony handles about 4 million calls a month across the four clients in our data, and it asked every team to fill in a 1,488-row spreadsheet: &lt;strong&gt;for every 30-minute slot of August 2025, forecast how many calls each client would get, how long each call would take, and how many callers would hang up,&lt;/strong&gt; then use those forecasts to make better staffing decisions.&lt;/p&gt;
&lt;p&gt;That last part is why the forecast has to be so detailed. A call center can’t hire people in the middle of a busy hour, so &lt;strong&gt;it has to decide ahead of time how many agents to schedule for every half hour of the day.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The two kinds of mistakes don’t cost the same, either. When a forecast is too high, a few agents sit idle. When it is too low, callers wait longer, more of them hang up, and the company misses its service targets. &lt;strong&gt;The datathon’s scoring copied that: it penalized predicting too few calls more than predicting too many.&lt;/strong&gt; That one rule ended up shaping almost every decision we made over the next 36 hours.&lt;/p&gt;
&lt;h2 id=&quot;cleaning-the-data&quot;&gt;Cleaning the data&lt;/h2&gt;
&lt;p&gt;The first thing we did was open the data. Synchrony gave every team one Excel file of their call center data, covering four &lt;strong&gt;portfolios&lt;/strong&gt;, which are groups of customers handled by the same queue. They were named A through D, with no details about which products they served. The file had a daily sheet and a 30-minute sheet for each portfolio, plus one staffing sheet, and &lt;strong&gt;Table 1.2&lt;/strong&gt; breaks down what each kind of sheet held and how many rows it had.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data&lt;/th&gt;
&lt;th&gt;What it holds&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Daily&lt;/td&gt;
&lt;td&gt;Call volume, care time, and abandon rate per day, January 2024 to December 2025&lt;/td&gt;
&lt;td&gt;701 to 731 rows per portfolio&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Interval&lt;/td&gt;
&lt;td&gt;The same measures in 30-minute slots, 48 per day, April to June 2025&lt;/td&gt;
&lt;td&gt;3,911 to 4,313 rows per portfolio&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Staffing&lt;/td&gt;
&lt;td&gt;Agents scheduled per day for each portfolio, all of 2025&lt;/td&gt;
&lt;td&gt;365 rows&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.2:&lt;/strong&gt; The three kinds of data in the challenge file and how many rows each had&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The daily sheets went back two years, but the 30-minute sheets only covered three months.&lt;/strong&gt; That gap shaped our models later: anything that predicted a whole day could learn from 2024 and 2025, while anything that looked inside a day had only 90 days to work with.&lt;/p&gt;
&lt;p&gt;Every forecast had three measures. &lt;strong&gt;Call volume (CV)&lt;/strong&gt; is the number of calls that come in. &lt;strong&gt;Customer care time (CCT)&lt;/strong&gt; is the average number of seconds an agent spends on a call. &lt;strong&gt;Abandon rate (ABD)&lt;/strong&gt; is the share of callers who hang up before anyone answers.&lt;/p&gt;
&lt;p&gt;Our first notebook loaded every sheet and cleaned it. &lt;strong&gt;We dropped rows with an abandon rate of 100% or more, capped care time at 1,000 seconds, and filled in care times of zero from the neighboring days,&lt;/strong&gt; since a call can’t take zero seconds. We also clipped any negative values to zero, so nothing downstream could predict a negative number of calls.&lt;/p&gt;
&lt;p&gt;August 2025 was inside the daily data’s date range, but it was held out for scoring. &lt;strong&gt;The daily data also had gaps:&lt;/strong&gt; Portfolio A was missing 30 days, B was missing 25, C was missing 10, and D was missing none. &lt;strong&gt;Figure 1.1&lt;/strong&gt; shows every day each portfolio has data for, with the gaps in light gray and August in red.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/data-coverage.png&quot; alt=&quot;A timeline from January 2024 to December 2025 with one bar per portfolio. Light gray gaps break the bars for A, B, and C, D has none, and a red band marks August 2025 as the month to predict&quot; width=&quot;2084&quot; height=&quot;590&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.1:&lt;/strong&gt; Daily data coverage for each portfolio from January 2024 to December 2025, with missing days in light gray and August 2025, the month to predict, in red&lt;/p&gt;
&lt;p&gt;The four portfolios are also very different in size, as &lt;strong&gt;Table 1.3&lt;/strong&gt; shows with each one’s daily averages.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Portfolio&lt;/th&gt;
&lt;th&gt;Average calls per day&lt;/th&gt;
&lt;th&gt;Average care time&lt;/th&gt;
&lt;th&gt;Average abandon rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;4,143&lt;/td&gt;
&lt;td&gt;313.6 seconds&lt;/td&gt;
&lt;td&gt;1.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;9,058&lt;/td&gt;
&lt;td&gt;332.8 seconds&lt;/td&gt;
&lt;td&gt;1.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;19,592&lt;/td&gt;
&lt;td&gt;339.2 seconds&lt;/td&gt;
&lt;td&gt;1.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;10,357&lt;/td&gt;
&lt;td&gt;319.3 seconds&lt;/td&gt;
&lt;td&gt;1.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.3:&lt;/strong&gt; Average daily call volume, care time, and abandon rate for each portfolio, January 2024 to December 2025 without August 2025&lt;/p&gt;
&lt;p&gt;Portfolio C gets about 19,600 calls on an average day, almost five times Portfolio A’s 4,100. &lt;strong&gt;Call volume is where the portfolios differ most:&lt;/strong&gt; care time stays between about 314 and 339 seconds and the abandon rate between 1.1% and 1.7% for all four, so a model has to handle very different call counts, but the calls themselves behave much the same.&lt;/p&gt;
&lt;h2 id=&quot;exploring-the-shape-of-a-day&quot;&gt;Exploring the shape of a day&lt;/h2&gt;
&lt;p&gt;With clean data, our second notebook was for &lt;strong&gt;exploratory data analysis (EDA)&lt;/strong&gt;: plotting call volume (CV), customer care time (CCT), and abandon rate (ABD) across each day and week to find their patterns before modeling anything. Two charts from it ended up deciding how we built everything else. Despite those size differences, &lt;strong&gt;the shape of the day is almost the same for all four portfolios.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In &lt;strong&gt;Figure 1.2&lt;/strong&gt;, calls are close to zero between 1 and 5 AM Eastern, ramp up through the morning, and stay high from the 9 to 11 AM peak into the afternoon before tapering off at night.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/intraday-shape.png&quot; alt=&quot;Four line charts, one per portfolio, of mean call volume per 30-minute slot from April to June 2025. Each curve is near zero from 1 to 5 AM, shaded in purple, rises from about 6 AM, and peaks around the 9 to 11 AM band shaded in yellow&quot; width=&quot;2084&quot; height=&quot;1221&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.2:&lt;/strong&gt; Average call volume in each 30-minute slot for each portfolio, April to June 2025, with the overnight dead zone and the 9 to 11 AM peak shaded&lt;/p&gt;
&lt;p&gt;The week has a shape too. &lt;strong&gt;Monday is the busiest day for every portfolio and Sunday is the quietest,&lt;/strong&gt; as shown in &lt;strong&gt;Figure 1.3&lt;/strong&gt;. How big that swing is depends on the portfolio: Portfolio A drops from about 5,200 calls on an average Monday to about 1,400 on a Sunday, while Portfolio C still gets close to 10,000 calls on a Sunday.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/day-of-week.png&quot; alt=&quot;Grouped bar chart of mean daily call volume by day of the week for the four portfolios. Monday is highest for each portfolio, the weekdays decline slightly, and Saturday and Sunday are much lower&quot; width=&quot;1785&quot; height=&quot;734&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.3:&lt;/strong&gt; Average daily call volume for each day of the week and each portfolio&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;These two shapes gave us our plan:&lt;/strong&gt; if the shape of a day barely changed, we could forecast how many calls each day would get and then split that total across the day’s 48 slots.&lt;/p&gt;
&lt;h2 id=&quot;building-the-features&quot;&gt;Building the features&lt;/h2&gt;
&lt;p&gt;Before modeling, we built the inputs each model would use, shown in &lt;strong&gt;Figure 1.4&lt;/strong&gt;. &lt;strong&gt;The time features say where a slot falls in the day and the week:&lt;/strong&gt; the slot index from 0 to 47, the day of the week, and a weekend flag. &lt;strong&gt;The calendar features mark US holidays in 2024 and 2025 and the days right before and after them.&lt;/strong&gt; Instead of feeding the portfolio in as one more feature, we trained a completely separate set of models for each portfolio, 16 models in all.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/features.png&quot; alt=&quot;Seven colored boxes in a row: Slot Index (0 to 47), Day of Week (one-hot, 7 dims), and Weekend Flag in blue as temporal features, US Holiday and Near Holiday in orange as calendar features, Month in green for seasonality, and Portfolio ID in purple for a separate model per portfolio&quot; width=&quot;1635&quot; height=&quot;584&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.4:&lt;/strong&gt; The features we built, grouped into temporal, calendar and holiday, seasonality, and portfolio features&lt;/p&gt;
&lt;p&gt;We added the near-holiday flag because, in financial services, people often call the day before a holiday, ahead of billing deadlines, so the days around a holiday can look different from the holiday itself. The weekend, holiday, and near-holiday flags went into the daily model, and the day of the week went into the intraday model.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Separate models per portfolio was a real tradeoff:&lt;/strong&gt; each portfolio’s scale and habits get captured without compromise, which matters when Portfolio C gets five times the calls of Portfolio A, but no model can borrow patterns from the others. A small, noisy portfolio like A would benefit most from that sharing, which is why it shows up again in our future work.&lt;/p&gt;
&lt;h2 id=&quot;designing-the-model&quot;&gt;Designing the model&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Our forecast had two stages: one model predicted each day’s total, and a second split that total across the 48 slots of the day.&lt;/strong&gt; Multiplying the two gives a forecast for every slot, as shown in &lt;strong&gt;Figure 1.5&lt;/strong&gt;. &lt;strong&gt;Splitting “how much today” from “when during the day” let each stage do one job well,&lt;/strong&gt; instead of asking one model to learn the daily level and the 48-slot shape at the same time.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/architecture.png&quot; alt=&quot;Pipeline diagram. Historical daily data goes into SARIMAX, which produces daily totals. Three months of interval data go into a PyTorch IntradayNet, which produces slot weights. Daily totals and slot weights are multiplied to produce the 30-minute forecast CSV&quot; width=&quot;1935&quot; height=&quot;734&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.5:&lt;/strong&gt; Our forecasting pipeline: SARIMAX predicts daily totals, the intraday stage predicts slot weights, and multiplying them gives the 30-minute forecast&lt;/p&gt;
&lt;h3 id=&quot;stage-1-daily-totals-with-sarimax&quot;&gt;Stage 1: daily totals with SARIMAX&lt;/h3&gt;
&lt;p&gt;For the daily totals we used SARIMAX, a classic statistics model for time series. &lt;strong&gt;It predicts each day from the days just before it, from the same day one week earlier, and from outside information we hand it,&lt;/strong&gt; which the model calls exogenous variables; ours were the weekend, holiday, and near-holiday flags. Our settings were SARIMAX(1,1,1)(1,1,1,7), where the 7 is the length of the weekly cycle. &lt;strong&gt;We fit one model per portfolio for each of the three measures, so 12 in all,&lt;/strong&gt; and each one produced 31 daily forecasts for August. We picked SARIMAX because we had two full years of daily history with a strong weekly rhythm, which is exactly what it models, and its calendar flags let us tell it about holidays directly.&lt;/p&gt;
&lt;h3 id=&quot;stage-2-the-shape-of-the-day&quot;&gt;Stage 2: the shape of the day&lt;/h3&gt;
&lt;p&gt;For the shape of the day we trained a small neural network in &lt;strong&gt;PyTorch&lt;/strong&gt;, shown in &lt;strong&gt;Listing 1.1&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt; IntradayNet&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;nn&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#EED49F;--shiki-latte:#DF8E1D;--shiki-frappe:#E5C890;--shiki-mocha:#F9E2AF&quot;&gt;Module&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;    def&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt; __init__&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#C6A0F6;--shiki-latte:#8839EF;--shiki-frappe:#CA9EE6;--shiki-mocha:#CBA6F7&quot;&gt;        super&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color:#91D7E3;--shiki-latte:#04A5E5;--shiki-frappe:#99D1DB;--shiki-mocha:#89DCEB&quot;&gt;__init__&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#ED8796;--shiki-latte:#D20F39;--shiki-frappe:#E78284;--shiki-mocha:#F38BA8&quot;&gt;        self&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;net &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; nn&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;Sequential&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;            nn&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;Linear&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;7&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 64&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;            nn&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;ReLU&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;            nn&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;Linear&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;64&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 48&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;            nn&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt;Softmax&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#EE99A0;--shiki-latte:#E64553;--shiki-frappe:#EA999C;--shiki-mocha:#EBA0AC&quot;&gt;dim&lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=-&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;        )&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-2 text-center&quot;&gt;&lt;strong&gt;Listing 1.1:&lt;/strong&gt; &lt;code&gt;IntradayNet&lt;/code&gt; takes the day of the week as seven numbers and returns 48 slot weights that add up to 1&lt;/p&gt;
&lt;p&gt;The input is the day of the week as a &lt;strong&gt;one-hot vector&lt;/strong&gt;, seven numbers where the current day is 1 and the rest are 0. The last layer is a softmax, which turns 48 numbers into 48 positive weights that add up to 1, so &lt;strong&gt;each weight is the share of that day’s calls that falls in one 30-minute slot.&lt;/strong&gt; We trained one network per portfolio on the 90 days of interval data, for 300 epochs with the Adam optimizer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We kept the network small on purpose.&lt;/strong&gt; Sequence models like an LSTM or a Temporal Fusion Transformer can learn from the order of recent days, but 90 days of interval data isn’t enough to train one well, so a simple feed-forward network was the safer choice.&lt;/p&gt;
&lt;p&gt;We did the same for care time and abandon rate at first, but those two measures barely move from day to day, and they did better with simple averages than with a neural network: &lt;strong&gt;for those two measures, each slot’s forecast was the average for that weekday and slot from April to June.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&quot;checking-it-against-a-baseline&quot;&gt;Checking it against a baseline&lt;/h2&gt;
&lt;p&gt;A forecast only means something next to a &lt;strong&gt;baseline&lt;/strong&gt;, a simple reference point it should beat. Ours was the most obvious forecast there is: for each weekday, the average call volume in each 30-minute slot from April to June. It captures the typical week, but it treats every Monday the same, so it can’t tell when one Monday will be busier than another. Our two-stage model was built to fix that, because SARIMAX predicts whether a particular day will run above or below average. &lt;strong&gt;To test the model, we trained it on the months of April and May and checked it against June,&lt;/strong&gt; as shown for one week of Portfolio C in &lt;strong&gt;Figure 1.6&lt;/strong&gt;.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/baseline-vs-model.png&quot; alt=&quot;Line chart of Portfolio C call volume for June 2 to 8, 2025, in 30-minute slots. The actual and baseline lines nearly overlap and drop close to zero every night. The model line is smoother, stays around 250 calls overnight and peaks lower than the actual calls&quot; width=&quot;2082&quot; height=&quot;581&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.6:&lt;/strong&gt; Actual calls, the weekday-average baseline, and our model for Portfolio C, June 2 to 8, 2025&lt;/p&gt;
&lt;p&gt;We measured the error with &lt;strong&gt;MAPE&lt;/strong&gt;, the mean absolute percentage error: the gap between forecast and actual calls in each slot, divided by the actual calls, averaged over every slot in June. &lt;strong&gt;Figure 1.7&lt;/strong&gt; shows the result for each portfolio. The baseline’s error ranged from 20.0% on Portfolio C to 264.5% on Portfolio D, while the model’s ranged from 749.8% to 957.6%, and the check returned no score for the model on Portfolio C.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/mape-comparison.png&quot; alt=&quot;Bar chart of June 2025 MAPE by portfolio. Baseline: A 218.9%, B 104.5%, C 20.0%, D 264.5%. Model: A 767.5%, B 957.6%, D 749.8%, with no model bar for C&quot; width=&quot;1484&quot; height=&quot;732&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.7:&lt;/strong&gt; MAPE of the baseline and the model on the June 2025 holdout for each portfolio&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Both forecasts had huge MAPE values, and most of that came from the overnight slots.&lt;/strong&gt; A slot with 10 actual calls and a forecast of 30 already has a 200% error, so the 1 to 5 AM dead zone from &lt;strong&gt;Figure 1.2&lt;/strong&gt; can swamp the hours that matter. That’s why we told the judges our real target was the composite penalty score, not MAPE.&lt;/p&gt;
&lt;p&gt;Still, the baseline scored better on every portfolio we could score, and &lt;strong&gt;Figure 1.6&lt;/strong&gt; shows why. &lt;strong&gt;The network’s curve was too smooth:&lt;/strong&gt; it predicted about 250 calls a slot overnight when the real number was close to 10, and it peaked well below the actual calls on busy weekdays. For the submission, we gave the network’s weights no say (&lt;code&gt;alpha=0.0&lt;/code&gt; in our blend), so &lt;strong&gt;every slot weight we submitted came from the weekday averages,&lt;/strong&gt; multiplied by the SARIMAX daily totals.&lt;/p&gt;
&lt;h2 id=&quot;deciding-which-way-to-be-wrong&quot;&gt;Deciding which way to be wrong&lt;/h2&gt;
&lt;p&gt;With the pipeline in place, we came back to the scoring rule from kickoff. The organizers scored submissions with a composite score: error terms for the forecasts, which they called EV, EC, and EB, plus a &lt;strong&gt;penalty workload&lt;/strong&gt; that weighed understaffing more heavily than overstaffing. The penalty worked out to α × understaffing + β × overstaffing, with α larger than β.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So we pushed every call volume forecast up by 7% on purpose,&lt;/strong&gt; with one line, shown in &lt;strong&gt;Listing 1.2&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes catppuccin-macchiato catppuccin-latte catppuccin-frappe catppuccin-mocha&quot; style=&quot;background-color:#24273a;--shiki-latte-bg:#eff1f5;--shiki-frappe-bg:#303446;--shiki-mocha-bg:#1e1e2e;color:#cad3f5;--shiki-latte:#4c4f69;--shiki-frappe:#c6d0f5;--shiki-mocha:#cdd6f4;overflow-x:auto&quot; tabindex=&quot;0&quot; data-language=&quot;python&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;cv_slots &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color:#8AADF4;--shiki-latte:#1E66F5;--shiki-frappe:#8CAAEE;--shiki-mocha:#89B4FA&quot;&gt; apply_bias&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt;daily_cv &lt;/span&gt;&lt;span style=&quot;color:#8BD5CA;--shiki-latte:#179299;--shiki-frappe:#81C8BE;--shiki-mocha:#94E2D5&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color:#CAD3F5;--shiki-latte:#4C4F69;--shiki-frappe:#C6D0F5;--shiki-mocha:#CDD6F4&quot;&gt; blended&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color:#F5A97F;--shiki-latte:#FE640B;--shiki-frappe:#EF9F76;--shiki-mocha:#FAB387&quot;&gt; 1.07&lt;/span&gt;&lt;span style=&quot;color:#939AB7;--shiki-latte:#7C7F93;--shiki-frappe:#949CBB;--shiki-mocha:#9399B2&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-2 text-center&quot;&gt;&lt;strong&gt;Listing 1.2:&lt;/strong&gt; &lt;code&gt;apply_bias&lt;/code&gt; multiplies each day’s call volume, split across its slots, by 1.07&lt;/p&gt;
&lt;p&gt;Because α is larger than β, a forecast that is 10% too low costs more than one that is 10% too high. Leaning high means fewer slots where the forecast falls short of the actual calls, which is the expensive mistake, in exchange for more slots where it runs over, which is the cheap one. &lt;strong&gt;We applied the bias to call volume only, because staffing depends on how many calls arrive;&lt;/strong&gt; care time and abandon rate kept their averages.&lt;/p&gt;
&lt;h2 id=&quot;making-the-august-forecast&quot;&gt;Making the August forecast&lt;/h2&gt;
&lt;p&gt;Our third notebook put it all together and wrote the submission. It was a CSV with 1,488 rows, 31 days times 48 slots, and 19 columns covering the three measures for all four portfolios. Before submitting, our notebook checked that every value was non-negative and every abandon rate was between 0 and 1.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Portfolio&lt;/th&gt;
&lt;th&gt;Forecast calls per day&lt;/th&gt;
&lt;th&gt;Forecast care time&lt;/th&gt;
&lt;th&gt;Forecast abandon rate&lt;/th&gt;
&lt;th&gt;Forecast calls in August&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;3,878&lt;/td&gt;
&lt;td&gt;312.4 seconds&lt;/td&gt;
&lt;td&gt;2.12%&lt;/td&gt;
&lt;td&gt;120,214&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;8,639&lt;/td&gt;
&lt;td&gt;319.7 seconds&lt;/td&gt;
&lt;td&gt;1.68%&lt;/td&gt;
&lt;td&gt;267,805&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;19,875&lt;/td&gt;
&lt;td&gt;323.0 seconds&lt;/td&gt;
&lt;td&gt;0.89%&lt;/td&gt;
&lt;td&gt;616,113&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;10,382&lt;/td&gt;
&lt;td&gt;311.7 seconds&lt;/td&gt;
&lt;td&gt;1.37%&lt;/td&gt;
&lt;td&gt;321,837&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.4:&lt;/strong&gt; Our August 2025 forecast for each portfolio: average calls per day, average care time and abandon rate across slots, and total calls for the month&lt;/p&gt;
&lt;p&gt;Our forecast kept the size gap from &lt;strong&gt;Table 1.3&lt;/strong&gt;: Portfolio C comes out at about 616,000 calls for the month, more than five times Portfolio A’s 120,000.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Figure 1.8&lt;/strong&gt; shows the forecast day by day. Call volume dips every weekend, care time stays within a narrow band for each portfolio, and the abandon rate stays low, mostly between 0.5% and 3%.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/august-forecast.png&quot; alt=&quot;Three stacked line charts for August 2025 with one line per portfolio: daily call volume with a repeating weekly pattern, mean care time between about 300 and 330 seconds, and mean abandon rate between about 0.005 and 0.03&quot; width=&quot;2080&quot; height=&quot;1673&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.8:&lt;/strong&gt; Our August 2025 forecast for every portfolio: daily call volume, mean care time, and mean abandon rate&lt;/p&gt;
&lt;p&gt;Zooming into a single day, &lt;strong&gt;Figure 1.9&lt;/strong&gt; shows the 30-minute forecast for Monday, August 4. &lt;strong&gt;Each portfolio gets the same shape from Figure 1.2, a morning ramp, a midday peak, and a quiet night, at its own scale.&lt;/strong&gt;&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/intraday-preview.png&quot; alt=&quot;Four area charts, one per portfolio, of forecast call volume per 30-minute slot on Monday, August 4, 2025. Each is near zero overnight, rises from about 6 AM and peaks between late morning and mid afternoon&quot; width=&quot;2084&quot; height=&quot;1039&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.9:&lt;/strong&gt; Our 30-minute call volume forecast for each portfolio on Monday, August 4, 2025&lt;/p&gt;
&lt;h2 id=&quot;turning-the-forecast-into-a-staffing-check&quot;&gt;Turning the forecast into a staffing check&lt;/h2&gt;
&lt;p&gt;To make the forecast useful to a scheduler, &lt;strong&gt;we compared it with the staffing data Synchrony gave us.&lt;/strong&gt; We turned each day’s scheduled agents into the number of calls they could handle: agents × 85% utilization × an 8-hour shift ÷ the average care time. The 85% is an assumption, since agents spend part of every shift off the phone, and it keeps the math simple enough for a scheduler to check. &lt;strong&gt;Figure 1.10&lt;/strong&gt; puts that capacity next to our forecast, and any bar above the dashed line is a day when the forecast calls go over it.&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/staffing-impact.png&quot; alt=&quot;Four bar charts, one per portfolio, of forecast daily calls in August 2025 with a dashed red line for staffing capacity. Bars above the line are days at risk of understaffing, and in Portfolios B and D most bars are above it&quot; width=&quot;2080&quot; height=&quot;1384&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.10:&lt;/strong&gt; Forecast daily call volume against staffing capacity for each portfolio in August 2025, where any bar above the dashed line is a day at risk of understaffing&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In Portfolios B and D, the forecast runs above the capacity line on most days of the month,&lt;/strong&gt; so they’re where a scheduler would add agents first. &lt;strong&gt;That turns the CSV into an early warning:&lt;/strong&gt; a scheduler can see which August days are likely to run short and add agents before they do.&lt;/p&gt;
&lt;h2 id=&quot;recording-our-presentation&quot;&gt;Recording our presentation&lt;/h2&gt;
&lt;p&gt;Once the forecast was in, we recorded the video the judges would watch, walking through the same charts in this post. It opened with this line:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We built a model that knows which direction to be wrong.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;the-tradeoffs-at-a-glance&quot;&gt;The tradeoffs at a glance&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Every choice in our forecast gave something up,&lt;/strong&gt; and &lt;strong&gt;Table 1.5&lt;/strong&gt; puts them side by side.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Decision&lt;/th&gt;
&lt;th&gt;What we chose&lt;/th&gt;
&lt;th&gt;What we gave up&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Which way to be wrong&lt;/td&gt;
&lt;td&gt;A 7% upward bias on call volume&lt;/td&gt;
&lt;td&gt;More slots with idle agents&lt;/td&gt;
&lt;td&gt;Understaffing costs more than overstaffing (α &amp;gt; β)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Portfolios&lt;/td&gt;
&lt;td&gt;Separate models for each one&lt;/td&gt;
&lt;td&gt;No sharing of patterns between portfolios&lt;/td&gt;
&lt;td&gt;Portfolio C gets five times the calls of Portfolio A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model structure&lt;/td&gt;
&lt;td&gt;Two stages: daily total, then the shape of the day&lt;/td&gt;
&lt;td&gt;Two models to fit and combine&lt;/td&gt;
&lt;td&gt;Each stage does one job&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Daily model&lt;/td&gt;
&lt;td&gt;SARIMAX with a weekly cycle and calendar flags&lt;/td&gt;
&lt;td&gt;Only patterns that repeat week to week&lt;/td&gt;
&lt;td&gt;Two years of daily history with a strong weekly rhythm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Intraday model&lt;/td&gt;
&lt;td&gt;A small feed-forward network&lt;/td&gt;
&lt;td&gt;No memory of the order of recent days&lt;/td&gt;
&lt;td&gt;90 days is too short for an LSTM or transformer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Care time and abandon rate&lt;/td&gt;
&lt;td&gt;Slot averages&lt;/td&gt;
&lt;td&gt;No day-specific adjustment&lt;/td&gt;
&lt;td&gt;These measures barely change from day to day&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What to optimize&lt;/td&gt;
&lt;td&gt;The composite penalty score&lt;/td&gt;
&lt;td&gt;A worse-looking MAPE&lt;/td&gt;
&lt;td&gt;MAPE blows up on near-zero overnight slots&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Staffing capacity&lt;/td&gt;
&lt;td&gt;85% agent utilization&lt;/td&gt;
&lt;td&gt;Real breaks and shift schedules&lt;/td&gt;
&lt;td&gt;A simple number a scheduler can check&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Table 1.5:&lt;/strong&gt; Each major decision in our forecast, what we chose, what it cost us, and why we made it&lt;/p&gt;
&lt;h3 id=&quot;what-wed-do-with-more-time&quot;&gt;What we’d do with more time&lt;/h3&gt;
&lt;p&gt;With more time and more data, we’d try four things next:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sequence models:&lt;/strong&gt; an LSTM or a Temporal Fusion Transformer, which learn from long sequences, once there is more than three months of interval history. Our 90 days weren’t enough for them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Outside signals:&lt;/strong&gt; billing cycle dates, promotions, and marketing campaigns cause call spikes that the call history alone can’t predict.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Learning across portfolios:&lt;/strong&gt; the four portfolios share infrastructure, so their volumes move together, and Portfolio A, with 30 missing days and the noisiest data, would benefit most.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automatic retraining:&lt;/strong&gt; compare the forecast with actual calls every day, retrain every week, and tune the 7% bias against the penalty scores that actually come in.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;results-day&quot;&gt;Results day&lt;/h2&gt;
&lt;p&gt;The winners were announced at the closing ceremony. After all our hard work, we ended up placing &lt;strong&gt;third&lt;/strong&gt; out of more than &lt;strong&gt;200 teams&lt;/strong&gt;, which came with a Google Home for each of us!&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/podium.png&quot; alt=&quot;The closing ceremony&apos;s prizes slide: Team225 in 1st place with a Nintendo Switch, Team015 in 2nd with Apple AirPods, and Team030 in 3rd with a Google Home, circled in red with the note that&apos;s us&quot; width=&quot;1092&quot; height=&quot;614&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.11:&lt;/strong&gt; The prizes slide from the closing ceremony, with our team circled&lt;/p&gt;
&lt;h2 id=&quot;presenting-at-the-data-science-education-workshop&quot;&gt;Presenting at the Data Science Education Workshop&lt;/h2&gt;
&lt;p&gt;After our third-place finish, the Department of Statistics at the University of Illinois Urbana-Champaign invited our team to present our work at the &lt;strong&gt;Data Science Education Workshop&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The workshop is run by the university’s Data Science Education Council and covers hands-on learning and research across data science. Students present projects they’ve worked on, instructors talk through how to run projects like the datathon well, and people working in the industry share how data scientists tackle real problems at their companies.&lt;/p&gt;
&lt;p&gt;In this workshop, I presented our datathon project on behalf of the team (see &lt;strong&gt;Figure 1.12&lt;/strong&gt;), walking through what we did, including how we explored the data, why we split the forecast into a daily total and the shape of the day, and why we leaned our call volume forecast 7% high.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It was an incredibly rewarding moment to share how we used data science and machine learning to solve the kind of real-world business problems the teams at Synchrony face every day.&lt;/strong&gt;&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/workshop.jpg&quot; alt=&quot;Anirudh at a podium presenting the feature engineering slide from the team&apos;s datathon presentation, with an audience member seated in the foreground&quot; width=&quot;480&quot; height=&quot;640&quot; class=&quot;mx-auto block&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.12:&lt;/strong&gt; Me (&lt;a href=&quot;https://www.linkedin.com/in/anirudh-konidala&quot;&gt;Anirudh Konidala&lt;/a&gt;) presenting our work from the 2026 Illinois Statistics Datathon at the Data Science Education Workshop&lt;/p&gt;
&lt;h2 id=&quot;what-im-taking-away&quot;&gt;What I’m taking away&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Plot the data before modeling it:&lt;/strong&gt; &lt;strong&gt;Figure 1.2&lt;/strong&gt; and &lt;strong&gt;Figure 1.3&lt;/strong&gt; gave us our whole plan, and they took a few lines of pandas.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Build the baseline first:&lt;/strong&gt; a weekday average is hard to beat with three months of data, and every model after it has to beat it on held-out data before it goes in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ask what a mistake costs before choosing a metric:&lt;/strong&gt; the 7% bias came straight from the scoring rule, and tuning it properly is worth more time than we gave it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;watch-our-presentation-and-read-the-code&quot;&gt;Watch our presentation and read the code&lt;/h2&gt;
&lt;p&gt;You can watch our presentation video below, along with the slides we submitted.&lt;/p&gt;
&lt;div class=&quot;aspect-video w-full mt-4 mb-6&quot;&gt;&lt;iframe src=&quot;https://mediaspace.illinois.edu/embed/secure/iframe/entryId/1_dmkfx20x/uiConfId/55779922&quot; title=&quot;Team 030 Databricks Aficionados presentation video&quot; class=&quot;w-full h-full rounded-lg border border-border-subtle&quot; allow=&quot;autoplay *; fullscreen *; encrypted-media *&quot; allowfullscreen loading=&quot;lazy&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.13:&lt;/strong&gt; Our presentation video for the 2026 Illinois Statistics Datathon (&lt;a href=&quot;https://mediaspace.illinois.edu/media/t/1_dmkfx20x&quot;&gt;watch on MediaSpace&lt;/a&gt;)&lt;/p&gt;
&lt;div class=&quot;aspect-[16/10] w-full mt-4 mb-6&quot;&gt;&lt;iframe src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/slides.pdf#view=FitH&quot; title=&quot;Team 030 Databricks Aficionados presentation slides&quot; class=&quot;w-full h-full rounded-lg border border-border-subtle bg-nvim-bg-hard&quot; loading=&quot;lazy&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.14:&lt;/strong&gt; The slides from our presentation (&lt;a href=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/slides.pdf&quot;&gt;open the PDF&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;All of our notebooks and code, plus the forecast CSV we submitted, are available on GitHub:&lt;/p&gt;
&lt;a href=&quot;https://github.com/kidskoding/uiuc-datathon-2026&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; class=&quot;glow-card flex items-start gap-3 p-4 mb-6 no-underline!&quot;&gt;&lt;svg viewBox=&quot;0 0 24 24&quot; aria-hidden=&quot;true&quot; class=&quot;w-6 h-6 shrink-0 mt-0.5 text-nvim-fg&quot;&gt;&lt;path fill=&quot;currentColor&quot; d=&quot;M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;span class=&quot;flex flex-col gap-1 min-w-0&quot;&gt;&lt;span class=&quot;text-sm font-semibold text-nvim-blue&quot;&gt;kidskoding/uiuc-datathon-2026&lt;/span&gt;&lt;span class=&quot;text-sm text-text-secondary&quot;&gt;Our notebooks, code, figures, and the August forecast we submitted to the datathon&lt;/span&gt;&lt;span class=&quot;flex items-center gap-1.5 text-xs text-text-muted&quot;&gt;&lt;span class=&quot;w-2.5 h-2.5 rounded-full&quot; style=&quot;background-color:#DA5B0B&quot;&gt;&lt;/span&gt;Jupyter Notebook&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;
&lt;h2 id=&quot;thank-you&quot;&gt;Thank you&lt;/h2&gt;
&lt;p&gt;With a very successful weekend, there were a lot of people who made this possible!&lt;/p&gt;
&lt;p&gt;A massive thank you to my teammates, &lt;a href=&quot;https://www.linkedin.com/in/noemia-mahmud&quot;&gt;Noemia Mahmud&lt;/a&gt; and &lt;a href=&quot;https://www.linkedin.com/in/victoriawng&quot;&gt;Victoria Nguyen&lt;/a&gt;. Thirty-six hours is a long time to spend with call center data, and I couldn’t have asked for better people to spend it with.&lt;/p&gt;
&lt;p&gt;Thank you to Synchrony for organizing a wonderful datathon experience and giving us real call center data to work with, including &lt;a href=&quot;https://www.linkedin.com/in/sidharthachakravarty&quot;&gt;Sid Chakravarty&lt;/a&gt;, &lt;a href=&quot;https://www.linkedin.com/in/karin-dor-markovich-37496365/&quot;&gt;Karin Dor Markovich&lt;/a&gt;, and the rest of Synchrony’s leadership team who evaluated our submissions and judged our presentations.&lt;/p&gt;
&lt;p&gt;Thank you as well to &lt;a href=&quot;https://www.linkedin.com/in/ehollowed/&quot;&gt;Elise Hollowed&lt;/a&gt; and the Databricks University Alliance for sponsoring the event and supporting student teams like ours. &lt;strong&gt;Databricks also sent us home with some great swag, including a branded lululemon backpack, an Owala water bottle, and a tote bag, as a congrats for placing in the top 3!&lt;/strong&gt;&lt;/p&gt;
&lt;img src=&quot;https://anirudh-konidala.vercel.app/blog/uiuc-datathon-2026/databricks-swag.jpg&quot; alt=&quot;A Databricks tote bag, a white Databricks water bottle, and a black Databricks backpack laid out on a table&quot; width=&quot;480&quot; height=&quot;640&quot; class=&quot;mx-auto block&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot;/&gt;
&lt;p class=&quot;text-sm text-nvim-gray -mt-4 text-center&quot;&gt;&lt;strong&gt;Figure 1.15:&lt;/strong&gt; The Databricks swag we took home for placing in the top 3&lt;/p&gt;
&lt;p&gt;Finally, thank you to the Department of Statistics for running the datathon, and an additional thank you to &lt;a href=&quot;https://www.linkedin.com/in/adthompson81&quot;&gt;Aaron Thompson&lt;/a&gt; and &lt;a href=&quot;https://www.linkedin.com/in/douglas-simpson-65407124&quot;&gt;Douglas Simpson&lt;/a&gt; for inviting us to present our work at the Data Science Education Workshop!&lt;/p&gt;</content:encoded></item><item><title>OpenClaw + NemoClaw: How GTC 2026 is already the most important week in Agentic AI</title><link>https://anirudh-konidala.vercel.app/blog/nvidia-gtc-2026/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/nvidia-gtc-2026/</guid><description>How NVIDIA&apos;s GTC 2026 announcements, from OpenClaw to NemoClaw to Vera Rubin, are building the complete stack for the age of Agentic AI</description><pubDate>Tue, 17 Mar 2026 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;The age of Agentic AI is no longer coming: it’s here. And NVIDIA just built the entire stack for it&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That’s what &lt;strong&gt;NVIDIA&lt;/strong&gt;’s CEO, &lt;strong&gt;Jensen Huang&lt;/strong&gt;, said while walking into the &lt;strong&gt;SAP&lt;/strong&gt; center during NVIDIA’s 2026 GTC conference in San Jose in front of &lt;strong&gt;thousands of engineers&lt;/strong&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;gtc-2026-wasnt-just-a-product-event-it-was-a-declaration&quot;&gt;GTC 2026 wasn’t just a product event: it was a declaration&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;NVIDIA’s GPU Technology Conference&lt;/strong&gt; (GTC) is the techbro and AI world mere equivalent of the State of the Union address. &lt;strong&gt;450+&lt;/strong&gt; sponsors, &lt;strong&gt;1,000&lt;/strong&gt; sessions, &lt;strong&gt;2,000&lt;/strong&gt; speakers, and a CEO who has surprisingly been right about where AI and computing, in general, is going&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;NVIDIA’s GTC 2026 runs all the way through &lt;strong&gt;March 19th&lt;/strong&gt;, with more sessions and announcements still to come, but there is already so much information that I am eager to talk about how it is changing the agentic AI landscape!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;During this year’s GTC, Huang summarizes that&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;the token is the new line of compute&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In this era, the new benchmark that matters is &lt;strong&gt;tokens per second&lt;/strong&gt; and &lt;strong&gt;tokens per dollar&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That one statement tells you &lt;strong&gt;everything&lt;/strong&gt;. It confirms that NVIDIA isn’t just selling GPUs anymore. They are slowly building the economy  of intelligent machines. And during this year’s GTC, they proved exactly how agentic AI fits into that vision at every single layer of the stack&lt;/p&gt;
&lt;p&gt;Here’s how GTC 2026 reshapes the agentic AI landscape and why builders need to be paying close attention&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-unprecedented-signal-of-demand&quot;&gt;The Unprecedented Signal of Demand&lt;/h2&gt;
&lt;p&gt;Huang opens up the conference with what seems like an exaggeration, albeit true: &lt;strong&gt;over the last few years, computing demand has increased by 1 million times&lt;/strong&gt;. This was with all due respect towards and the plethora of AI-native companies: &lt;strong&gt;OpenAI&lt;/strong&gt;, &lt;strong&gt;Anthropic&lt;/strong&gt;, and hundreds and hundreds of AI startups that have altogether pulled in &lt;strong&gt;$150 billion&lt;/strong&gt; in venture capital (VC) last year alone&lt;/p&gt;
&lt;p&gt;Obviously, AI-native companies need GPU computing, specifically from NVIDIA: the unanimous leader in the GPU market. Therefore, Huang states that GPU demand is “off the charts”&lt;/p&gt;
&lt;p&gt;NVIDIA now projects at least &lt;strong&gt;$1 trillion&lt;/strong&gt; in revenue from 2025 to 2027, where one analyst considers NVIDIA as the &lt;strong&gt;king of compute inference&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is a &lt;strong&gt;signal&lt;/strong&gt;: one where the infrastructure layout and buildup for agentic AI is being measured in &lt;strong&gt;trillions&lt;/strong&gt; and the companies building on top of this stack are still very early&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;openclaw--nemoclaw-the-agentic-os-the-industry-has-been-waiting-for&quot;&gt;OpenClaw + NemoClaw: the Agentic OS the industry has been waiting for&lt;/h2&gt;
&lt;p&gt;The recent success of OpenClaw drew many developers. It was so successful Huang considered it as &lt;strong&gt;“the most popular open source project in the history of humanity”&lt;/strong&gt;. Sounds extreme, but when you have a deeper understanding of what it does, it makes sense&lt;/p&gt;
&lt;p&gt;OpenClaw made computers’ operating systems &lt;strong&gt;fully agentic&lt;/strong&gt;. It cancan execute OS tasks via LLMs. It can send emails and Slack messages, host Microsoft Teams meetings, and complete workflows autonomously&lt;/p&gt;
&lt;p&gt;Shipping an agent isn’t the hardest part. &lt;strong&gt;The trust boundary is&lt;/strong&gt;. An agent should be taking real-world actions in a production environment: calling APIs, processing payments, reading internal docs, and interacting with external services. However, AI agents need precise control over what they can do, when, and for whom&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Without a real guardrail layer and security, they become autonomous systems with no seatbelts&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Every builder working on production agents is reinventing some version of that security layer, but NVIDIA’s &lt;strong&gt;NemoClaw&lt;/strong&gt; completely blew this aspect away&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NemoClaw&lt;/strong&gt; is NVIDIA’s enterprise stack built directly on top of OpenClaw. It is OpenClaw with a policy engine, a firewall, and audit trails baked directly into an OS’s execution layer. Three pillars:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Policy Enforcement&lt;/strong&gt;: You define what your agent can do and NemoClaw enforces it at runtime. Not at the prompt level, but deep in the execution layer of the operating system where it actually matters&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Network Guardrails&lt;/strong&gt;: Controlled exits/terminations for sensitive workloads. Agents can’t exfiltrate data outside their scoped access. For any enterprise deployment where agents touch internal systems, this is a “safety hazard” for a production system&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Privacy Routing&lt;/strong&gt;: Proprietary data doesn’t leak to third-party model providers. For companies running agents over internal knowledge bases, financial records, or customer data, this is what makes legal and compliance actually sign off&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Huang states that NemoClaw will be the &lt;strong&gt;“policy engine of all the SaaS companies in the world”&lt;/strong&gt;. And every enterprise sitting on valuable data that wants to deploy agents needs exactly this&lt;/p&gt;
&lt;h3 id=&quot;nvidia-openshell-runtime&quot;&gt;NVIDIA OpenShell Runtime&lt;/h3&gt;
&lt;p&gt;NVIDIA also announced the &lt;strong&gt;OpenShell runtime&lt;/strong&gt; during this year’s GTC. It is the execution environment that sits between your agent’s decision-making and the infrastructure it runs on. OpenShell is what makes NemoClaw’s policies enforceable at scale, along with the composable glue layer for deploying agents consistently across teams, services, and infrastructure boundaries&lt;/p&gt;
&lt;p&gt;Previously, developers would have to&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Pick a framework&lt;/li&gt;
&lt;li&gt;Build their own authentication layer&lt;/li&gt;
&lt;li&gt;Hand-roll policy enforcement&lt;/li&gt;
&lt;li&gt;Wire up their own observability&lt;/li&gt;
&lt;li&gt;Ship something possibly fragile&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now, with &lt;strong&gt;OpenClaw&lt;/strong&gt;, &lt;strong&gt;NemoClaw&lt;/strong&gt;, and &lt;strong&gt;OpenShell&lt;/strong&gt;, developers can&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Define their agent’s tools and context&lt;/li&gt;
&lt;li&gt;Configure policy in NemoClaw&lt;/li&gt;
&lt;li&gt;Deploy via OpenShell&lt;/li&gt;
&lt;li&gt;Focus entirely on the intelligence layer&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now enterprises can safely trust agents with this new agent tech stack, unlocking the next wave of enterprises to use AI Agents&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-nemotron-coalition-an-open-model-for-every-domain&quot;&gt;The Nemotron Coalition: An Open Model for Every Domain&lt;/h2&gt;
&lt;p&gt;NVIDIA isn’t just building a one-and-done model. They are building a &lt;strong&gt;ecosystem&lt;/strong&gt; of open frontier models across every major domain&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model Family&lt;/th&gt;
&lt;th&gt;Domain&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Nemotron&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Language &amp;amp; Reasoning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cosmos&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;World &amp;amp; Vision&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Isaac GR00T&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;General-Purpose Robotics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Alpaymayo&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Autonomous Driving&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;BioNeMo&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Biology &amp;amp; Chemistry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Earth-2&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Weather &amp;amp; Climate&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;They keyword is &lt;strong&gt;open&lt;/strong&gt;. Nemotron’s set of models fine-tune on your domain data, deploy via NVIDIA’s NIM microservices, skip the frontier API costs for tasks where a specialized smaller model wins on both performance and price. Pair this with NemoClaw’s policy layer and this forms a complete, self-contained agentic stack, containing intelligence, guardrails, execution, and deployment&lt;/p&gt;
&lt;h2 id=&quot;nvidia-continues-to-reshape-inference-computing&quot;&gt;NVIDIA continues to reshape inference computing&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Vera Rubin&lt;/strong&gt; is NVIDIA’s new flagship platform: &lt;strong&gt;7 chips&lt;/strong&gt;, &lt;strong&gt;5 rack-scale systems&lt;/strong&gt;, and &lt;strong&gt;one supercomputer&lt;/strong&gt; built specifically for agentic AI workloads. It includes the new Vera CPU and BlueField-4 STX storage architecture. Microsoft Azure is already running Vera Rubin NVL72 systems globally!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Feynman&lt;/strong&gt; is what comes next: a new CPU named Rosa (that is designed to move data, tools, and tokens across agentic infrastructure), the LP40 LPU for inference, BlueField-5 networking, and NVIDIA Kyber for co-packaged optics. This spells out &lt;strong&gt;every pillar of the AI factory&lt;/strong&gt;, including compute, memory, storage, networking, and security. Each pillar just got a generational upgrade by NVIDIA themselves&lt;/p&gt;
&lt;p&gt;NVIDIA also has plans for &lt;strong&gt;space&lt;/strong&gt; with &lt;strong&gt;Space-1 Vera Rubin&lt;/strong&gt;: AI data centers built for orbital deployment. NVIDIA took that as a opportunity to extend accelerated computing beyond the atmosphere entirely!&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;the-next-deployment-surface-for-agents-the-physical-world&quot;&gt;The Next Deployment Surface for Agents: The Physical World&lt;/h2&gt;
&lt;p&gt;Huang simply stated that&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The ChatGPT moment of self-driving cars has arrived&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Major car manufacturers like &lt;strong&gt;Nissan&lt;/strong&gt; and &lt;strong&gt;Hyundai&lt;/strong&gt; have joined NVIDIA’s DRIVE Hyperion robotaxi platform and &lt;strong&gt;Uber&lt;/strong&gt; is deploying these vehicles commercially into its ride-hailing network. &lt;strong&gt;T-Mobile&lt;/strong&gt; is also evolving base stations into edge AI platforms for their physical AI workloads&lt;/p&gt;
&lt;p&gt;Therefore, the next step for AI agents is the physical world: agents that &lt;strong&gt;see&lt;/strong&gt;, &lt;strong&gt;reason&lt;/strong&gt;, and &lt;strong&gt;act&lt;/strong&gt; in real environments&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;nvidia-now-owns-the-entire-agentic-stack&quot;&gt;NVIDIA Now Owns the Entire Agentic Stack&lt;/h2&gt;
&lt;p&gt;NVIDIA announced so much during this year’s GTC conference&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Intelligence layer:&lt;/strong&gt; Nemotron Coalition open models&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agent OS:&lt;/strong&gt; OpenClaw&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Trust + Policy:&lt;/strong&gt; NemoClaw + OpenShell that pairs with OpenClaw&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Inference:&lt;/strong&gt; NIM microservices, and positioning themselves to be the “computing inference king”&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compute:&lt;/strong&gt; Vera Rubin → Feynman → Space&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Physical:&lt;/strong&gt; Cosmos, Isaac GR00T, DRIVE Hyperion&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That’s proves that NVIDIA has deliberately decided to own agentic AI, where every layer is covered and every boundary is addressed&lt;/p&gt;
&lt;p&gt;This is what reshapes agentic AI. Not one announcement, but rather the &lt;strong&gt;whole&lt;/strong&gt;, &lt;strong&gt;complete&lt;/strong&gt; stack at once&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;final-words&quot;&gt;Final Words&lt;/h2&gt;
&lt;p&gt;GTC 2026 wasn’t a series of announcements. It was a map Jensen Huang laid out as to how NVIDIA intends to be the foundation of the age of Agentic AI and intelligent machines&lt;/p&gt;
&lt;p&gt;For those of us building agents right now, &lt;strong&gt;the sky is the limit&lt;/strong&gt;. The tools have never been this good and the platforms have never been this complete&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The only remaining question is how the rest of us are going to make the most of them&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;</content:encoded></item><item><title>The Story of OpenClaw: From 200K+ GitHub Stars to an OpenAI Product</title><link>https://anirudh-konidala.vercel.app/blog/openclaw-openai-product/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/openclaw-openai-product/</guid><description>How Peter Steinberger&apos;s OpenClaw went viral, caught OpenAI&apos;s attention, and what it signals for agentic AI.</description><pubDate>Tue, 17 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Recently, Sam Altman (OpenAI’s CEO) made an announcement on Twitter (X) that Peter Steinberger, the creator of the viral open-source agent, &lt;strong&gt;OpenClaw&lt;/strong&gt; (formerly Clawdbot), will be joining OpenAI&lt;/p&gt;
&lt;div class=&quot;my-6 flex flex-col items-center gap-2 min-h-[400px]&quot;&gt;&lt;blockquote class=&quot;twitter-tweet&quot; data-dnt=&quot;true&quot; data-theme=&quot;dark&quot;&gt;&lt;a href=&quot;https://twitter.com/sama/status/2023150230905159801&quot;&gt;&lt;/a&gt;&lt;/blockquote&gt;&lt;a href=&quot;https://x.com/sama/status/2023150230905159801&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; class=&quot;text-sm text-nvim-blue hover:text-nvim-aqua underline&quot;&gt;View on X&lt;/a&gt;&lt;/div&gt;
&lt;hr/&gt;
&lt;p&gt;The big question for the community though is: &lt;strong&gt;What will happen to OpenClaw?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Fortunately, Altman confirmed that OpenAI won’t kill this internet sensation of an AI agent (see X/Twitter post above). Rather, they will continue to keep it as open source and fully integrate it into the company, where Steinberger will be at the forefront towards accelerating the development of personal AI Agents for the company!&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;why-openclaw&quot;&gt;Why OpenClaw?&lt;/h2&gt;
&lt;p&gt;While many AI agents already existed, they could really only help with &lt;strong&gt;one specific task&lt;/strong&gt; and couldn’t handle the reality of the modern workday for the average adult: checking emails frantically, responding to Slack / Microsoft Teams messages, performing code reviews, and managing calendar invites all at once.&lt;/p&gt;
&lt;p&gt;For example, imagine you are a developer. You might ask a traditional AI agent to summarize emails and it will do exactly that. However, while it’s processing those emails for summarization, your Slack is blowing up with a critical production bug. The agent though is trapped in that one conversation of summarizing your emails. You’d have to wait for the email summary to finish, manually open a new tab, copy the bug report, and then ask the agent to help you debug it&lt;/p&gt;
&lt;p&gt;This meant that users were still stuck halfway, and had to manually bridge and transition between different apps to handle tasks that were needed for a modern workday. acting as the manual bridge between different apps, which often felt like more work than just doing the tasks themselves.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;OpenClaw&lt;/strong&gt; solves this problem by giving you a single agent that works across all your tools simultaneously. It monitors your email, checks your Slack for any new messages, manages and works with your calendar invites, and helps conduct code reviews: all in parallel.&lt;/p&gt;
&lt;p&gt;This makes it easy so that when a production bug hits while you’re in the middle of an email summary, OpenClaw catches it, flags it, and helps you debug it without you ever having to switch tabs or start over.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;another-hint-that-we-are-transitioning-fully-into-ai-agents&quot;&gt;Another hint that we are transitioning fully into AI Agents&lt;/h2&gt;
&lt;p&gt;For the past couple of years, AI was just a chatbot. You ask a question, and a chatbot would give you an answer&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;OpenClaw&lt;/strong&gt; drastically changes that. It marks a shift towards agentic AI and AI agents! While a chatbot like ChatGPT gives you a draft of an email, an AI agent like OpenClaw will actually log in to your Microsoft Outlook account and sends the email!&lt;/p&gt;
&lt;p&gt;It takes &lt;strong&gt;full control&lt;/strong&gt; of your operating system and local files, turning the AI from what was once a research assistant into something that acts as a personal AI agent for your computer!&lt;/p&gt;
&lt;p&gt;Its capabilities were so vast and immediately got many people hooked, and OpenClaw became one of the fastest growing open source projects, with now having over &lt;strong&gt;200K+&lt;/strong&gt; stars on GitHub!&lt;/p&gt;
&lt;p&gt;By bringing Steinberger on board, OpenAI is signaling that the era of the chatbot is over. We are moving from an AI that talks about work, to an AI that finishes it.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;how-anthropic-made-the-greatest-fumble-of-all-time&quot;&gt;How Anthropic made the greatest fumble of all time&lt;/h2&gt;
&lt;p&gt;OpenClaw was previously known as &lt;strong&gt;Clawdbot&lt;/strong&gt;, as a playful tribute and testament towards Anthropic’s LLM &lt;strong&gt;Claude&lt;/strong&gt;. Interestingly enough, Steinberger was so deeply invested into the Claude ecosystem that he made OpenClaw recommend &lt;strong&gt;Claude Opus 4.5&lt;/strong&gt; as the default LLM for its users.&lt;/p&gt;
&lt;p&gt;But instead of seeing what could have been a partner, Anthropic saw it as a competitor, viewing Clawdbot as a trademark threat to their signature LLM: Claude. This prompted them to request Steinberger to change Clawdbot’s name. Therefore, Steinberger ended up frantically changing the name twice from Clawdbot -&amp;gt; Moldbot -&amp;gt; OpenClaw&lt;/p&gt;
&lt;p&gt;While Anthropic was worried about the name, OpenAI saw the true talent and potential with OpenClaw and immediately &lt;strong&gt;extended an offer to Steinberger&lt;/strong&gt;, providing him the opportunity to build personal AI agents for everyone!&lt;/p&gt;
&lt;p&gt;A product that was once a massive driver towards Anthropic API usage now became a product maintained by OpenAI! And what would have became a wonderful opportunity for Anthropic was now directly handed to their competitors at OpenAI!&lt;/p&gt;
&lt;h3 id=&quot;the-lesson-growth-over-competition&quot;&gt;The Lesson: Growth over Competition&lt;/h3&gt;
&lt;p&gt;Instead of viewing new projects as competition, developers and companies should view them through a growth lens.&lt;/p&gt;
&lt;p&gt;The most successful moves that happen in tech aren’t about vanquishing a rival, but rather about amplifying a vision through collaboration and/or acquisition.&lt;/p&gt;
&lt;p&gt;For example, when Facebook acquired Instagram in 2012, they never saw it as a threat to Facebook. Rather, they saw the possibility of having social media in your pocket!&lt;/p&gt;
&lt;p&gt;While many thought this $1 billion acquisition was an overstatement, Zuckerberg realized that Instagram perfectly captured the essence of social media in the mobile era, which Facebook was struggling to capture.&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;what-does-this-mean-for-the-rest-of-us&quot;&gt;What does this mean for the rest of us&lt;/h2&gt;
&lt;p&gt;The success of OpenClaw isn’t just about one developer landing a dream role at OpenAI. &lt;strong&gt;It signals two key learning takeaways we all can walk away with&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;AI is no longer living in your browser tab&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As I mentioned earlier, &lt;strong&gt;we have fully moved away from talking to a chatbot in a browser tab&lt;/strong&gt;. AI is no longer something you go to, but rather is now becoming &lt;strong&gt;embedded directly into your operating system&lt;/strong&gt; by running in your computer’s background as a daemon and acting on your behalf without you having to ask.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;However, I believe the most important takeaway is that&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Opportunities with companies like OpenAI, Meta, and Google don’t always come from clicking “Apply” on LinkedIn or Workday&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Steinberger didn’t get a call from Sam Altman because of a polished resume or the right recruiter. He got it because he built something in public that &lt;strong&gt;200,000&lt;/strong&gt; people found valuable enough to star on GitHub. He shipped obsessively, shared openly on GitHub, and solved a real problem that real people had.&lt;/p&gt;
&lt;p&gt;The application button is one path, but it’s the most crowded one. There are other paths to reach the same destination.&lt;/p&gt;
&lt;p&gt;Steinberger showed that success can come by &lt;strong&gt;building things that speak for themselves&lt;/strong&gt;: &lt;strong&gt;your GitHub&lt;/strong&gt;, your &lt;strong&gt;open source contributions&lt;/strong&gt;, the side project you’ve been putting off because it “isn’t ready yet”&lt;/p&gt;
&lt;p&gt;His story is proof that as AI is shifting from a chatbot to a multi-step agent (from talking about work to actually doing it), the developers who will shape that future aren’t the ones waiting to be hired&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;They’re the ones who are already building publicly&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.forbes.com/sites/ronschmelzer/2026/02/16/openai-hires-openclaw-creator-peter-steinberger-and-sets-up-foundation/&quot;&gt;Forbes – OpenAI hires OpenClaw creator Peter Steinberger and sets up foundation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.reuters.com/business/openclaw-founder-steinberger-joins-openai-open-source-bot-becomes-foundation-2026-02-15/&quot;&gt;Reuters – OpenClaw founder Steinberger joins OpenAI, open-source bot becomes foundation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.cnbc.com/2026/02/15/openclaw-creator-peter-steinberger-joining-openai-altman-says.html&quot;&gt;CNBC – OpenClaw creator Peter Steinberger joining OpenAI, Altman says&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.businessinsider.com/sam-altman-hires-openclaw-creator-peter-steinberger-personal-ai-agents-2026-2&quot;&gt;Business Insider – Sam Altman hires OpenClaw creator Peter Steinberger for personal AI agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://africa.businessinsider.com/news/clawdbot-creator-says-anthropic-was-really-nice-in-renaming-email-but-everything-went/50k0xe8&quot;&gt;Africa Business Insider – Clawdbot creator says Anthropic was really nice in renaming email but everything went&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://x.com/aakashgupta/status/2023249490426388849&quot;&gt;X – Aakash Gupta&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;p&gt;&lt;em&gt;Originally published on &lt;a href=&quot;https://dev.to/anikoni2010/the-story-of-openclaw-from-200k-github-stars-to-an-openai-product-1o06&quot;&gt;DEV&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title>SpaceX just made the largest acquisition in history. Here&apos;s why it matters.</title><link>https://anirudh-konidala.vercel.app/blog/spacex-xai-acquisition/</link><guid isPermaLink="true">https://anirudh-konidala.vercel.app/blog/spacex-xai-acquisition/</guid><description>SpaceX acquired xAI for $250B; what it means for AI infrastructure and the industry.</description><pubDate>Tue, 03 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;The Elon Musk empire has only grown stronger&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;p&gt;Yesterday, &lt;strong&gt;SpaceX&lt;/strong&gt; acquired &lt;strong&gt;xAI&lt;/strong&gt; for &lt;strong&gt;$250 billion&lt;/strong&gt;, making it &lt;strong&gt;the largest acquisition of all time&lt;/strong&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This acquisition will now value SpaceX at a &lt;strong&gt;$1.25 trillion&lt;/strong&gt; dollar company&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It only took xAI &lt;strong&gt;under 3 years&lt;/strong&gt; to reach a $250 billion valuation. In this 3 year span, Musk merged X (formerly Twitter) into xAI, which then built its own LLM Grok on top of it, turning what was once a social platform into a full-on AI and Data engine&lt;/p&gt;
&lt;p&gt;OpenAI took &lt;strong&gt;9 years&lt;/strong&gt; to reach that valuation. Anthropic took &lt;strong&gt;5&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With this acquisition, Musk isn’t just consolidating his empire. He has a vision: &lt;strong&gt;one that is far ahead from the rest of us&lt;/strong&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;blockquote&gt;
&lt;p&gt;That $1.25 trillion is a bet that AI’s real bottleneck isn’t LLMs. It’s the infrastructure and data that it relies on&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;p&gt;xAI loses &lt;strong&gt;$1 billion&lt;/strong&gt; a month competing with major LLM companies like OpenAI, Anthropic, and Google&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Now pair this with the challenging task of terrestrial data centers being unable to scale fast enough without crushing local power grids&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;5&lt;/a&gt;&lt;/sup&gt; &lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;6&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;This is where SpaceX saw an opportunity to solve AI’s energy problem from orbit. &lt;strong&gt;And the first step involved merging xAI with SpaceX&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SpaceX plans to utilize this acquisition to launch &lt;strong&gt;1 million&lt;/strong&gt; satellites and build AI data centers in space using solar power&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;8&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Musk claims that &lt;strong&gt;space-based AI&lt;/strong&gt; will be the cheapest compute option in the next 2-3 years&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;7&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;And the pieces have already been set in stone to prove Musk’s claim. SpaceX launches the satellites, Starlink provides the connectivity, xAI provides the LLM’s, and X provides the data. Each piece that belongs to Musk ends up feeding and satisfying one another.&lt;/p&gt;
&lt;p&gt;Starlink’s 9,000+ satellites in orbit already generate more revenue than SpaceX’s launch business as a whole. With this recent acquisition, that cash flow will offset xAI’s burn rate, while also giving SpaceX another reason to launch a million more satellites&lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;8&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;what-this-means-for-the-current-ai-era&quot;&gt;What this means for the current AI era&lt;/h2&gt;
&lt;p&gt;This acquisition isn’t just another one of Musk’s stories. It signals where the industry is heading&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The AI race is no longer just about who has the best model, but rather who controls the infrastructure&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;OpenAI has &lt;strong&gt;Microsoft&lt;/strong&gt;. &lt;strong&gt;$13 billion&lt;/strong&gt; has already been invested by Microsoft so that Microsoft Azure can power every ChatGPT query&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Amazon&lt;/strong&gt; and &lt;strong&gt;Google&lt;/strong&gt; have funded &lt;strong&gt;billions of dollars&lt;/strong&gt; towards Anthropic, integrating &lt;strong&gt;Claude&lt;/strong&gt; access into Amazon Web Services (AWS) and Google Cloud Platform (GCP)&lt;/li&gt;
&lt;/ul&gt;
&lt;hr/&gt;
&lt;blockquote&gt;
&lt;p&gt;Now, xAI is a part of &lt;strong&gt;SpaceX&lt;/strong&gt; with its own unique plan to build its own infrastructure in space&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr/&gt;
&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;
&lt;a name=&quot;references&quot;&gt;&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.latimes.com/business/story/2026-02-02/musks-spacex-combines-with-xai-at-1-25-trillion-valuation&quot;&gt;SpaceX combines with xAI; its new valuation is at $1.25 trillion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://fastcompany.com/91404783/the-real-ai-bottleneck-isnt-the-model-its-your-infrastructure&quot;&gt;The real AI bottleneck isn’t the model—it’s your infrastructure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.reuters.com/business/musks-spacex-merge-with-xai-combined-valuation-125-trillion-bloomberg-news-2026-02-02/&quot;&gt;SpaceX acquires xAI in record-setting deal as Musk looks to unify AI and space ambitions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.bloomberg.com/news/articles/2025-06-17/musk-s-xai-burning-through-1-billion-a-month-as-costs-pile-up&quot;&gt;Musk’s xAI Burns Through $1 Billion a Month as Costs Pile Up&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.csgtalent.com/insights/blog/data-centres-grid-challenges-ai-infrastructure/&quot;&gt;Data Centre Grid Challenges: Powering AI Infrastructure at Scale&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.deloitte.com/us/en/insights/industry/power-and-utilities/data-center-infrastructure-artificial-intelligence.html&quot;&gt;Can US infrastructure keep up with the AI economy?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.investing.com/news/stock-market-news/musks-spacex-acquires-musks-xai-envisions-spacebased-ai-data-centers-4480302&quot;&gt;Musk’s SpaceX acquires Musk’s xAI, envisions “space-based AI data centers”&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://spacenews.com/starlink-outpaces-launches-spacex-enters-new-era-of-profitability/&quot;&gt;Starlink Outpaces Launches: SpaceX Enters New Era of Profitability&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.scientificamerican.com/article/spacex-plans-to-launch-one-million-satellites-to-power-orbital-ai-data/&quot;&gt;SpaceX plans to launch one million satellites to power orbital AI data center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.cnbc.com/2026/02/02/musks-xai-needs-spacex-for-money-data-centers-in-space-are-a-dream.html&quot;&gt;Musk’s xAI needs SpaceX deal for the money. Data centers in space are still a dream&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr/&gt;
&lt;p&gt;&lt;em&gt;Originally published on &lt;a href=&quot;https://dev.to/anikoni2010/spacex-just-made-the-largest-acquisition-in-history-heres-why-it-matters-4cjo&quot;&gt;DEV&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;</content:encoded></item></channel></rss>