<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>claude-code on S Anand</title>
    <link>https://www.s-anand.net/blog/tag/claude-code/</link>
    <description>Recent content in claude-code on S Anand</description>
    <generator>Hugo -- 0.156.0</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 05 Jul 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://www.s-anand.net/blog/tag/claude-code/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Things I Learned - 05 Jul 2026</title>
      <link>https://www.s-anand.net/blog/things-i-learned-05-jul-2026/</link>
      <pubDate>Sun, 05 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-05-jul-2026/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;⭐ How to teach so people learn better. &lt;!-- https://chatgpt.com/c/6a48d8ac-4450-83ec-9fd9-13e30456215f --&gt;
&lt;ul&gt;
&lt;li&gt;Make them do &amp;gt; Show &amp;gt; Tell. Workshop &amp;gt; Demo &amp;gt; Slides.&lt;/li&gt;
&lt;li&gt;Let them ask, try, struggle, and commit first; explain next; help last. But only when they know enough to get part-way.&lt;/li&gt;
&lt;li&gt;Make problems CONCEPTUALLY hard (not in language, visual, or procedure). But make sure instructions are clear.&lt;/li&gt;
&lt;li&gt;Test their learning with a NEW case, immediately.&lt;/li&gt;
&lt;li&gt;Measure learning. Can they recall it LATER, apply it ELSEWHERE, explain WHY, and know when they may be WRONG?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Vogue runs an &amp;ldquo;In the bag&amp;rdquo; series where people pull stuff out of their bag, and audiences watching feel they KNOW the person. Depending on the setting, we might be able to help people &amp;ldquo;know&amp;rdquo; each other by curating several items. Here are a few ideas. &lt;!-- https://claude.ai/chat/79ccb543-0c14-4519-8427-084203ccace7 --&gt;
&lt;ul&gt;
&lt;li&gt;Physical: Bag, Wallet, Fridge, Drawer, Keychain, Remembered phone numbers&lt;/li&gt;
&lt;li&gt;Mobile: Battery usage by app, Recent emojis, Text prediction for &amp;ldquo;Honestly, I just want to&amp;hellip;&amp;rdquo;, Autocorrect dictionary, Alarm labels / reminders, Saved Wi-Fi, Blocked/muted contacts, Contact favorites, Contact names, e.g. &amp;ldquo;Mom ❤️&amp;rdquo; vs &amp;ldquo;DO NOT PICK UP&amp;rdquo;, Device / Wi-Fi names&lt;/li&gt;
&lt;li&gt;Laptop: Open tabs (count, age), Recurring calendar events, /Downloads, Photos, Email drafts, Subscriptions, Kindle highlights&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ownership and connections come from attachment, which can be created. If you name something, touch something, contribute to something in any way, it becomes yours. When people contribute to someone else&amp;rsquo;s work and discuss it, they build a connection.&lt;/li&gt;
&lt;li&gt;According to both Claude and ChatGPT, if you had to pick one model for ideation / brainstorming, it &lt;em&gt;might&lt;/em&gt; be GPT 5.5. It&amp;rsquo;s better for &lt;strong&gt;divergent&lt;/strong&gt; generation: the broadest, most exhaustive pool of usable ideas. Fable 5 is better for deep creative judgment: reframing, finding structural flaws, recombining ideas.&lt;/li&gt;
&lt;li&gt;Claude Code supports &lt;a href=&#34;https://code.claude.com/docs/en/memory?#organize-rules-with-claude/rules/&#34;&gt;rules&lt;/a&gt; which are &lt;em&gt;exactly&lt;/em&gt; like a CLAUDE.md but support a &lt;code&gt;paths:&lt;/code&gt; YAML metadata - so they&amp;rsquo;ll be read only when Claude Code is reading those paths.&lt;/li&gt;
&lt;li&gt;If you have a SKILL.md that explains how to do something and you &lt;em&gt;only need its outcome&lt;/em&gt;, then move it to a sub-agent (e.g. fake data generation, tool failure logging). Use SKILL.md for instructions that need to be woven into a task, e.g. memorable explanations.&lt;/li&gt;
&lt;li&gt;The key bottlenecks in running an agent &lt;code&gt;/loop&lt;/code&gt; are (a) imagining higher order problems and (b) defining a measure of success / progress.&lt;/li&gt;
&lt;li&gt;Long tail -&amp;gt; sell options. Black swan -&amp;gt; Buy options. That&amp;rsquo;s a roughly accurate summary. The trouble is, we don&amp;rsquo;t always know which tail we&amp;rsquo;re in. So, sell only if you can afford one hit. &lt;!-- https://claude.ai/chat/edd6626f-6863-4a9e-857e-6503e6a619f1 + https://chatgpt.com/c/6a448350-2ae8-83ec-981c-36e6401a98b5 --&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ArchiveBox/ArchiveBox&#34;&gt;ArchiveBox&lt;/a&gt; lets you view pages / RSS feeds offline. &lt;code&gt;uvx --from git+https://github.com/ArchiveBox/ArchiveBox.git@dev archivebox&lt;/code&gt; works, and config / tools are stored in &lt;code&gt;~/.config/abx/&lt;/code&gt;. The installation didn&amp;rsquo;t go very smoothly and the whole thing felt bloated, so I abandoned it.&lt;/li&gt;
&lt;li&gt;I use &lt;a href=&#34;https://github.com/y2z/monolith&#34;&gt;&lt;code&gt;monolith -I -e $URL&lt;/code&gt;&lt;/a&gt; to download a page as an offline single-page HTML. Combined with &lt;a href=&#34;https://gitlab.com/anarcat/feed2exec&#34;&gt;&lt;code&gt;uvx feed2exec&lt;/code&gt;&lt;/a&gt; I can archive RSS feeds for offline reading. That&amp;rsquo;s easier than having to open &lt;a href=&#34;https://feedly.com/&#34;&gt;Feedly&lt;/a&gt; - I just mark read files with a &lt;code&gt;x&lt;/code&gt; at the front and keep reading. The downloads are slow (~3 min/feed) and large (5 GB for 15 feeds, 5MB median feed size) because they embed videos and &lt;em&gt;all&lt;/em&gt; images/files, but I can safely delete what I&amp;rsquo;ve read or will ignore. &lt;a href=&#34;https://chatgpt.com/share/6a447d52-9dbc-83ec-a025-93de680fc083&#34;&gt;ChatGPT&lt;/a&gt; &lt;!-- https://chatgpt.com/c/6a4457bd-48a8-83ec-8a5d-0bcc7c3be582 --&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://role-confusion.github.io/&#34;&gt;Project Injection as Role Confusion&lt;/a&gt; is a &lt;em&gt;very&lt;/em&gt; well written paper (blog-post style) that says the key to tricking LLMs is to confuse them about WHO wrote a line. Just adding a &amp;ldquo;User: &amp;quot; in front of a line makes it more likely that LLMs think it&amp;rsquo;s a user. Even when test is written in the &lt;em&gt;style&lt;/em&gt; of their system instructions, they fall for it - irrespective of where the content came from. This makes &lt;a href=&#34;https://en.wikipedia.org/wiki/Generative_engine_optimization&#34;&gt;GEO&lt;/a&gt; more effective, too. Also, the last section &amp;ldquo;8. Open Ideas for Roles Research&amp;rdquo; is a fantastic read on LLM psychology (or rather, neurology).&lt;/li&gt;
&lt;li&gt;On &lt;a href=&#34;https://bambamramfan.github.io/ai-compass/&#34;&gt;The AI Compass&lt;/a&gt; I am &lt;a href=&#34;https://bambamramfan.github.io/ai-compass/&#34;&gt;The Podcast Bro&lt;/a&gt;. Patron saint: Lex Fridman. &amp;ldquo;You listened to a three-hour interview with an AI researcher and now you have opinions. Strong ones. You&amp;rsquo;re long on compute and short on regulation, and you&amp;rsquo;ve said &amp;rsquo;exponential&amp;rsquo; more times this month than a calculus teacher. Love is the answer, and also AGI.&amp;rdquo; Impact: +5.9. Valence: +4.1.&lt;/li&gt;
&lt;li&gt;Since &lt;a href=&#34;https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-omni-flash-nano-banana-2-lite/&#34;&gt;Nano Banana 2 Lite&lt;/a&gt; isn&amp;rsquo;t as good as Nano Banana 2 and about half the price, I wouldn&amp;rsquo;t switch yet.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.anthropic.com/news/claude-sonnet-5&#34;&gt;Claude Sonnet 5 is out&lt;/a&gt;. &lt;a href=&#34;https://x.com/anthropicai/status/2072106151890809341&#34;&gt;Fable 5 will be released soon&lt;/a&gt;. &lt;a href=&#34;https://x.com/sama/status/2070607488274358364&#34;&gt;GPT 5.6 is still on probation&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Codex has a &lt;a href=&#34;https://developers.openai.com/codex/record-and-replay&#34;&gt;Record and Replay&lt;/a&gt; feature for Mac that lets you do something, records it, and learns from it. Very useful for non-developers. It&amp;rsquo;s like recording Excel macros, which unleashed a lot of power for me when I didn&amp;rsquo;t know Visual Basic.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://claude.com/blog/artifacts-in-claude-code&#34;&gt;Claude Code Artifacts&lt;/a&gt; lets Claude Code live-publish a web page and share it securely. The &amp;ldquo;live-publish&amp;rdquo; part is the interesting thing. Claude in a &lt;code&gt;/loop&lt;/code&gt; can now become the app that updates a &amp;ldquo;dashboard&amp;rdquo;, a live feed/story, a self-evolving app, &amp;hellip; and so much more. (This feature is only available for Team/Enterprise but the idea is universal.)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://twotimespi.dev/&#34;&gt;Tau&lt;/a&gt;, like &lt;a href=&#34;https://pi.dev/&#34;&gt;Pi&lt;/a&gt;, is a minimal coding agent. τ = 2*π. It shows what it does very transparently, making it easy to learn how agents work. &lt;code&gt;uvx --from tau-ai tau&lt;/code&gt; works seamlessly. Configs, logs, and sessions are stored in &lt;code&gt;~/.tau&lt;/code&gt; and you can log in via your Codex/ChatGPT subscription.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/emilkowalski/skills&#34;&gt;Skills for Design Engineers&lt;/a&gt; has a useful &lt;a href=&#34;https://github.com/emilkowalski/skills/blob/main/skills/animation-vocabulary/SKILL.md&#34;&gt;animation vocabulary&lt;/a&gt; skill that converts vague animation prompts to precise animation terminology.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.x.com/tools/mcp&#34;&gt;X has an MCP Server&lt;/a&gt; but it&amp;rsquo;s meant for development/coding than general users. Setting it up for ChatGPT / Claude requires creating tunnels.&lt;/li&gt;
&lt;li&gt;OpenAI supports &lt;a href=&#34;https://developers.openai.com/api/docs/guides/secure-mcp-tunnels&#34;&gt;Secure MCP Tunnels&lt;/a&gt; that let ChatGPT connect to your machine securely. A very powerful feature. Unfortunately, this seems to need an organization - and even though personal accounts can still access it, it&amp;rsquo;s proven a bit more messy than I&amp;rsquo;d like to use.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/teng-lin/notebooklm-py&#34;&gt;notebooklm-py&lt;/a&gt; is a CLI for NotebookLM. Unofficial and potentially unsupported, but it&amp;rsquo;s amazing how AI makes reverse-engineering APIs so easy.&lt;/li&gt;
&lt;li&gt;If you start a &lt;a href=&#34;https://help.openai.com/en/articles/8914046-temporary-chat-faq&#34;&gt;temporary ChatGPT chat&lt;/a&gt; and close it, it still runs in the background - but you have no way of going back to it (not even the back button) or seeing what it said/did. I know this because it was accessing my MCP server even after I navigated away from the chat accidentally.&lt;/li&gt;
&lt;li&gt;The code refactoring industry can go full swing now. &amp;ldquo;As an example of what AI can accomplish, Claude Opus 4.7 substantially reimplemented gotree—a bioinformatics toolkit with about 16,000 lines of Go and 40+ commands. We believe this same task would take a human engineer without AI assistance 2–17 weeks. Opus 4.7 solved it in 14 hours, passing 2,000/2,001 tests (99.95%), at a cost of $251.&amp;rdquo; &lt;a href=&#34;https://epoch.ai/MirrorCode&#34;&gt;MirrorCode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;A useful rule of thumb: Cloudflare tunnels are for links to share with others. Taiscale is for services (even non-HTTP) only your devices should see. &lt;a href=&#34;https://chatgpt.com/share/6a40b186-9654-83ec-8b1d-e8f5614a9a87&#34;&gt;ChatGPT&lt;/a&gt; &lt;!-- https://chatgpt.com/c/6a40aea9-b774-83ec-b382-d922267730b2 --&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;date -d (date +-%wday) +%F&lt;/code&gt; is the most compact way to round down to the nearest Sunday. Avoid &lt;code&gt;date -d &amp;quot;last sunday&amp;quot; +%F&lt;/code&gt; which, on a Sunday, returns the &lt;em&gt;previous&lt;/em&gt; Sunday, not today. &lt;a href=&#34;https://chatgpt.com/share/6a40788f-c904-83ec-8750-6f507e37b9bc&#34;&gt;ChatGPT&lt;/a&gt; &lt;!-- https://chatgpt.com/c/6a407687-43b4-83ec-8307-1935ea28182a --&gt;&lt;/li&gt;
&lt;li&gt;A useful way of controlling AI verbosity is word count. To do that, I need an intuitive sense of how much to ask for. Here&amp;rsquo;s my rule of thumb: one page of paragraph text on ChatGPT is 200-300 words. 150-200 if it&amp;rsquo;s mostly bullets. I can typically read 1-2 pages of output. So, 300-600 words is my limit.&lt;/li&gt;
&lt;li&gt;Google Labs launched a &lt;a href=&#34;https://github.com/google-labs-code/design.md&#34;&gt;DESIGN.md&lt;/a&gt; spec to guide agents on a consistent design. The good part is that it aligns with the proposed &lt;a href=&#34;https://www.designtokens.org/&#34;&gt;W3C design tokens spec&lt;/a&gt;. But beyond that, I&amp;rsquo;m not convinced of the benefit. Atlassian&amp;rsquo;s &lt;a href=&#34;https://atlassian.design/DESIGN.md&#34;&gt;DESIGN.md&lt;/a&gt; had &lt;a href=&#34;https://www.atlassian.com/blog/how-we-build/atlassians-design-md-is-here-what-we-learned-testing-portable-design-context-in-practice&#34;&gt;mixed results&lt;/a&gt;.  &lt;a href=&#34;https://claude.ai/share/2a64a7fe-1939-46b4-af32-e5efdc03fb70&#34;&gt;Claude&lt;/a&gt; feels it could go either way. I&amp;rsquo;ll give this a miss for now.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 07 Jun 2026</title>
      <link>https://www.s-anand.net/blog/things-i-learned-07-jun-2026/</link>
      <pubDate>Sun, 07 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-07-jun-2026/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sudo resolvectl flush-caches&lt;/code&gt; clears the DNS cache on Linux. Useful when you&amp;rsquo;re changing DNS records and want to see the changes immediately. In my case, I was creating a Cloudflare tunnel to my laptop and wanted to test it quickly.&lt;/li&gt;
&lt;li&gt;Making something easy to verify makes it &lt;em&gt;much&lt;/em&gt; faster to train models on it. Arithmetic verification is easy - calculators can be deterministically verified. Chess verification is easy - Stockfish became easy to train. Code verification is easy - LLMs improved coding ability rapidly. Therefore:
&lt;ul&gt;
&lt;li&gt;Wherever we have environments that are easy to verify, AI will improve faster there.&lt;/li&gt;
&lt;li&gt;To make AI improve faster in an area, build environments that are easy to verify.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://blog.modelcontextprotocol.io/posts/2026-07-28-release-candidate/&#34;&gt;MCP is getting simpler&lt;/a&gt;. A stateless HTTP protocol. Simpler OAuth. Plugins. No idea when it will land in Claude or ChatGPT, though. Worth checking after 28 Jun 2026 - after it is finalized.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.microsoft.com/en-us/microsoft-365/blog/2026/06/02/introducing-microsoft-scout-your-always-on-personal-agent/&#34;&gt;Microsoft Scout&lt;/a&gt; is Microsoft&amp;rsquo;s version of OpenClaw or &lt;a href=&#34;https://gemini.google/overview/agent/spark/&#34;&gt;Gemini Spark&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git subtree&lt;/code&gt; is a useful way of maintaining git repos inside git repos. For example, if you have a tool &lt;code&gt;tool-a&lt;/code&gt; under a project. It&amp;rsquo;s more light-weight than sub-modules, lets you commit at any point to the parent &lt;em&gt;or&lt;/em&gt; child, and is a built-in feature in &lt;code&gt;git&lt;/code&gt;. &lt;!-- https://chatgpt.com/c/6a1d25bf-49f4-83ec-8e02-5905a22f4fe0 --&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://blog.google/innovation-and-ai/technology/developers-tools/introducing-gemma-4-12b/&#34;&gt;Gemma 4 12B is released&lt;/a&gt; and seems almost as good as the 26B version. This is the class of models that makes it practical to run edge AI on phones. It&amp;rsquo;s multimodal and reasonably smart (like frontier models were 12-18 months ago).&lt;/li&gt;
&lt;li&gt;I don&amp;rsquo;t use Claude/ChatGPT Projects much. It offers 3 advantages: custom instructions, memory, files, and chats. Files aren&amp;rsquo;t useful - I use my entire laptop as a file system via MCP. Instructions aren&amp;rsquo;t useful - I can paste commonly used prompts with a click. Chats aren&amp;rsquo;t useful - I have chat references enabled, so all past chats are accessible anyway. Memory isn&amp;rsquo;t useful - I have memory enabled globally anyway. In short, I haven&amp;rsquo;t discovered the power of projects that everyone&amp;rsquo;s raving about. SKILL.md is more useful for me. &lt;!-- https://claude.ai/chat/eb3bcf3e-f1f0-4d33-b5a2-14b09cbda189 --&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gerrit.googlesource.com/git-repo/+/HEAD/README.md&#34;&gt;&lt;code&gt;repo&lt;/code&gt;&lt;/a&gt; is a Google/Android tool built on top of &lt;code&gt;git&lt;/code&gt; that lets you manage multiple git repos. It sounded promising until I released it needs a &lt;code&gt;repo init&lt;/code&gt; that creates a &lt;code&gt;.repo/&lt;/code&gt; - which is more overhead that I&amp;rsquo;d like to keep.&lt;/li&gt;
&lt;li&gt;When using &lt;code&gt;&amp;lt;image onerror=...&amp;gt;&lt;/code&gt; fallbacks, include &lt;code&gt;this.oneerror=null&lt;/code&gt; to prevent infinite loops if the fallback image also fails to load. &lt;a href=&#34;http://mvark.blogspot.com/2026/05/how-to-add-backup-image-in-html-when.html&#34;&gt;RK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;One of the advantages of multiple agent (rather than a single agent loop) is: it&amp;rsquo;s easier to change directions when wrong. Single loops get stuck. &lt;a href=&#34;https://www.youtube.com/watch?v=mR-WAvEPRwE&#34;&gt;Build Agents That Run for Hours&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Claude Code also supports &lt;a href=&#34;https://code.claude.com/docs/en/agent-teams&#34;&gt;agent teams&lt;/a&gt; where sub-agents can talk to each other rather than rely on the main agent to coordinate. Useful for parallel exploration. Anthropic lets Claude define &amp;ldquo;organizational policies&amp;rdquo; for agent teams best suited for the task (AI-native workflows). It also lets agents to push back on their scope, e.g. &amp;ldquo;This is too hard.&amp;rdquo; &lt;a href=&#34;https://www.youtube.com/watch?v=mR-WAvEPRwE&#34;&gt;Build Agents That Run for Hours&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Claude Code has a &lt;code&gt;/background [prompt]&lt;/code&gt; (or &lt;code&gt;/bg&lt;/code&gt;) command that runs the current session the background. You can run &lt;code&gt;claude agents&lt;/code&gt; as a separate command to &lt;a href=&#34;https://code.claude.com/docs/en/agent-view&#34;&gt;monitor agents&lt;/a&gt;. (There&amp;rsquo;s no equivalent in Codex yet.) This seems to be the future of agentic operations: a bunch of agents running that you monitor and steer through an agent view dashboard.&lt;/li&gt;
&lt;li&gt;Models are evolving. Therefore prompts evolved. Now harnesses also need to evolve. The workflows will also evolve. As a result, evaluations might be the (relatively) more stable assets. Datasets are likely to be the most stable ground truth.&lt;/li&gt;
&lt;li&gt;How to learn a new field fast:
&lt;ul&gt;
&lt;li&gt;Yes, it&amp;rsquo;s possible to learn 50% of a field in 20 hours. &lt;a href=&#34;https://www.youtube.com/watch?v=5MgBikgcWnY&#34;&gt;Josh Kaufman, &amp;ldquo;The First 20 Hours&amp;rdquo;&lt;/a&gt; popularized it. The next 30% takes months and the last 20% takes years.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Threshold_knowledge&#34;&gt;Threshold concepts&lt;/a&gt; are those that change your perspective and open up new ways of thinking.&lt;/li&gt;
&lt;li&gt;Experts&amp;rsquo; knowledge is hard-wired and they can&amp;rsquo;t identify nor teach threshold concepts naturally. Don&amp;rsquo;t assume they can.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.google.com/search?q=Polanyi+%22we+know+more+than+we+can+tell%22&#34;&gt;&amp;ldquo;We know more than we can tell.&amp;rdquo;&lt;/a&gt; Polanyi&amp;rsquo;s 1966 book &amp;ldquo;The Tacit Dimension&amp;rdquo; says that there&amp;rsquo;s some knowledge that can&amp;rsquo;t be verbalized. This &lt;a href=&#34;https://en.wikipedia.org/wiki/Tacit_knowledge&#34;&gt;tacit knowledge&lt;/a&gt;, therefore, will be harder for humans and AI to learn.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 10 May 2026</title>
      <link>https://www.s-anand.net/blog/things-i-learned-10-may-2026/</link>
      <pubDate>Sun, 10 May 2026 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-10-may-2026/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I&amp;rsquo;m experimenting with &lt;a href=&#34;https://tauonmusicbox.rocks/&#34;&gt;Tauon MusicBox&lt;/a&gt; as an alternative to VLC as a music player. Update: 01 Jun 2026. I switched back to VLC. Tauon Music Box is glitch. It stops songs mid-way and doesn&amp;rsquo;t play automatically when launched.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;xz&lt;/code&gt; is pretty slow by default. &lt;code&gt;xz -T0&lt;/code&gt; uses all available threads and speeds it up ~3X. Enabling &amp;ldquo;Performance mode&amp;rdquo; (over a power-saver mode) produces a further speed-up of ~2X for me. For a 200MB file, that reduces the time from ~1 minute to 10 seconds.&lt;/li&gt;
&lt;li&gt;Notes from &lt;a href=&#34;https://simonwillison.net/2026/May/6/code-w-claude-2026/&#34;&gt;Simon Willison&amp;rsquo;s notes from the Claude Code event&lt;/a&gt;:
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;Design for the next model&amp;rdquo;. Build things that don&amp;rsquo;t quite work today on the assumption that they&amp;rsquo;ll start working with a model upgrade in the future.&lt;/li&gt;
&lt;li&gt;&amp;ldquo;The advisor strategy&amp;rdquo;. Instead of using a smarter model to plan, use smaller models to ask Opus for advice-on-demand.&lt;/li&gt;
&lt;li&gt;Dreaming looks really interesting. You can run a task over night which examines previous sessions and creates new memories.&lt;/li&gt;
&lt;li&gt;A &lt;a href=&#34;https://code.claude.com/docs/en/routines&#34;&gt;routine&lt;/a&gt; is a saved Claude Code configuration: a prompt, one or more repositories, and a set of connectors, packaged once and run automatically. Routines execute on Anthropic-managed cloud infrastructure, so they keep working when your laptop is closed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Overheard: &amp;ldquo;VCs say, &amp;lsquo;OpenAI wants to get into commerce, so why are you getting into commerce?&amp;rsquo; A few weeks later, &amp;lsquo;OpenAI no longer wants to get into commerce, so why are you?&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Delightful discovery of the day: Super + Shift + Arrow keys to move windows between monitors on Ubuntu.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/alexpasmantier/television&#34;&gt;television&lt;/a&gt; is a fast, portable fuzzy finder. Like &lt;code&gt;fzf&lt;/code&gt; but faster, useful for files, text, git repos, docker images, etc.&lt;/li&gt;
&lt;li&gt;I added &lt;code&gt;approvals_reviewer = &amp;quot;auto_review&amp;quot;&lt;/code&gt; to my &lt;code&gt;~/.codex/config.toml&lt;/code&gt;. This enables &lt;a href=&#34;https://alignment.openai.com/auto-review&#34;&gt;auto review&lt;/a&gt; which uses an LLM to figure out whether to ask a human to approve or not. It&amp;rsquo;s a lot less intrusive than asking every time. Not perfectly safe, though.&lt;/li&gt;
&lt;li&gt;Copilot supports a &lt;a href=&#34;https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli/chronicle&#34;&gt;&lt;code&gt;/chronicle&lt;/code&gt;&lt;/a&gt; command that suggest tips and improvements when using Copilot. It&amp;rsquo;s like &lt;code&gt;/insights&lt;/code&gt; on Claude Code and&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/fathyb/carbonyl/releases&#34;&gt;Carbonyl&lt;/a&gt; is a CLI Chromium browser. Sort of like Lynx, but supports audio/video, JavaScript, even WASM, etc. This was the &lt;a href=&#34;https://fathy.fr/carbonyl&#34;&gt;author&amp;rsquo;s first Rust project&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I tried &lt;a href=&#34;https://zed.dev/&#34;&gt;Zed&lt;/a&gt; as an alternative to VS Code. It&amp;rsquo;s fast and lightweight, but lacks the ecosystem of VS Code. Plugins are harder to build and Markdown support is weak. I would use it on a flight to save power, not otherwise. This is similar to others&amp;rsquo; experience. &lt;a href=&#34;https://chatgpt.com/share/69f703b4-409c-83ea-a9fd-0c601de973f3&#34;&gt;ChatGPT&lt;/a&gt; &lt;!-- https://chatgpt.com/c/69f6cf11-f870-83ea-b9bb-e35402db3226 --&gt; UPDATE 05 Jun 2026. It DOES use some battery power - more than I&amp;rsquo;d like. I am uninstalling it.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/localsend/localsend&#34;&gt;LocalSend&lt;/a&gt; is a pretty quick way to share files between phone and laptop even if you don&amp;rsquo;t have a network - if you connect the laptop to the phone hotspot.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://flathub.org/en/apps/org.gnome.NetworkDisplays&#34;&gt;GNOME Network Displays&lt;/a&gt; works pretty well if you want to screencast your screen to a network display - e.g. a Smart TV with Miracast or Chromecast support.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;m evaluating &lt;a href=&#34;https://github.com/rtk-ai/rtk&#34;&gt;rtk&lt;/a&gt; - a CLI proxy to reduce tokens. For example &lt;code&gt;rtk ls&lt;/code&gt; or &lt;code&gt;rtk git status&lt;/code&gt; shows agent-friendly compact output. I just added one like to my AGENTS.md: &amp;ldquo;Always prefix shell commands with &lt;code&gt;rtk&lt;/code&gt;. Examples: &lt;code&gt;rtk git status&lt;/code&gt;, &lt;code&gt;rtk pytest -q&lt;/code&gt;, etc.&amp;rdquo; instead of using &lt;code&gt;rtk init -g&lt;/code&gt;. I am testing it out, so I don&amp;rsquo;t know the impact, but it seems harmless. (Based on 2 days&amp;rsquo; usage, across 216 commands, it saved ~50% of 37K tokens. Not much, but harmless.)&lt;/li&gt;
&lt;li&gt;The emerging convention to mark a section of HTML / Markdown as AI generated content is to wrap it in:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;section ai-disclosure=&amp;quot;ai-generated&amp;quot; data-ai-model=&amp;quot;claude-sonnet-4.6&amp;quot; data-ai-provider=&amp;quot;Anthropic&amp;quot;&amp;gt;&lt;/code&gt; (&lt;a href=&#34;https://www.w3.org/community/ai-content-disclosure/&#34;&gt;W3C AI Content Disclosure Community Group&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 03 May 2026</title>
      <link>https://www.s-anand.net/blog/things-i-learned-03-may-2026/</link>
      <pubDate>Sun, 03 May 2026 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-03-may-2026/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/run-llama/liteparse&#34;&gt;LiteParse&lt;/a&gt; is a PDF to text library that you can run via &lt;code&gt;npx --package=@llamaindex/liteparse lit parse document.pdf&lt;/code&gt;. &lt;a href=&#34;https://simonwillison.net/2026/Apr/23/liteparse-for-the-web/&#34;&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Always add indecisiveness, inaction, &amp;ldquo;other&amp;rdquo;, &amp;ldquo;not applicable&amp;rdquo;, etc. as an option to LLMs. They are trained for decisive responses and pattern matching, so we need to guide the the other way. &lt;a href=&#34;https://martinfowler.com/fragments/2026-04-14.html&#34;&gt;Martin Fowler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;GPT 5.5 is priced &lt;em&gt;twice&lt;/em&gt; that of GPT 5.4. No wonder my Codex usage is much higher than last month. &lt;a href=&#34;https://simonwillison.net/2026/Apr/23/gpt-5-5/#a-few-more-notes-on-gpt-5-5&#34;&gt;Simon Willison&lt;/a&gt;. I am better off sticking to &lt;code&gt;medium&lt;/code&gt; effort instead of the &lt;code&gt;xhigh&lt;/code&gt; I usually use - it may not be required. &lt;a href=&#34;https://developers.openai.com/api/docs/guides/latest-model&#34;&gt;OpenAI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;ldquo;&amp;hellip; the eigenquestion is the question where, if answered, it likely answers the subsequent questions as well.&amp;rdquo; &lt;a href=&#34;https://coda.io/@shishir/eigenquestions-the-art-of-framing-problems/eigenquestions-3&#34;&gt;Shishir Mehrotra &amp;amp; Matt Hudson&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Claude Code stores the logged in OAuth token at &lt;code&gt;~/.claude/.credentials.json&lt;/code&gt;. We can use that to fetch &lt;code&gt;https://api.anthropic.com/api/oauth/usage&lt;/code&gt; and retrieve Claude usage and reset times. &lt;code&gt;uvx ccusage&lt;/code&gt; does this automatically, but I prefer my own script.&lt;/li&gt;
&lt;li&gt;Ontology matters in the AI era. But some stuff matters more, and some less. &lt;!-- https://claude.ai/chat/2f6fdf7e-9d32-4c45-ac8d-603d029aed5b --&gt;
&lt;ul&gt;
&lt;li&gt;🟢 MORE: Definitions: what &amp;ldquo;customer&amp;rdquo; means&lt;/li&gt;
&lt;li&gt;🟢 MORE: Constraints: e.g. &amp;ldquo;don&amp;rsquo;t reclassify loans&amp;rdquo;&lt;/li&gt;
&lt;li&gt;🟢 MORE: Interactions: how to verify, coordinate, delegate, &amp;hellip;&lt;/li&gt;
&lt;li&gt;🔴 LESS: Creating ontologies: agents can do that.&lt;/li&gt;
&lt;li&gt;🔴 LESS: Completeness and rigor: agents tolerate uncertainty.&lt;/li&gt;
&lt;li&gt;🔴 LESS: Proprietary: agents can reverse-engineer.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;There are several industries / markets that MBA case studies rarely cover (&lt;a href=&#34;https://chatgpt.com/share/69efcf7a-6bf0-83ea-86dd-36e115e7540c&#34;&gt;ChatGPT&lt;/a&gt;): Kirana stores; Care (child care, elder care, domestic work); Faith (finance, food, media, education); Remittances; Gambling (lottery, sports betting, gacha); Scams &amp;amp; organized fraud; Counterfeiting; &amp;hellip; &lt;!-- https://chatgpt.com/c/69efa7bb-f918-83ea-9bc5-e3f7231c75da + https://gemini.google.com/app/dc5ac9f4a4f44cf0 --&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 26 Apr 2026</title>
      <link>https://www.s-anand.net/blog/things-i-learned-26-apr-2026/</link>
      <pubDate>Sun, 26 Apr 2026 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-26-apr-2026/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;mdq&lt;/code&gt; is pretty useful to extract Markdown sections. For example &lt;code&gt;cat *.md | mdq &#39;# Title&#39;&lt;/code&gt; extracts all sections where the header contains &amp;lsquo;Title&amp;rsquo; (case-insensitive).&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developers.cloudflare.com/browser-run/&#34;&gt;CloudFlare Browser Run&lt;/a&gt; is, roughly, a browser as a service. &lt;a href=&#34;https://developers.cloudflare.com/browser-run/pricing/&#34;&gt;Pricing&lt;/a&gt;: 10 hours free per month, then 9c per hour. I had Codex run a small &lt;a href=&#34;https://github.com/sanand0/research/tree/main/cloudflare-browser-run&#34;&gt;research&lt;/a&gt; to explore it, and it seems simple to set it up and use it.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://openai.com/index/introducing-gpt-5-5/&#34;&gt;GPT 5.5&lt;/a&gt; seems to be especially better than GPT 5.4 and running for long, with tool calls, without losing focus. That&amp;rsquo;s something OpenAI models are good at anyway, so this takes it a step further. &lt;a href=&#34;https://chatgpt.com/share/69eaccb0-b9e0-8399-be3f-6bd73906d0ec&#34;&gt;ChatGPT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I added &lt;a href=&#34;https://developers.openai.com/api/docs/models/gpt-image-2&#34;&gt;gpt-image-2&lt;/a&gt; to my &lt;a href=&#34;https://sanand0.github.io/llmartstyle/&#34;&gt;LLM Art Style gallery&lt;/a&gt;. It is notably better with text accuracy. For example, on &lt;a href=&#34;https://sanand0.github.io/llmartstyle/?category=text&#34;&gt;Rock - Paper - Scissors - Lizard - Spock&lt;/a&gt; it consistently lists all 10 rules, which Nano Banana 2 does not.&lt;/li&gt;
&lt;li&gt;World leaders do keep us entertained. &lt;!-- https://gemini.google.com/app/240186d320b283d8 --&gt;
&lt;ul&gt;
&lt;li&gt;Saparmurat Niyazov (Turkmenistan) renamed the months of the year and days of the week after himself and his mother. He built a towering, gold-plated statue of himself in the capital that rotated so it would always face the sun. He also banned lip-syncing at concerts, outlawed gold teeth, and banished dogs from the capital because he found their smell unappealing.&lt;/li&gt;
&lt;li&gt;Idi Amin (Uganda) declared himself the &amp;ldquo;Uncrowned King of Scotland&amp;rdquo; and sent baffling, unsolicited telegrams to world leaders - advising Richard Nixon to recover from Watergate, or offering food aid to a struggling Britain.&lt;/li&gt;
&lt;li&gt;François &amp;ldquo;Papa Doc&amp;rdquo; Duvalier (Haiti) reportedly ordered all black dogs in Haiti to be put to death and claimed his personal Vodou curse was responsible for the assassination of John F. Kennedy.&lt;/li&gt;
&lt;li&gt;Francisco Macías Nguema (Equatorial Guinea) banned the word &amp;ldquo;intellectual&amp;rdquo;, banned the use of lubricants in the power plant (claiming his magic would keep it running, which promptly broke the generators), and stored the nation&amp;rsquo;s remaining foreign currency under his bed.&lt;/li&gt;
&lt;li&gt;Kim Jong-il (North Korea) claimed he invented the hamburger (calling it &amp;ldquo;double bread with meat&amp;rdquo;) and shot 11 holes-in-one his first time playing golf.&lt;/li&gt;
&lt;li&gt;Donald Trump (United States) used late-night tweets to announce major policy shifts and fire his own cabinet members. He altered an official government hurricane map with a Sharpie to match a previous erroneous statement, and publicly mused during a press briefing about the injection of household disinfectants as a medical treatment.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Git repositories inside git repositories (without using sub-modules) don&amp;rsquo;t seem to work well. I need this because I have mono-repos for research and I want to use git in a sub-folder to iterate, then commit just the final version to the parent folder. Looks like I need to remove the child &lt;code&gt;.git/&lt;/code&gt; (e.g. rename to &lt;code&gt;.git.bak/&lt;/code&gt;, which I&amp;rsquo;ve added to my &lt;code&gt;~/.config/git/ignore&lt;/code&gt;) for this to work. &lt;a href=&#34;https://gemini.google.com/share/1a89ad8cf6da&#34;&gt;Gemini&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;To run a script in the background (without logs) and detach / disown it, use &lt;code&gt;nohup your-script &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp; disown&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Running &lt;code&gt;/insights&lt;/code&gt; on Claude Code helped me add these two instructions to my &lt;a href=&#34;https://github.com/sanand0/scripts/blob/main/agents/code/SKILL.md&#34;&gt;code skill&lt;/a&gt;:
&lt;ul&gt;
&lt;li&gt;Test web pages with screenshots (for layout, overlaps, contrast) AND CDP (for interactions, navigation) before finalizing&lt;/li&gt;
&lt;li&gt;Prefer icon libraries over unicode/emoji icons.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Sending an entire PDF/PPTX to Gemini costs ~40% of sending PDF/PPTX + images. The quality is fine for small files, but for large files adding images reduces error rate from ~5% to 0.5%.&lt;/li&gt;
&lt;li&gt;Pandoc Markdown to Word DOCX supports sidebar comments. You can use this Markdown: Here is &lt;code&gt;[comment in sidebar]{.comment-start id=&amp;quot;c1&amp;quot; author=&amp;quot;Anand&amp;quot; date=&amp;quot;2026-01-01T12:00:00Z&amp;quot;}commented text[]{.comment-end id=&amp;quot;c1&amp;quot;} inline.&lt;/code&gt; &lt;a href=&#34;https://gemini.google.com/share/430e7556ad69&#34;&gt;Gemini&lt;/a&gt;. In fact, Pandoc supports lots of other things, like: &lt;!-- https://gemini.google.com/app/0fe9e7b12650f7f2 --&gt;
&lt;ul&gt;
&lt;li&gt;Custom styles via block &lt;code&gt;::: {custom-style=&amp;quot;Custom Style Name&amp;quot;}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Track changes via &lt;code&gt;[inserted text]{.insertion author=&amp;quot;Name&amp;quot; date=&amp;quot;2026-04-20T12:00:00Z&amp;quot;}&lt;/code&gt; and &lt;code&gt;[deleted text]{.deletion author=&amp;quot;Name&amp;quot;}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Page breaks via &lt;code&gt;\newpage&lt;/code&gt; (a LaTeX command that Pandoc supports in Markdown)&lt;/li&gt;
&lt;li&gt;CSS styles via &lt;code&gt;![Alt Text](image.png){width=&amp;quot;5.5in&amp;quot; height=&amp;quot;3in&amp;quot;}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://offpunk.net/&#34;&gt;Offpunk&lt;/a&gt; is a CLI offline-first browser. Interesting idea, but installation is a problem.
After &lt;code&gt;sudo apt uninstall offpunk&lt;/code&gt; running &lt;code&gt;offpunk&lt;/code&gt; failed with &lt;code&gt;ImportError: lxml.html.clean module is now a separate project lxml_html_clean.&lt;/code&gt;
After a &lt;code&gt;git clone&lt;/code&gt; it reported &lt;code&gt;HTML document detected. Please install python-bs4 and python-readability&lt;/code&gt;.
These are easy to fix, but I wasn&amp;rsquo;t inclined.&lt;/li&gt;
&lt;li&gt;Creating an authenticated &lt;a href=&#34;https://developers.openai.com/api/docs/mcp&#34;&gt;MCP Server for ChatGPT&lt;/a&gt; is complex. It requires OpenID Connect (for which library support is weak and requires a provider like Auth0), dynamic client registration (which is hard to implement though Auth0 supports it), and after half a day of experiments, I still couldn&amp;rsquo;t connect. An easier option is to run temporary tunnels with &lt;code&gt;cloudflared&lt;/code&gt; or &lt;code&gt;ngrok&lt;/code&gt; or &lt;code&gt;localtunnel&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 08 Mar 2026</title>
      <link>https://www.s-anand.net/blog/things-i-learned-08-mar-2026/</link>
      <pubDate>Sun, 08 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-08-mar-2026/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IITM has launched a &lt;a href=&#34;https://study.iitm.ac.in/mg/&#34;&gt;4 year degree in management &amp;amp; data science&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&amp;ldquo;Use AI to replace early-career mentorship: use AI-driven synthetic practice when traditional apprenticeship pathways collapse. AI can generate personalized coaching, replacing the missing junior loop with training environments.&amp;rdquo; &lt;a href=&#34;https://jack-clark.net/about/&#34;&gt;Jack Clark&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Observability is more than logging. It&amp;rsquo;s agents watching feeds and signalling insights!&lt;/li&gt;
&lt;li&gt;The &lt;a href=&#34;https://developers.openai.com/api/docs/guides/prompt-guidance&#34;&gt;GPT 5.4 prompt guidance&lt;/a&gt; is a bit complex, but here&amp;rsquo;s what it&amp;rsquo;s broadly saying: (&lt;a href=&#34;https://gemini.google.com/share/b359f1e5fb50&#34;&gt;Gemini&lt;/a&gt;)
&lt;ul&gt;
&lt;li&gt;It&amp;rsquo;ll over-complicate answers and front-end design unless you tell it exactly how you want it&lt;/li&gt;
&lt;li&gt;It&amp;rsquo;ll keep checking with you or give up (e.g. on errors) unless you tell it otherwise, e.g. with checklists or rules&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Claude Code supports &lt;a href=&#34;https://code.claude.com/docs/en/settings&#34;&gt;32K output tokens&lt;/a&gt; by default. Since I generate large data stories, I usually hit this limit and lose an entire session. Setting the environment variable &lt;code&gt;CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000&lt;/code&gt; (which is the maximum) reduces this problem.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/googleworkspace/cli&#34;&gt;Google Workspace CLI&lt;/a&gt; lets you run &lt;code&gt;npx -y @googleworkspace/cli&lt;/code&gt; as a single unified service for all Google Workspace APIs. It follows &lt;a href=&#34;https://justin.poehnelt.com/posts/rewrite-your-cli-for-ai-agents/&#34;&gt;agent-friendly CLI practices&lt;/a&gt; which I turned into a &lt;a href=&#34;https://github.com/sanand0/scripts/blob/live/agents/agent-friendly-cli/SKILL.md&#34;&gt;SKILL.md&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;ve been using &lt;code&gt;mise use -g ubi:owner/repo&lt;/code&gt; to install GitHub packages. The &lt;a href=&#34;https://mise.jdx.dev/dev-tools/backends/ubi.html&#34;&gt;&lt;code&gt;ubi&lt;/code&gt; backend&lt;/a&gt; is now &lt;a href=&#34;https://github.com/jdx/mise/discussions/7727&#34;&gt;deprecated&lt;/a&gt; in favor of the new &lt;a href=&#34;https://mise.jdx.dev/dev-tools/backends/github.html&#34;&gt;&lt;code&gt;github&lt;/code&gt; backend&lt;/a&gt;. This works fine for most repos, with edge cases like &lt;a href=&#34;https://github.com/jtroo/kanata/&#34;&gt;jtroo/kanata&lt;/a&gt; which still require &lt;code&gt;ubi:jtroo/kanata&lt;/code&gt; as of now.&lt;/li&gt;
&lt;li&gt;On the margin, I&amp;rsquo;ll likely switch to &lt;a href=&#34;https://github.com/casey/just&#34;&gt;&lt;code&gt;just&lt;/code&gt;&lt;/a&gt; as my task runner. &lt;a href=&#34;https://claude.ai/share/9ec242a3-e0e8-4d82-b80b-fa8bac036ed4&#34;&gt;Claude&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;With AI now writing almost all of my code, I don&amp;rsquo;t see much need to format it. Code formatters like &lt;code&gt;ruff&lt;/code&gt;, &lt;code&gt;dprint&lt;/code&gt;, &lt;code&gt;biome&lt;/code&gt;, etc. are not relevant when AI will be reading and writing the code, not humans. I just format the prompts in Markdown.&lt;/li&gt;
&lt;li&gt;Salt is the duct tape of food ingredients. Lemon juice, vinegar, butter/oil, onion/garlic, etc. are runners-up. &lt;a href=&#34;https://claude.ai/share/8a783928-e726-439c-8415-3bc673ff4645&#34;&gt;Claude&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Claude&amp;rsquo;s &lt;a href=&#34;https://claude.com/import-memory&#34;&gt;prompt to import memory&lt;/a&gt; from other AI providers doesn&amp;rsquo;t seem to work with Claude&amp;rsquo;s free account: &lt;a href=&#34;https://claude.ai/share/fc8b9173-b47c-4ebd-a8f7-b87b03433706&#34;&gt;&amp;ldquo;No memories or stored context found.&amp;rdquo;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Patterns for Short Code</title>
      <link>https://www.s-anand.net/blog/patterns-for-short-code/</link>
      <pubDate>Wed, 26 Nov 2025 00:00:00 +0530</pubDate>
      <guid>https://www.s-anand.net/blog/patterns-for-short-code/</guid>
      <description>&lt;p&gt;I had &lt;a href=&#34;https://claude.ai/code/session_01V4vK6jAMmXqKzwz9dys8zw&#34;&gt;Claude Code&lt;/a&gt; create a &lt;a href=&#34;https://github.com/sanand0/tools/pull/91&#34;&gt;PR&lt;/a&gt; to update my &lt;a href=&#34;https://tools.s-anand.net/unicoder/&#34;&gt;Unicoder tool&lt;/a&gt;. As part of that, I prompted it to repeatedly:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Shorten the code by exploring opportunities to rewrite more elegantly.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Finally, I asked it:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You applied several changes to refactor the code for elegance and brevity.&lt;/p&gt;
&lt;p&gt;What were the principles you applied? List them all with examples. The objective is to teach me how to shorten and simplify code elegantly.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Its response was a good tutorial on refactoring to shorten and simplify code.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Excellent question! Here are the key refactoring principles I applied, with concrete examples from the code:&lt;/p&gt;
&lt;h2 id=&#34;1-data-driven-design-over-repetitive-conditionals&#34;&gt;1. Data-Driven Design Over Repetitive Conditionals&lt;/h2&gt;
&lt;p&gt;Replace repetitive if/else chains with data structures.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before (30 lines):&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toAscii&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;codePointAt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d5d4&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d5ed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;String&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fromCharCode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;UNICODE_OFFSETS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;BOLD_UPPER&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d5ee&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d607&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;String&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fromCharCode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;UNICODE_OFFSETS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;BOLD_LOWER&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d608&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d621&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;String&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fromCharCode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;UNICODE_OFFSETS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;ITALIC_UPPER&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// ... 4 more similar checks
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;detectStyle&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;codePointAt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d5d4&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d5ed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d5ee&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d607&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;))&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;bold&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// ... 2 more similar checks
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After (15 lines):&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;CHAR_RANGES&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;start&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d5d4&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d5ed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;UNICODE_OFFSETS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;BOLD_UPPER&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;bold&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;start&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d5ee&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mh&#34;&gt;0x1d607&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;UNICODE_OFFSETS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;BOLD_LOWER&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;bold&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// ... all ranges in one place
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toAscii&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;codePointAt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;range&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;CHAR_RANGES&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;find&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;start&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;range&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;String&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fromCharCode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;range&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;offset&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;detectStyle&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;codePointAt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;range&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;CHAR_RANGES&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;find&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;start&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;code&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;range&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;?&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;??&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; Define data once, process it generically. Both functions now share the same data.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;2-optional-chaining--nullish-coalescing&#34;&gt;2. Optional Chaining &amp;amp; Nullish Coalescing&lt;/h2&gt;
&lt;p&gt;Use modern JavaScript operators for cleaner null handling.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;formatSegment&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;switch&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;bold&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`**&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;**`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;italic&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`*&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;*`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;case&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;mono&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`\`&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;\``&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;formatSegment&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;formatters&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;bold&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`**&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;**`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;italic&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`*&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;*`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;mono&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`\`&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;\``&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;formatters&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;?&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;??&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; &lt;code&gt;?.&lt;/code&gt; safely accesses properties, &lt;code&gt;??&lt;/code&gt; provides defaults. Object lookup replaces switch.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;3-pattern-arrays-for-iterative-operations&#34;&gt;3. Pattern Arrays for Iterative Operations&lt;/h2&gt;
&lt;p&gt;Use data structures to eliminate repetitive code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;mergeStyledSegments&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/\*\*([^*]+)\*\* \*\*([^*]+)\*\*/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;**$1 $2**&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/\*([^*]+)\* \*([^*]+)\*/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;*$1 $2*&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/`([^`]+)` `([^`]+)`/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;`$1 $2`&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;original&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/\*\*([^*]+)\*\* \*\*([^*]+)\*\*/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;**$1 $2**&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/\*([^*]+)\* \*([^*]+)\*/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;*$1 $2*&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/`([^`]+)` `([^`]+)`/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;`$1 $2`&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!==&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;original&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;mergeStyledSegments&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;mergeStyledSegments&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;patterns&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/\*\*([^*]+)\*\* \*\*([^*]+)\*\*/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;**$1 $2**&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/\*([^*]+)\* \*([^*]+)\*/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;*$1 $2*&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/`([^`]+)` `([^`]+)`/g&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;`$1 $2`&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;prev&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;prev&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;patterns&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;forEach&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(([&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;pattern&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;replacement&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;])&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;pattern&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;replacement&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!==&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;prev&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; DRY—define patterns once, iterate over them. Easier to add new patterns.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;4-destructuring-for-clarity&#34;&gt;4. Destructuring for Clarity&lt;/h2&gt;
&lt;p&gt;Extract only what you need from objects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;copyToClipboard&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;originalHTML&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;originalClasses&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[...&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classList&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;textContent&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Copied!&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classList&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;remove&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;btn-light&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classList&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;btn-success&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;setTimeout&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;originalHTML&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;originalClasses&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;forEach&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;cls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classList&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;cls&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;copyToClipboard&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;textContent&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Copied!&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;btn-light&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;btn-success&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;setTimeout&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;innerHTML&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;className&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2000&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; Destructure to extract values. Use &lt;code&gt;className&lt;/code&gt; string instead of classList manipulation.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;5-arrow-functions-with-implicit-returns&#34;&gt;5. Arrow Functions with Implicit Returns&lt;/h2&gt;
&lt;p&gt;Eliminate unnecessary syntax for single-expression functions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;handleCopy&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;outputId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;buttonId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;copyToClipboard&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;outputId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerText&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;buttonId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;handleCopy&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;outputId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;buttonId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;copyToClipboard&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;outputId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerText&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;buttonId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; Single-expression functions don&amp;rsquo;t need braces or &lt;code&gt;return&lt;/code&gt;. One line when clear.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;6-combine-related-functions&#34;&gt;6. Combine Related Functions&lt;/h2&gt;
&lt;p&gt;Merge functions that serve similar purposes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;showError&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;errorContainer&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;error-container&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;errorContainer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;textContent&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`Error: &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;errorContainer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classList&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;remove&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;d-none&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;hideError&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;error-container&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classList&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;d-none&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;setError&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;message&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;el&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;error-container&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;el&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;textContent&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`Error: &lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;el&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classList&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;remove&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;d-none&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;el&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;classList&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;d-none&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; One function with optional parameter beats two separate functions. &lt;code&gt;setError()&lt;/code&gt; hides, &lt;code&gt;setError(msg)&lt;/code&gt; shows.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;7-object-literal-shorthand&#34;&gt;7. Object Literal Shorthand&lt;/h2&gt;
&lt;p&gt;Use computed expressions in object literals.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;convertCodeBlock&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;converted&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[...&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;detectStyle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;===&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;mono&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toAscii&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;```\n&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;converted&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;\n```&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;convertCodeBlock&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;({&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;```\n&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[...&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;detectStyle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;===&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;mono&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toAscii&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;\n```&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; Eliminate intermediate variables when computation is clear. Use &lt;code&gt;({...})&lt;/code&gt; for implicit object return.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;8-remove-dead-code&#34;&gt;8. Remove Dead Code&lt;/h2&gt;
&lt;p&gt;Delete unused functions ruthlessly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Removed:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;fromUnicodeStyle&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;split&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toAscii&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; If it&amp;rsquo;s only exported for tests but unused in production, remove it. YAGNI (You Aren&amp;rsquo;t Gonna Need It).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;9-inline-single-use-helpers&#34;&gt;9. Inline Single-Use Helpers&lt;/h2&gt;
&lt;p&gt;Don&amp;rsquo;t create helpers for operations done once or twice.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before (separate helper):&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;renderOutput&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;outputId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;output&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;outputId&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;output&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replaceChildren&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;output&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;insertAdjacentHTML&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;beforeend&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`&amp;lt;div class=&amp;#34;m-0&amp;#34; style=&amp;#34;white-space: pre-wrap; word-break: break-word;&amp;#34;&amp;gt;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;&amp;lt;/div&amp;gt;`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;updateMarkdownOutput&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;hideError&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;renderOutput&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;unicode-output&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;convertMarkdownToUnicode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;markdown-input&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;));&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After (kept helper but simplified):&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;renderOutput&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;el&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getElementById&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;el&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replaceChildren&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;el&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;insertAdjacentHTML&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;beforeend&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;sb&#34;&gt;`&amp;lt;div class=&amp;#34;m-0&amp;#34; style=&amp;#34;white-space: pre-wrap; word-break: break-word;&amp;#34;&amp;gt;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;&amp;lt;/div&amp;gt;`&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; Kept the helper (reused 2x), but shortened variable names (&lt;code&gt;outputId&lt;/code&gt;→&lt;code&gt;id&lt;/code&gt;, &lt;code&gt;output&lt;/code&gt;→&lt;code&gt;el&lt;/code&gt;).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;10-single-line-simple-functions&#34;&gt;10. Single-Line Simple Functions&lt;/h2&gt;
&lt;p&gt;When a function is trivial, make it one line.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;convertBulletsToLists&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/^• /gm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;- &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;convertBulletsToLists&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;markdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/^• /gm&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;- &amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; Trivial transforms don&amp;rsquo;t need braces or explicit returns.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;11-early-returns-over-nested-conditions&#34;&gt;11. Early Returns Over Nested Conditions&lt;/h2&gt;
&lt;p&gt;Fail fast to reduce indentation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example (already applied):&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;copyToClipboard&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;trim&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;setError&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Nothing to copy&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// ... rest of logic
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; Guard clauses at the top reduce nesting and cognitive load.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;12-spread-operator-for-string-iteration&#34;&gt;12. Spread Operator for String Iteration&lt;/h2&gt;
&lt;p&gt;Use &lt;code&gt;[...str]&lt;/code&gt; instead of &lt;code&gt;str.split(&amp;quot;&amp;quot;)&lt;/code&gt; for Unicode safety.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// Handles surrogate pairs correctly
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;[...&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;].&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;detectStyle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;===&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;mono&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toAscii&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;c&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; &lt;code&gt;[...]&lt;/code&gt; respects code points; &lt;code&gt;split(&amp;quot;&amp;quot;)&lt;/code&gt; splits surrogate pairs incorrectly.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;13-concise-module-exports&#34;&gt;13. Concise Module Exports&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;module&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;exports&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;convertMarkdownToUnicode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;convertUnicodeToMarkdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;toBold&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;toItalic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;toMonospace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;toAscii&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;detectStyle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;fromUnicodeStyle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;module&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;exports&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;convertMarkdownToUnicode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;convertUnicodeToMarkdown&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toBold&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toItalic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toMonospace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;toAscii&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;detectStyle&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Principle:&lt;/strong&gt; One line when it fits. Remove unused exports.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;summary-core-principles&#34;&gt;&lt;strong&gt;Summary: Core Principles&lt;/strong&gt;&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Data over code&lt;/strong&gt;. Use structures, not conditionals&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DRY&lt;/strong&gt;. Never repeat the same logic&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modern JS features&lt;/strong&gt;. Use &lt;code&gt;?.&lt;/code&gt;, &lt;code&gt;??&lt;/code&gt;, destructuring, spread&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;YAGNI&lt;/strong&gt;. Remove unused code immediately&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Single expression&lt;/strong&gt;. Eliminate intermediate variables when clear&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Implicit returns&lt;/strong&gt;. Arrow functions with &lt;code&gt;=&amp;gt;&lt;/code&gt; not &lt;code&gt;=&amp;gt; { return }&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Early returns&lt;/strong&gt;. Guard clauses reduce nesting&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shorter names&lt;/strong&gt;. When scope is small (&lt;code&gt;output&lt;/code&gt; → &lt;code&gt;el&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One concern&lt;/strong&gt;. Each function does one thing well&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Readability first&lt;/strong&gt;. Terse is good; cryptic is bad&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; 144 lines shorter, more maintainable, same functionality! 🎯&lt;/p&gt;
</description>
    </item>
    <item>
      <title></title>
      <link>https://www.s-anand.net/blog/most-repeated-letters/</link>
      <pubDate>Thu, 20 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/most-repeated-letters/</guid>
      <description>&lt;p&gt;While meditating, I realized 75% of &amp;ldquo;LULL&amp;rdquo; is the letter &amp;ldquo;L&amp;rdquo;. (This sort of thing happens a lot when I meditate.)&lt;/p&gt;
&lt;p&gt;MUMMY (60% M) and DADDY (60% D) have lower percentage, but are longer, so maybe get a bonus?&lt;/p&gt;
&lt;p&gt;I asked Claude Code what would top such a list. It picked a dictionary, generated the 333 words with 4+ letters and &amp;gt;50% concentration.&lt;/p&gt;
&lt;p&gt;What did I like best? &amp;ldquo;ASSESSES&amp;rdquo;. 5/8 letters are &amp;ldquo;S&amp;rdquo;. That&amp;rsquo;s nearly two-thirds.&lt;/p&gt;
&lt;p&gt;Then &lt;strong&gt;it wrote an xkcd-style story&lt;/strong&gt;! Here are snippets:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I wrote a Python script to analyze 370,105 English words. Then I questioned my life choices.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;*Does &amp;ldquo;mmmm&amp;rdquo; count? Look, I didn&amp;rsquo;t make the dictionary. I just downloaded it from the internet.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Notice something? After length 6, it&amp;rsquo;s just S-words and E-words all the way down. (It&amp;rsquo;s the grammatical duct tape of English)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;I didn&amp;rsquo;t analyze Welsh, but I&amp;rsquo;m guessing their L&amp;rsquo;s would be extremely competitive.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The story &lt;em&gt;way more fun&lt;/em&gt; than the analysis!&lt;/p&gt;
&lt;p&gt;Check it out: &lt;a href=&#34;https://github.com/sanand0/research/tree/main/repeated-letter-words&#34;&gt;https://github.com/sanand0/research/tree/main/repeated-letter-words&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Learning: &lt;strong&gt;Find good styles to copy from&lt;/strong&gt;.
Here&amp;rsquo;s my style catalog: &lt;a href=&#34;https://github.com/sanand0/prompts/blob/main/styles.md&#34;&gt;https://github.com/sanand0/prompts/blob/main/styles.md&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://files.s-anand.net/images/2025-11-20-most-repeated-letters-linkedin.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.linkedin.com/posts/sanand0_while-meditating-i-realized-75-of-lull-activity-7397862297077125120-cBkG&#34;&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 16 Nov 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-16-nov-2025/</link>
      <pubDate>Sun, 16 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-16-nov-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 11 got some &lt;em&gt;very&lt;/em&gt; practical updates. Notepad now supports Markdown preview natively. MS Paint has an opacity filter. Microsoft Copilot can share screens and speak/listen.&lt;/li&gt;
&lt;li&gt;Things I learn when Ubuntu drivers crashed on my laptop:
&lt;ul&gt;
&lt;li&gt;The &lt;a href=&#34;http://mirror.sg.gs/ubuntu-releases/24.04.3/ubuntu-24.04.3-desktop-amd64.iso&#34;&gt;SG.GS Ubuntu ISO mirror&lt;/a&gt; is a &lt;em&gt;lot&lt;/em&gt; faster than the &lt;a href=&#34;https://releases.ubuntu.com/24.04.3/ubuntu-24.04.3-desktop-amd64.iso&#34;&gt;official Ubuntu ISO download&lt;/a&gt; (5 min vs 12 hours).&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://rufus.ie/en/&#34;&gt;Rufus&lt;/a&gt; and &lt;a href=&#34;https://www.balena.io/etcher/&#34;&gt;balenaEtcher&lt;/a&gt; are the de facto tools for bootable USB drives from ISO.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Gemini 2.5 Flash Image is not great at generating text. But a clever a workaround is to provide the rendered text as an image input! Also, Gemini 2.5 Flash Image seems to ignore commands that try style transfer (e.g. &amp;ldquo;turn me into Studio Ghibli&amp;rdquo;). &lt;a href=&#34;https://github.com/minimaxir/gemimg&#34;&gt;GemImg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://css-tricks.com/animating-layouts-with-the-flip-technique/&#34;&gt;FLIP animation&lt;/a&gt; is an efficient animation technique.
&lt;ul&gt;
&lt;li&gt;Capture the First position&lt;/li&gt;
&lt;li&gt;Apply the Last position (changing position, size, rotation, etc.)&lt;/li&gt;
&lt;li&gt;Invert, i.e. apply just the &lt;code&gt;transform&lt;/code&gt; that&amp;rsquo;ll move it back to the First position&lt;/li&gt;
&lt;li&gt;Plan the animation. This &lt;em&gt;only&lt;/em&gt; needs to change transform, hence no DOM reflow.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Asking coding agents to create a &lt;a href=&#34;https://github.com/rajasegar/awesome-codemods&#34;&gt;codemod&lt;/a&gt; for large-scale refactoring works well &lt;a href=&#34;https://x.com/steipete/status/1987771067998339352&#34;&gt;Peter Steinberger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;When to quit vs persist. &lt;a href=&#34;https://claude.ai/chat/8e9252da-6186-4876-be2e-d81c27a2cc7d&#34;&gt;#&lt;/a&gt; &lt;a href=&#34;https://chatgpt.com/c/6911a446-6018-8320-aed7-808be506d4e6&#34;&gt;#&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;Do stats/signals support positive outcome? QUIT if not.&lt;/li&gt;
&lt;li&gt;Crossed any limits you set for yourself? QUIT if so. (Run pre-mortems to find these stats/signals and limits.)&lt;/li&gt;
&lt;li&gt;Is the decision hard to reverse AND uncertainty high? QUIT if so. Else you can experiment cheaply. (Create reversibility.)&lt;/li&gt;
&lt;li&gt;Are youI continuing because of past effort or pride? QUIT if so. (Set review cadence.)&lt;/li&gt;
&lt;li&gt;Is there a better alternative? SWITCH if so. (Get outside help.)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Once a model generates an output, an agentic look tends not to change the fundamental approach and just tweaks it. So, if a solution is directionally wrong, restarting works better than iterating. &lt;a href=&#34;https://www.robert-glaser.de/agentic-pelican-on-a-bicycle/&#34;&gt;Agentic Pelican on a Bicycle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://claude.ai/share/4168c00c-49f3-4007-a26a-5699bf581648&#34;&gt;Reading between the lines on the Microsoft OpenAI deal&lt;/a&gt;:
&lt;ul&gt;
&lt;li&gt;Microsoft values OpenAI&amp;rsquo;s growth (financial return) than control&lt;/li&gt;
&lt;li&gt;Neither trusts the other enough to decide what&amp;rsquo;s AGI&lt;/li&gt;
&lt;li&gt;Microsoft gets some wins: models until 2032 (even post AGI) as well as research IP. Both parties expect AGI between 2027-2030.&lt;/li&gt;
&lt;li&gt;OpenAI keeps all consumer hardware - so is betting hard on hardware. It&amp;rsquo;s more Apple than Microsoft territory&lt;/li&gt;
&lt;li&gt;Divorce preparation: Microsoft can pursue AGI with other partners. OpenAI can purchase compute from anyone and release open weights models. Infra has more value than model dev!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://allenai.org/olmoearth&#34;&gt;OlmoEarth&lt;/a&gt; is a set of image models trained on labelled geospatial data. That&amp;rsquo;s useful for deforestation and land cover monitoring, wildfire detection, urban growth monitoring, crop mapping, etc. The models are open weights and can be fine-tuned.&lt;/li&gt;
&lt;li&gt;Claude Code&amp;rsquo;s &lt;a href=&#34;https://code.claude.com/docs/en/output-styles&#34;&gt;output styles&lt;/a&gt; are a way of using Claude Code for anything (e.g. writing, analysis, research, personal advice, etc.), not just coding. Create a &lt;code&gt;~/.claude/output-style/your-style-name.md&lt;/code&gt; and run &lt;code&gt;/output-style your-style-name&lt;/code&gt; to replace the system prompt will be replaced. You can also use the &lt;code&gt;--system-prompt&lt;/code&gt; and &lt;code&gt;--append-system-prompt&lt;/code&gt; flags with the CLI.&lt;/li&gt;
&lt;li&gt;Following &lt;a href=&#34;https://x.com/emollick/status/1987355374928769395?s=20&#34;&gt;Ethan Mollick&amp;rsquo;s lead&lt;/a&gt; I asked: &lt;em&gt;I can travel back in time to any time before 1500 in India and change only one thing. What is the single thing you would change? Nothing obvious.&lt;/em&gt;.
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://chatgpt.com/share/6912a989-c858-800c-9039-a38b3f5b090e&#34;&gt;ChatGPT&lt;/a&gt;: &lt;strong&gt;Create a single, simple, phonetic script&lt;/strong&gt; for all public life in India around 1100 CE.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://claude.ai/share/11be725d-cca3-4108-bafd-58eb3ce0510e&#34;&gt;Claude&lt;/a&gt;: &lt;strong&gt;institutionalize systematic historical recordkeeping&lt;/strong&gt;, introduce limited liability commercial entities, and mandate systematic translation of Sanskrit technical texts into all major regional languages.&lt;/li&gt;
&lt;li&gt;How about now? ChatGPT suggests: &lt;strong&gt;make all public rules and records computable by law&lt;/strong&gt;. Claude suggests: &lt;strong&gt;make all state-level entitlements and civil documentation fully portable&lt;/strong&gt; across India.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;For the first time in history, Russian troops surrendered to a wheeled drone that carried 138 pounds of explosives - &lt;a href=&#34;https://www.washingtonpost.com/world/2025/10/20/ukraine-russia-battlefield-land-drones&#34;&gt;Washington Post&lt;/a&gt;.
Given the cost and accessibility of drones, I guess drone terrorist attacks will soon emerge.&lt;/li&gt;
&lt;li&gt;HTML + JS apps will last longer than server-side apps and it makes sense to write more of those. For essential back-end services, keep them generic. Specific services layers I see are:
&lt;ul&gt;
&lt;li&gt;Auth (e.g. Google Auth, Auth0, Supabase, &amp;hellip;)&lt;/li&gt;
&lt;li&gt;Storage (e.g. Supabase, Firebase)&lt;/li&gt;
&lt;li&gt;LLMs (e.g. OpenAI, Claude, OpenRouter)&lt;/li&gt;
&lt;li&gt;Communications (e.g. EmailJS)&lt;/li&gt;
&lt;li&gt;&amp;hellip; #TODO Extend with LLMs&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gistpreview.github.io/&#34;&gt;https://gistpreview.github.io/&lt;/a&gt; is an unofficial GIST preview tool. It accepts a &lt;code&gt;?GIST_ID&lt;/code&gt; and displays the gist as a standalone HTML page. &lt;a href=&#34;https://simonwillison.net/2025/Oct/23/claude-code-for-web-video/&#34;&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.chrome.com/docs/web-platform/deprecating-xslt&#34;&gt;XSLT is deprecated in Chrome&lt;/a&gt;. So the &lt;a href=&#34;https://jakearchibald.com/2025/making-xml-human-readable-without-xslt/&#34;&gt;&lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag in XML&lt;/a&gt; will become the new way of rendering RSS/Atom. This is one of the rare &amp;ldquo;break-the-web&amp;rdquo; changes from browsers. &lt;a href=&#34;https://simonwillison.net/2025/Nov/5/removing-xslt/&#34;&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;ldquo;India has &lt;em&gt;absurdly&lt;/em&gt; low internal migration - around 9% annual migration rate versus 25-30% in China or the US. Not because people don&amp;rsquo;t want to move, but because the cost of moving is artificially massive. You lose your ration card, state entitlements, kids&amp;rsquo; school continuity, voting rights, &amp;hellip;&amp;rdquo; &lt;a href=&#34;https://claude.ai/chat/b7f7ceb9-67fe-4b42-af53-69bb9bbf1fae&#34;&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Rolf Dobelli&amp;rsquo;s &lt;a href=&#34;https://www.goodreads.com/book/show/222216333-the-not-to-do-list&#34;&gt;The Not To-Do List&lt;/a&gt; is a good application of inversion. Also, the chapter titles themselves explain most of the message, which is very helpful. Just thinking about any of these can be a useful path to improvement.
&lt;ol&gt;
&lt;li&gt;Let things fall apart&lt;/li&gt;
&lt;li&gt;Feed your weaker self&lt;/li&gt;
&lt;li&gt;Be unreliable&lt;/li&gt;
&lt;li&gt;Be an asshole&lt;/li&gt;
&lt;li&gt;Have high expectations&lt;/li&gt;
&lt;li&gt;Drift through the day&lt;/li&gt;
&lt;li&gt;Mess up your marriage&lt;/li&gt;
&lt;li&gt;Be a quitter&lt;/li&gt;
&lt;li&gt;Be hypocritical&lt;/li&gt;
&lt;li&gt;Cling to your bad habits&lt;/li&gt;
&lt;li&gt;Set the wrong goals&lt;/li&gt;
&lt;li&gt;Drink yourself miserable&lt;/li&gt;
&lt;li&gt;Get involved in other people’s drama&lt;/li&gt;
&lt;li&gt;Only learn from your own experience&lt;/li&gt;
&lt;li&gt;Be hyperactive on social media&lt;/li&gt;
&lt;li&gt;Indulge in road rage&lt;/li&gt;
&lt;li&gt;Surround yourself with negative people&lt;/li&gt;
&lt;li&gt;Micromanage your neighbours&lt;/li&gt;
&lt;li&gt;Say yes to drugs&lt;/li&gt;
&lt;li&gt;Get stuck in your career&lt;/li&gt;
&lt;li&gt;Never be playful&lt;/li&gt;
&lt;li&gt;Feel guilty&lt;/li&gt;
&lt;li&gt;Practise ingratitude&lt;/li&gt;
&lt;li&gt;Trust your banker&lt;/li&gt;
&lt;li&gt;Be paranoid&lt;/li&gt;
&lt;li&gt;Make other people feel unimportant&lt;/li&gt;
&lt;li&gt;Live in the past&lt;/li&gt;
&lt;li&gt;Listen to your inner voice&lt;/li&gt;
&lt;li&gt;Expect rationality&lt;/li&gt;
&lt;li&gt;Get nihilistic&lt;/li&gt;
&lt;li&gt;Catastrophize&lt;/li&gt;
&lt;li&gt;Consider money unimportant&lt;/li&gt;
&lt;li&gt;Cultivate a victim mentality&lt;/li&gt;
&lt;li&gt;Become a lapdog&lt;/li&gt;
&lt;li&gt;Get rich quick, get smart quick&lt;/li&gt;
&lt;li&gt;Ruminate&lt;/li&gt;
&lt;li&gt;Trade your reputation for money&lt;/li&gt;
&lt;li&gt;Never suffer&lt;/li&gt;
&lt;li&gt;Let your emotions define you&lt;/li&gt;
&lt;li&gt;Try to end it all&lt;/li&gt;
&lt;li&gt;Marry the wrong person – and stay with them&lt;/li&gt;
&lt;li&gt;Celebrate your resentment&lt;/li&gt;
&lt;li&gt;Join a cult&lt;/li&gt;
&lt;li&gt;Try to change people&lt;/li&gt;
&lt;li&gt;Say everything you think&lt;/li&gt;
&lt;li&gt;Spin multiple plates&lt;/li&gt;
&lt;li&gt;Do only shallow work&lt;/li&gt;
&lt;li&gt;Invite bad people into your life&lt;/li&gt;
&lt;li&gt;Go where the competition is strong&lt;/li&gt;
&lt;li&gt;Say yes to everything&lt;/li&gt;
&lt;li&gt;Crowd your life with gadgets&lt;/li&gt;
&lt;li&gt;Fall into the content trap&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://huggingface.co/deepseek-ai/DeepSeek-V3.2-Exp&#34;&gt;DeepSeek-V3.2-Exp&lt;/a&gt; has linear inference time, i.e. longer inputs don&amp;rsquo;t take longer time. It picks the top 2K most relevant tokenss from the input instead. This can make model inference cheaper and faster.&lt;/li&gt;
&lt;li&gt;California&amp;rsquo;s Bill &lt;a href=&#34;https://legiscan.com/CA/text/AB316/id/3223647&#34;&gt;AB 316&lt;/a&gt; makes the people who build autonomous systems liable for their actions. That&amp;rsquo;s quite a step.&lt;/li&gt;
&lt;li&gt;Udio and Universal are launching a platform to &lt;a href=&#34;https://www.udio.com/blog/a-new-era&#34;&gt;generate music in the style of famous artistes&lt;/a&gt;. An interesting new way to monetize. Fingerprinting music is a hot area.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://services.google.com/fh/files/blogs/vaultgemma_tech_report.pdf&#34;&gt;VaultGemma&lt;/a&gt; shows a fine-tuning approach that eliminates personal info that appears only once from memorization. It works by adding noise to weights and capping weights updates so that no one example has undue influence. Model quality is mostly the same.&lt;/li&gt;
&lt;li&gt;Amazon is giving drivers smart glasses to scan packages, get directions, capture proof of delivery and detect hazards. Cool! &lt;a href=&#34;https://techcrunch.com/2025/10/22/amazon-unveils-ai-smart-glasses-for-its-delivery-drivers/&#34;&gt;TechCrunch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;⭐ Over 3 months, I&amp;rsquo;ve recorded ~180 calls. Processing each costs ~1.25 cents (GPT-5) and 1 year&amp;rsquo;s conversations cost ~$9. That&amp;rsquo;s &lt;em&gt;incredible&lt;/em&gt; value for money if I hired GPT-5 / Codex as a data-driven personal coach to guide me on:
&lt;ul&gt;
&lt;li&gt;What are my blindspots? That is, feedback people share with me that I ignore?&lt;/li&gt;
&lt;li&gt;What are the clusters of persona that I interact with and which of these have a positive and negative influence on me?&lt;/li&gt;
&lt;li&gt;Where am I am being unreliable? Where am I being an asshole?&lt;/li&gt;
&lt;li&gt;Where are my expectations high? Where are they low? Where would the opposite have helped?&lt;/li&gt;
&lt;li&gt;Where do I quit early? Where do I persist? Where would the opposite have helped?&lt;/li&gt;
&lt;li&gt;What good habits should I continue? What bad habits should I stop?&lt;/li&gt;
&lt;li&gt;What are the strongest opportunities to thank or praise that I missed? Is there a pattern? What triggers could I use to build this habit?&lt;/li&gt;
&lt;li&gt;Where have I tried to change people? Where have people tried to change me?&lt;/li&gt;
&lt;li&gt;Where have I spotted wrong questions? That is, rather than answering the question, I spotted the more apt question and answered that instead?&lt;/li&gt;
&lt;li&gt;&amp;hellip; and a hundred other questions that I wouldn&amp;rsquo;t even know to ask.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Sub-agents can run parallel / independent tasks while keeping the context window small. (But the advantage over &lt;code&gt;xargs&lt;/code&gt; seems marginal.) &lt;a href=&#34;https://simonwillison.net/2025/Oct/11/sub-agents/&#34;&gt;Simon Willison&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Document, lint, type-check, add test cases (or other similar tasks) for all folders in a monorepo.&lt;/li&gt;
&lt;li&gt;Research and create a report for each topic in */RESEARCH.md.&lt;/li&gt;
&lt;li&gt;Synthesize learnings from each conversation in transripts/*.md.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&amp;ldquo;If you&amp;rsquo;re signed into sensitive accounts like your bank or your email provider in your browser, simply summarizing a Reddit post could result in an attacker being able to steal money or your private data.&amp;rdquo; &lt;a href=&#34;https://brave.com/blog/unseeable-prompt-injections/&#34;&gt;Brave&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;OpenAI Atlas has a &amp;ldquo;Watch Mode&amp;rdquo; that will stop working if you move away from that tab. Useful to keep an eye on sensitive sites. &lt;a href=&#34;https://simonwillison.net/2025/Oct/22/openai-ciso-on-atlas/&#34;&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;ldquo;&amp;hellip; image editing platforms seem like they’ll eat and subsume Photoshop&amp;hellip; modern image editors – especially Nano Banana from Google Gemini – &amp;hellip; they’re extremely effective and, increasingly, instructable&amp;rdquo; - &lt;a href=&#34;https://jack-clark.net/2025/10/27/import-ai-433-ai-auditors-robot-dreams-and-software-for-helping-an-ai-run-a-lab/&#34;&gt;Import AI&lt;/a&gt;.
Facebook now suggests edits to photos - &lt;a href=&#34;https://techcrunch.com/2025/10/17/facebooks-ai-can-now-suggest-edits-to-the-photos-still-on-your-phone/&#34;&gt;TechCruch&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://webperl.zero-g.net/&#34;&gt;WebPerl&lt;/a&gt; runs Perl in the browser via WebAssembly. &lt;a href=&#34;https://simonwillison.net/2025/Oct/22/sloccount-in-webassembly/&#34;&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title></title>
      <link>https://www.s-anand.net/blog/people-beginning-and-ending-with-ai/</link>
      <pubDate>Sat, 15 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/people-beginning-and-ending-with-ai/</guid>
      <description>&lt;p&gt;When I realized &lt;strong&gt;Ai&lt;/strong&gt;shwarya R&lt;strong&gt;ai&lt;/strong&gt; begins and ends with AI, I &lt;em&gt;had&lt;/em&gt; to find out if there were more like her.&lt;/p&gt;
&lt;p&gt;It took a coding agent (Claude Code in this case) 10 minutes to find the 10 celebrities who share that distinction, at least across the 24,086 names on Wikipedia:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt; Nag&lt;strong&gt;ai&lt;/strong&gt; - Japanese playwright&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt;guo D&lt;strong&gt;ai&lt;/strong&gt; - Chinese-American atmospheric scientist&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt; (poet) - American poet&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt;sea Naw&lt;strong&gt;ai&lt;/strong&gt; - Fijian rugby player&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt; (singer) - Japanese-American singer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt;sha Chught&lt;strong&gt;ai&lt;/strong&gt; - Pakistani actress&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt;yappan Pill&lt;strong&gt;ai&lt;/strong&gt; - Indian social reformer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt;zawa Seishis&lt;strong&gt;ai&lt;/strong&gt; - Japanese Confucian scholar&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt;nmuire mac Sétn&lt;strong&gt;ai&lt;/strong&gt; - Irish high king&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ai&lt;/strong&gt;sha Yousef al-Mann&lt;strong&gt;ai&lt;/strong&gt; - Qatari artist&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Glory be to these AI bookends!&lt;/p&gt;
&lt;p&gt;PS: It&amp;rsquo;s pretty cool that two celebrities are known just as &amp;ldquo;Ai&amp;rdquo;!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Prompt: &lt;a href=&#34;https://github.com/sanand0/research/pull/11&#34;&gt;https://github.com/sanand0/research/pull/11&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Code: &lt;a href=&#34;https://github.com/sanand0/research/tree/main/wikipedia-ai-names&#34;&gt;https://github.com/sanand0/research/tree/main/wikipedia-ai-names&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://files.s-anand.net/images/2025-11-15-people-beginning-and-ending-with-ai-linkedin.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.linkedin.com/posts/sanand0_when-i-realized-%F0%9D%97%94%F0%9D%97%B6shwarya-r%F0%9D%97%AE%F0%9D%97%B6-begins-activity-7396577669649379328-3M2l&#34;&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    <item>
      <title></title>
      <link>https://www.s-anand.net/blog/why-old-movies-are-rated-so-high/</link>
      <pubDate>Mon, 10 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/why-old-movies-are-rated-so-high/</guid>
      <description>&lt;p&gt;I always wondered why &lt;strong&gt;old movies are rated so high&lt;/strong&gt; on IMDb.&lt;/p&gt;
&lt;p&gt;For example, 12 Angry Men (1954) with just ~900K votes ranks about as high as Inception (2010) with ~2M votes. Few people I know have seen 12 Angry Men. So where does this high rating come from?&lt;/p&gt;
&lt;p&gt;My theories were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Old movies really &lt;em&gt;are&lt;/em&gt; that good.&lt;/li&gt;
&lt;li&gt;IMDb&amp;rsquo;s algorithm is biased towards old movies.&lt;/li&gt;
&lt;li&gt;People remember older movies fondly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Actually, it&amp;rsquo;s none of these. &lt;strong&gt;It&lt;/strong&gt;&amp;rsquo;&lt;strong&gt;s selection bias&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Few people watch a 1950s black &amp;amp; white drama: cinephiles, film students, etc. They love it and give it 9s and 10s.&lt;/p&gt;
&lt;p&gt;Everyone watched Inception. The casual majority thinks it&amp;rsquo;s fine, not life changing. Maybe a 7 or 8.&lt;/p&gt;
&lt;p&gt;This creates a paradox: &lt;strong&gt;obscurity protects ratings&lt;/strong&gt; while &lt;strong&gt;popularity is its own punishment&lt;/strong&gt;. Only &amp;ldquo;devotees&amp;rdquo; watch obscure movies - leading to better ratings than widely seen movies.&lt;/p&gt;
&lt;p&gt;PS: This data analysis and story were authored by Claude Code. That includes the statistical significance validation.&lt;/p&gt;
&lt;p&gt;Story: &lt;a href=&#34;https://sanand0.github.io/datastories/imdb-democracy-penalty/index.html&#34;&gt;https://sanand0.github.io/datastories/imdb-democracy-penalty/index.html&lt;/a&gt;
Prompt: &lt;a href=&#34;http://github.com/sanand0/datastories/tree/main/imdb-democracy-penalty&#34;&gt;http://github.com/sanand0/datastories/tree/main/imdb-democracy-penalty&lt;/a&gt;
Code: &lt;a href=&#34;https://github.com/sanand0/imdbscrape/pull/1&#34;&gt;https://github.com/sanand0/imdbscrape/pull/1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://files.s-anand.net/images/2025-11-10-why-old-movies-are-rated-so-high-linkedin.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.linkedin.com/posts/sanand0_i-always-wondered-why-%F0%9D%97%BC%F0%9D%97%B9%F0%9D%97%B1-%F0%9D%97%BA%F0%9D%97%BC%F0%9D%98%83%F0%9D%97%B6%F0%9D%97%B2%F0%9D%98%80-activity-7395757328177774592-zJlE&#34;&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 09 Nov 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-09-nov-2025/</link>
      <pubDate>Sun, 09 Nov 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-09-nov-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;But when an identity based belief was challenged, the brain responded as if under physical attack.&amp;rdquo; &lt;a href=&#34;https://spf13.com/p/the-hidden-conversation/&#34;&gt;Why Engineers Can&amp;rsquo;t Be Rational About Programming Languages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Notes from &lt;a href=&#34;https://www.youtube.com/watch?v=I9Njb8Lw5Xc&#34;&gt;How to build a cult&lt;/a&gt;, Lulu Cheng, The Knowledge Project podcast
&lt;ul&gt;
&lt;li&gt;Conviction is infectious.&lt;/li&gt;
&lt;li&gt;Communicate at the INTERSECTION of interests. Learn theirs&lt;/li&gt;
&lt;li&gt;Begin with &amp;ldquo;why your story matters to them&amp;rdquo; (first sentence). That beats &amp;ldquo;how you tell it&amp;rdquo; &amp;gt; &amp;ldquo;where you tell it&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;The easiest way to align with an audience is to find your community.&lt;/li&gt;
&lt;li&gt;Humor, curiosity, awe, any strong emotion is a hook.&lt;/li&gt;
&lt;li&gt;Culture has momentum. Best way to break it is to show an alternative that works. People will copy that&lt;/li&gt;
&lt;li&gt;REPEAT messages over and over with complete CONVICTION to convince people who TRUST you. That works, but you need all three.&lt;/li&gt;
&lt;li&gt;Trust builds from likeability, repeated exposure, common beliefs.&lt;/li&gt;
&lt;li&gt;An excellent way to defend against online criticism (when it matters) is to just SHOW UP and THANK them for feedback.&lt;/li&gt;
&lt;li&gt;Serious reputational damage must either be fixed immediately - or you live with it forever.&lt;/li&gt;
&lt;li&gt;Between a story and statistics, the story will always wins. Never fight a story with a statistic. Dig into your statistics and uncover BETTER stories.&lt;/li&gt;
&lt;li&gt;⭐ Prebuttals are a great idea. Start with all possible criticisms yourself and diffuse them. The other person has nothing left to say&lt;/li&gt;
&lt;li&gt;Sparring keeps you sharp. Spar with LLMs.&lt;/li&gt;
&lt;li&gt;To defend, show how the attack targets other people, increasing the surface area. Show how the SPECIFIC attack targets a larger group. Create a SPECIFIC cause worth fighting for.&lt;/li&gt;
&lt;li&gt;Each role has specific objective to optimise for. The leader&amp;rsquo;s role is to balance across these.&lt;/li&gt;
&lt;li&gt;Cheerleader effect. People look beautiful next to a cheerleader. Associations taint.&lt;/li&gt;
&lt;li&gt;Each person has dozens of aspects to their persona. We cannot remember all of them. Each person can make a choice on who they project themselves to be in any group. Shaping their persona.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;del&gt;The &lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=mechatroner.rainbow-csv&#34;&gt;Rainbow CSV&lt;/a&gt; extension may be causing delays (infinite spinner) when pasting Markdown in VS Code. Restarting it seems to fix the issue.&lt;/del&gt;&lt;/li&gt;
&lt;li&gt;⭐ &lt;a href=&#34;https://github.com/K-Dense-AI/claude-scientific-skills/&#34;&gt;Claude scientific skills&lt;/a&gt; is a collection of skills teaching Claude how to use scientific libraries, databases, and APIs across several domains. This may be a good example of a non-trivial skill library - that is hard for AI coding agents to infer by themselves.&lt;/li&gt;
&lt;li&gt;Notes from &lt;a href=&#34;https://blog.sshh.io/p/how-i-use-every-claude-code-feature&#34;&gt;How I use every Claude Code feature&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Use AGENTS.md as guardrails, not a manual. Document what it gets wrong.&lt;/li&gt;
&lt;li&gt;Use self-documenting tools/APIs rather than documenting.&lt;/li&gt;
&lt;li&gt;Docs: Explain why and when to read each doc.&lt;/li&gt;
&lt;li&gt;Never say &amp;ldquo;Never.&amp;rdquo; Explain when to which which alternative.&lt;/li&gt;
&lt;li&gt;Prefer CLIs for stateless tools, MCPs for stateful, authenticated, or complex (e.g. Playwright).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Coding agents work well with version control. &lt;a href=&#34;https://simonwillison.net/2025/Nov/4/datasette-10a20/&#34;&gt;Simon Willison&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Break up uncommitted changes into small commits&lt;/li&gt;
&lt;li&gt;Rewrite branch history for readability&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;gh&lt;/code&gt; CLI to fetch line-wise comments from a PR and make requested changes (e.g. renaming, refactoring, adding types, etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;⭐ When using MCPs or tools with private data, &amp;ldquo;color untrusted content in red, unsafe actions in blue, and never mix colors.&amp;rdquo; &lt;a href=&#34;https://timkellogg.me/blog/2025/11/03/colors&#34;&gt;Good advice&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;⭐ DeepWiki offers a &lt;a href=&#34;https://cognition.ai/blog/codemaps&#34;&gt;codemaps&lt;/a&gt; feature that explains code in an interactive way. It shows a structured explanation on the left. You can click on any note to see the code on the right. It&amp;rsquo;s an effective way to understand how a library or tool executes a task. &lt;a href=&#34;https://deepwiki.com/search/draw-a-codemap_59d591f6-fc79-40f0-973d-bfa0e149b41a&#34;&gt;Here&amp;rsquo;s an example of how Mermaid works&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://blog.google/technology/developers/file-search-gemini-api/&#34;&gt;Gemini offers RAG with free storage&lt;/a&gt;. RAG costs are quite high. This simplifies the process a lot. But I tried running the sample program and after an hour, it still had not completed uploading a single file. Best to wait and watch.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://openrouter.ai/models?fmt=cards&amp;amp;order=top-weekly&amp;amp;output_modalities=embeddings&#34;&gt;OpenRouter supports embedding models&lt;/a&gt; using an &lt;a href=&#34;https://openrouter.ai/docs/api-reference/embeddings/create-embeddings&#34;&gt;OpenAI-like API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://openrouter.ai/moonshotai/kimi-k2-thinking&#34;&gt;Kimi K2 Thinking&lt;/a&gt; seems popular because
&lt;ul&gt;
&lt;li&gt;It&amp;rsquo;s an open-weights model on par with the top models on Humanity’s Last Exam (text-only) and BrowseComp&lt;/li&gt;
&lt;li&gt;Can run 200-300 tool calls without human guidance&lt;/li&gt;
&lt;li&gt;4x cheaper than GPT-5 with low tokens (32B active on 1T parameters, INT4 quantized)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Based on responses to &lt;a href=&#34;https://x.com/simonw/status/1979254349235925084&#34;&gt;Simon Willison&amp;rsquo;s question&lt;/a&gt;, &lt;a href=&#34;https://chatgpt.com/share/690b4fa0-7dec-800c-87a5-6e01dda36f7e&#34;&gt;ChatGPT&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Fine-tuning helps when:
&lt;ul&gt;
&lt;li&gt;Lower latency, e.g. for type-ahead, at lower cost (&lt;strong&gt;37 mentions&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;Structured extraction, parsing and classifiers, e.g. postal address, detecting secrets (18 mentions)&lt;/li&gt;
&lt;li&gt;Custom vision models, e.g. check containers (12 mentions)&lt;/li&gt;
&lt;li&gt;Domain-specific code and stacks (niche languages, stack-specific generation, text→SQL) (11 mentions)&lt;/li&gt;
&lt;li&gt;&amp;hellip; and a long tail.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Fine tuning does not help:
&lt;ul&gt;
&lt;li&gt;When A base model plus prompting or RAG does as well or better (&lt;strong&gt;15 mentions&lt;/strong&gt;)&lt;/li&gt;
&lt;li&gt;When you risk being leapfrogged by a new release (4 mentions)&lt;/li&gt;
&lt;li&gt;When cost and data do not justify the ROI (3 mentions)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The data I can export from my Android phone includes the below. 🟢 indicates it&amp;rsquo;s tracked. 🟡 might need action, e.g. enabling / coding. &lt;a href=&#34;https://chatgpt.com/c/69089221-9430-8320-9cb0-5350a17fc486&#34;&gt;#&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;🟢 GPS/GNSS location (current &amp;amp; history). Turn on device Location. If you want a timeline you can export, enable Google Location History and later export via Google Takeout → Location History (JSON/KML).&lt;/li&gt;
&lt;li&gt;🟡 GNSS raw measurements (engineering traces). Android exposes GNSS “raw” logs on many devices; capture with dev tools or logging apps if supported (intended for research). See GNSS Raw Measurements API.&lt;/li&gt;
&lt;li&gt;🟢 Wi-Fi scans (nearby SSIDs/BSSIDs). Toggle Location scanning → Wi-Fi scanning in Location settings; apps need location permission to read results.&lt;/li&gt;
&lt;li&gt;🟡 Wi-Fi RTT distance to APs (indoor ranging). Apps can use Wi-Fi RTT (802.11mc/az) to measure distance to compatible APs; requires location permission.&lt;/li&gt;
&lt;li&gt;🟢 Bluetooth proximity/traffic. For packet-level logs, enable Developer options → Enable Bluetooth HCI snoop log, then pull &lt;code&gt;/sdcard/btsnoop_hci.log&lt;/code&gt; (Wireshark).&lt;/li&gt;
&lt;li&gt;🟢 Cell towers (IDs, signal strength). Apps can read via TelephonyManager (e.g., &lt;code&gt;getAllCellInfo()&lt;/code&gt;), with appropriate telephony permissions.&lt;/li&gt;
&lt;li&gt;🟢 Activity recognition (walking, running, in vehicle). Apps must request ACTIVITY_RECOGNITION (runtime) from Android 10+.&lt;/li&gt;
&lt;li&gt;🟢 Steps (step counter / detector). Use sensors API; from Android 10+ you must declare ACTIVITY_RECOGNITION to access step counter/step detector.&lt;/li&gt;
&lt;li&gt;🟢 Accelerometer / gyroscope / magnetometer streams. Apps read via SensorManager; some high-rate reads require HIGH_SAMPLING_RATE_SENSORS.&lt;/li&gt;
&lt;li&gt;🟢 Ambient light / proximity. Read via SensorManager; typically no special permission.&lt;/li&gt;
&lt;li&gt;🟢 Google Fit data (steps, workouts, heart rate from wearables, etc.). Manage and export from Google Fit / Google account Download your data.&lt;/li&gt;
&lt;li&gt;🟢 Contacts. MIUI → Settings → System apps → Contacts → Import/Export to .vcf (vCard).&lt;/li&gt;
&lt;li&gt;🟢 Call history / SMS (device). MIUI local/cloud backup can include call logs &amp;amp; messages; export by creating a local/Cloud backup and downloading. Note: 3P apps can’t read call/SMS logs unless they’re the default dialer/SMS.&lt;/li&gt;
&lt;li&gt;🟡 Gmail, Calendar, Contacts (Google). Export via Google Takeout (MBOX/ICS/CSV etc.).&lt;/li&gt;
&lt;li&gt;🟡 WhatsApp / Telegram / Signal chats. Use in-app exports: WhatsApp → Export chat, Telegram Desktop → Export, Signal → encrypted backup.&lt;/li&gt;
&lt;li&gt;🟢 Advertising ID. View/reset in Settings → Google → Ads (wording varies), per Google help on Ad ID reset.&lt;/li&gt;
&lt;li&gt;🟡 Per-app screen time / unlocks / opens. Third-party “usage” apps (e.g., analytics or “digital wellbeing” clones) require Usage Access (PACKAGE_USAGE_STATS). Use Android’s UsageStatsManager or apps that export CSV. Stock Digital Wellbeing does not offer an export.&lt;/li&gt;
&lt;li&gt;🟡 Notification history (last 24h). Settings → Notifications → Notification history → On. OEM-optional, but present on most devices. Viewable once enabled.&lt;/li&gt;
&lt;li&gt;🟡 Notification content stream (live). Grant an app Notification access to capture/export notifications going forward. (User-granted API via NotificationListenerService.) |&lt;/li&gt;
&lt;li&gt;🟢 Per-app data usage (mobile/Wi-Fi). Apps/ADB can query NetworkStatsManager; Settings shows per-app totals. Advanced dumps via &lt;code&gt;adb shell dumpsys netstats&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;🟡 Wi-Fi detailed logs. Developer options → Enable Wi-Fi verbose logging for richer diagnostics.&lt;/li&gt;
&lt;li&gt;🟡 Bluetooth packet logs. Developer options → Enable Bluetooth HCI snoop log; export file and analyze in Wireshark.&lt;/li&gt;
&lt;li&gt;🟢 Per-app storage usage. Apps/ADB can query StorageStatsManager; Settings shows per-app storage.&lt;/li&gt;
&lt;li&gt;🟡 Photo/video metadata (EXIF incl. location). Enable “Save location” in Camera app to embed GPS in EXIF; export files normally (EXIF remains). |&lt;/li&gt;
&lt;li&gt;🟢 Downloads &amp;amp; file metadata. Use a file manager or connect via USB; metadata is in the files themselves. |&lt;/li&gt;
&lt;li&gt;🟢 Battery usage history (per-UID/app), wakelocks, jobs. Generate adb bugreport and analyze with Battery Historian or &lt;code&gt;dumpsys batterystats&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;🟡 System/device logs (logcat). You can view via ADB/Android Studio. Android restricts 3rd-party access to system-wide logs for privacy.&lt;/li&gt;
&lt;li&gt;🟢 Developer quick tiles (Sensors off). Developer options → Quick settings developer tiles → Sensors off to globally cut Camera/Mic &amp;amp; SensorManager sensors on demand.&lt;/li&gt;
&lt;li&gt;🟡 Google Takeout: one-stop export for Location History (Timeline), Gmail (MBOX), Calendar (ICS), Google Photos, Drive, YouTube, Fit, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://play.google.com/store/apps/details?id=com.arlosoft.macrodroid&#34;&gt;MacroDroid&lt;/a&gt;, &lt;a href=&#34;https://play.google.com/store/apps/details?id=com.llamalab.automate&#34;&gt;Automate&lt;/a&gt; and &lt;a href=&#34;https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&#34;&gt;Tasker&lt;/a&gt; sound like powerful Android workflow automation tools. Some uses I can put it to:
&lt;ul&gt;
&lt;li&gt;Automatically upload recordings to Dropbox&lt;/li&gt;
&lt;li&gt;Turn off hotspot when I reach office&lt;/li&gt;
&lt;li&gt;Vibrate if I&amp;rsquo;m walking slowly&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Adding &lt;code&gt;&amp;lt;link rel=&amp;quot;alternate&amp;quot; type=&amp;quot;text/markdown&amp;quot; title=&amp;quot;LLM-friendly version&amp;quot; href=&amp;quot;/llms.txt&amp;quot;&amp;gt;&lt;/code&gt; is an emerging approach for pointing to LLMs.txt. It works. I asked Codex to read the &lt;a href=&#34;https://developers.cloudflare.com/workers/testing/vitest-integration/write-your-first-test/&#34;&gt;CloudFlare vitest page&lt;/a&gt;. It read the file truncating the middle, found the &lt;code&gt;&amp;lt;link rel=&amp;quot;alternate&amp;quot; type=&amp;quot;text/markdown&amp;quot; href=&amp;quot;https://developers.cloudflare.com/workers/testing/vitest-integration/write-your-first-test/index.md&amp;quot;/&lt;/code&gt; link in it, and reasoned &amp;ldquo;Considering fetching markdown instructions&amp;rdquo; and fetched the Markdown page. &lt;a href=&#34;https://www.gilesthomas.com/website-design&#34;&gt;Giles&amp;rsquo; Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/toon-format/toon&#34;&gt;toon&lt;/a&gt; is a YAML-like format that&amp;rsquo;s LLM friendly and especially token-efficient (CSV-like) for tables. You can convert back and forth between JSON and toon.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.youtube.com/watch?v=2kCjSq_l-0s&#34;&gt;Food printing&lt;/a&gt; applies 3D printing techniques to create real food items. Given the art that this can create, I expect at least some adoption in niche restaurants.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/protomaps/PMTiles&#34;&gt;PMTiles&lt;/a&gt; lets you store map tiles as a single-file archive that libraries like MapLibre can read. Useful to avoid tile servers.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://mirrow.app/&#34;&gt;Mirrow&lt;/a&gt; is a CLI SVG animation builder that converts a DSL to animated SVGs. However, it may be easier to use an LLM to create the animated SVG directly with &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/SVG/Guides/SVG_animation_with_SMIL&#34;&gt;SMIL&lt;/a&gt; than learning Mirrow (or teaching the LLM Mirrow).&lt;/li&gt;
&lt;li&gt;⭐ One approach to giving memory (&amp;ldquo;episodic memory&amp;rdquo;) to coding agents is to &lt;a href=&#34;https://blog.fsck.com/2025/10/23/episodic-memory/&#34;&gt;allow them to search their logs&lt;/a&gt;.This gives them access to past discussions about a repo or other repos.&lt;/li&gt;
&lt;li&gt;To &lt;a href=&#34;https://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/configuration.md&#34;&gt;configure Gemini CLI&lt;/a&gt; with an AI router, set:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;quot;security.auth.selectedType&amp;quot;: &amp;quot;gemini-api-key&amp;quot;&lt;/code&gt; in &lt;code&gt;~/.gemini/settings.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;export GOOGLE_GEMINI_BASE_URL=https://llmfoundry.straive.com/gemini/&lt;/code&gt; (or your AI router base URL for Gemini)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;export GEMINI_API_KEY=...&lt;/code&gt; (your AI router API key)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Passing a HAR export to an LLM to build a scraper is a powerful idea! &lt;a href=&#34;https://youtu.be/7NCUE02l1DE?t=516&#34;&gt;Lessons from Diagram Chasing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Addy Osmani&amp;rsquo;s &lt;a href=&#34;https://github.com/addyosmani/gemini-cli-tips&#34;&gt;Gemini CLI tips&lt;/a&gt; are practical guides to using any coding agent, not just Gemini. I learnt about:
&lt;ul&gt;
&lt;li&gt;Run shell commands with &lt;code&gt;!&lt;/code&gt;, e.g. &lt;code&gt;!ls -la&lt;/code&gt; or even &lt;code&gt;!bash&lt;/code&gt;. It&amp;rsquo;s added to the chat.&lt;/li&gt;
&lt;li&gt;On-the-fly tool creation: ask it to write code for the task on the fly.&lt;/li&gt;
&lt;li&gt;Use it for system optimization, e.g. editing dotfiles, system customization, log error analysis, etc.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;GEMINI_SYSTEM_MD=... gemini -p &amp;quot;task&amp;quot; --yolo --format json &amp;lt; input.txt&lt;/code&gt; to run Gemini with a different system prompt and feed it input.txt to run in a pipeline. (FYI: Codex does not send a default system prompt, so there&amp;rsquo;s nothing to override.)&lt;/li&gt;
&lt;li&gt;There is a &lt;a href=&#34;https://github.com/google-gemini/gemini-cli/discussions/categories/show-and-tell?discussions_q=is%3Aopen+category%3A%22Show+and+tell%22+sort%3Atop&#34;&gt;Gemini CLI Show and Tell&lt;/a&gt; thread with examples. This include &lt;a href=&#34;https://github.com/google-gemini/gemini-cli/discussions/7890&#34;&gt;Janitor AI&lt;/a&gt;, a &lt;a href=&#34;https://github.com/google-gemini/gemini-cli/discussions/3965&#34;&gt;Gemini CLI session viewer&lt;/a&gt;, etc.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://codelabs.developers.google.com/gemini-cli-hands-on&#34;&gt;Hands on with Gemini CLI&lt;/a&gt; has several &lt;a href=&#34;https://codelabs.developers.google.com/gemini-cli-hands-on#11&#34;&gt;Use cases to try out&lt;/a&gt;.
&lt;a href=&#34;https://github.com/amitkmaraj/gemini-cli-custom-slash-commands/blob/main/.gemini/commands/photo-rename.toml&#34;&gt;Renaming photos&lt;/a&gt; and
&lt;a href=&#34;https://github.com/amitkmaraj/gemini-cli-custom-slash-commands/blob/main/.gemini/commands/file-organizer.toml&#34;&gt;organizing files&lt;/a&gt; are clever ones.&lt;/li&gt;
&lt;li&gt;AGENTS.md can be used like a decision log - rules, styles, or preferences that evolve over time - on a per-repo basis. Gemini&amp;rsquo;s &lt;code&gt;/memory add&lt;/code&gt; feature helps with this.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gemini --checkpointing&lt;/code&gt; is a useful &amp;ldquo;undo&amp;rdquo; feature. &lt;code&gt;/restore&lt;/code&gt; rolls you back to a specific checkpoint. The overhead is small.&lt;/li&gt;
&lt;li&gt;Caching is only available with API key or Vertex AI, not OAuth login &lt;a href=&#34;https://google-gemini.github.io/gemini-cli/docs/cli/token-caching.html&#34;&gt;as of now&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.s-anand.net/blog/openai-tts-cost/&#34;&gt;OpenAI TTS costs are confusing&lt;/a&gt;. But in short
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://platform.openai.com/docs/models/tts-1&#34;&gt;TTS-1&lt;/a&gt; costs $15 / MChars (max 4,096 chars per request), which ends up at ~86c / hour&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://platform.openai.com/docs/models/gpt-4o-mini-tts&#34;&gt;GPT-4o Mini TTS&lt;/a&gt; costs ~$16 / MChars (max 2K tokens which is ~7,000 chars per request), which ends up at ~88c / hour. Very similar cost, effectively&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://platform.openai.com/docs/models/tts-1-hd&#34;&gt;TTS-1 HD&lt;/a&gt; is twice TTS-1.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;OpenAI has a &lt;a href=&#34;https://platform.openai.com/docs/api-reference/usage/&#34;&gt;usage API&lt;/a&gt; that provides &lt;a href=&#34;https://platform.openai.com/docs/api-reference/usage/cost&#34;&gt;cost&lt;/a&gt; as well as usage for &lt;a href=&#34;https://platform.openai.com/docs/api-reference/usage/completions&#34;&gt;completions&lt;/a&gt;, &lt;a href=&#34;https://platform.openai.com/docs/api-reference/usage/images&#34;&gt;images&lt;/a&gt;, &lt;a href=&#34;https://platform.openai.com/docs/api-reference/usage/audio_speeches&#34;&gt;audio speeches&lt;/a&gt;, etc.
&lt;ul&gt;
&lt;li&gt;These require an &lt;a href=&#34;https://platform.openai.com/settings/organization/admin-keys&#34;&gt;organization admin key&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Cost API: &lt;code&gt;curl &amp;quot;https://api.openai.com/v1/organization/costs?start_time=$TIMESTAMP&amp;amp;project_ids=$PROJECT_ID&amp;amp;group_by=line_item&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Audio speech usage API: &lt;code&gt;curl &amp;quot;https://api.openai.com/v1/organization/usage/audio_speeches?start_time=$TIMESTAMP&amp;amp;project_ids=$PROJECT_ID&amp;amp;group_by=model&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Vibe-Scraping: Write outcomes, not scrapers</title>
      <link>https://www.s-anand.net/blog/vibe-scraping-write-outcomes-not-scrapers/</link>
      <pubDate>Tue, 30 Sep 2025 13:18:20 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/vibe-scraping-write-outcomes-not-scrapers/</guid>
      <description>&lt;p&gt;&lt;img alt=&#34;Vibe-Scraping: Write outcomes, not scrapers&#34; loading=&#34;lazy&#34; src=&#34;https://www.s-anand.net/blog/assets/image-12.webp&#34;&gt;&lt;/p&gt;
&lt;p&gt;There hasn&amp;rsquo;t been a box-office explosion like Dangal in the history of Bollywood. CPI inflation-adjusted to 2024, it is the only film in the ₹3,000 Cr club.&lt;/p&gt;
&lt;p&gt;3 Idiots (2009) is the first member of the ₹1,000 Cr club (2024-inflation-adjusted). The hot streak was 2013-2017: &lt;strong&gt;each&lt;/strong&gt; year, a film crossed that bar: Dhoom 3, PK, Bajrangi Bhaijaan, Dangal, Secret Superstar.&lt;/p&gt;
&lt;p&gt;Since then, we &lt;strong&gt;never&lt;/strong&gt; saw such a release except in 2023 (Jawan, Pathan).&lt;/p&gt;
&lt;p&gt;But this story isn&amp;rsquo;t about the box-office drought. It&amp;rsquo;s about &lt;strong&gt;vibe-scraping&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;To scrape the 1k Cr club data, here&amp;rsquo;s what my process would be in:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2008-2015. Requests + BeautifulSoup in Python. Takes ~1 day.&lt;/li&gt;
&lt;li&gt;2015-2024. Puppeteer. Still takes ~1 day.&lt;/li&gt;
&lt;li&gt;2025-Today. AI writes code. ~2 hours/site. &lt;strong&gt;4x faster&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Today-???. Coding agents &lt;strong&gt;scrape directly&lt;/strong&gt;. ~30 min/site. &lt;strong&gt;16 times faster&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I passed Codex CLI (roughly) this prompt:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Write scrape.py to scrape the highest-grossing films from Wikipedia&amp;rsquo;s list of Hindi films: 1994 to 2024.&lt;br&gt;
Read pages as required. Save results as CSV.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here&amp;rsquo;s what it did.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Read the Wikipedia lists starting &lt;a href=&#34;https://en.wikipedia.org/wiki/List_of_Hindi_films_of_1994&#34;&gt;1994&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Failed on missing BeautifulSoup dependency. I allowed install.&lt;/li&gt;
&lt;li&gt;Discovered that tables below &amp;ldquo;grossing&amp;rdquo; or &amp;ldquo;box office&amp;rdquo; headings are relevant.&lt;/li&gt;
&lt;li&gt;Noticed &amp;ldquo;Rank&amp;rdquo; became “No” in the column header since 2016 and adapted.&lt;/li&gt;
&lt;li&gt;Fixed all errors and generated a clean CSV.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That&amp;rsquo;s… &lt;strong&gt;incredible&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;The code was a by-product. The prompt and evals matter. When sites change, agents can fix the code. Or better agents will rewrite it.&lt;/p&gt;
&lt;p&gt;I guess I&amp;rsquo;ll call this &lt;strong&gt;vibe-scraping&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I also asked Claude Code vibe-code a data story. Here are the links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://sanand0.github.io/datastories/bollywood-top-grossing/&#34;&gt;Visualization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sanand0/datastories/blob/6f6ef4b92adccdb519a8de717ac330268ab4e341/bollywood-top-grossing/&#34;&gt;Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sanand0/datastories/blob/6f6ef4b92adccdb519a8de717ac330268ab4e341/bollywood-top-grossing/prompts/scraper.md&#34;&gt;Scraper chat&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sanand0/datastories/blob/6f6ef4b92adccdb519a8de717ac330268ab4e341/bollywood-top-grossing/prompts/dataviz.md&#34;&gt;Dataviz chat&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;This afternoon, in front of a client, I spoke with Codex:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Write a scrape.py that searches Dutch fashion merchant websites and lists what delivery carriers they use.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;~10 minutes later, we had a table. The client spotted one error that I couldn&amp;rsquo;t have. Expert review still matters. But what&amp;rsquo;s redundant is my 20-year scraping experience!&lt;/p&gt;
&lt;p&gt;If agents can scrape on the fly, what &lt;strong&gt;new&lt;/strong&gt; questions do we ask?&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.linkedin.com/posts/sanand0_there-hasnt-been-a-box-office-explosion-activity-7378964378899054593-X4mP&#34;&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 07 Sep 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-07-sep-2025/</link>
      <pubDate>Sun, 07 Sep 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-07-sep-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A quick way to get the docs for an npm package is &lt;code&gt;npm view package-name readme&lt;/code&gt;. For PyPi, it&amp;rsquo;s &lt;code&gt;curl -s https://pypi.org/pypi/package-name/json | jq -r .info.description&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Searching embeddings of text summaries of images improves vision search a lot. &lt;a href=&#34;https://x.com/jxnlco/status/1964050092312211636?t=sh16G2U8w4Bl0YvQfd0Dnw&#34;&gt;Jason Liu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;LLM vision capabilities are far from enough to click accurately. &lt;a href=&#34;https://theaidigest.org/village/blog/claude-plays-whatever-it-wants&#34;&gt;The AI Digest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;GLM supports the Anthropic API. So it&amp;rsquo;s possible to use Claude Code with GLM 4.5. &lt;a href=&#34;https://docs.z.ai/scenario-example/develop-tools/claude&#34;&gt;z.ai&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://gitingest.com/&#34;&gt;gitingest&lt;/a&gt; has a &lt;a href=&#34;https://github.com/coderamp-labs/gitingest&#34;&gt;CLI&lt;/a&gt;. &lt;code&gt;uvx gitingest https://github.com/owner/repo&lt;/code&gt; fetches the code in the Git repo suitable for passing to an LLM.&lt;/li&gt;
&lt;li&gt;Claude&amp;rsquo;s API has access to a code execution tool via the &lt;code&gt;code-execution-2025-08-25&lt;/code&gt; beta header. It runs Python 3.11 with 1GB RAM and 5GB disk space, with Internet disabled. The containers persist for 30 days and can access uploaded files. &lt;a href=&#34;https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/code-execution-tool&#34;&gt;Anthropic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You can use the &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag in XML to render RSS, as an alternative to XSLT. &lt;a href=&#34;https://jakearchibald.com/2025/making-xml-human-readable-without-xslt/&#34;&gt;Jake Archibald&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.npmjs.com/package/browser-fs-access&#34;&gt;&lt;code&gt;browser-fs-access&lt;/code&gt;&lt;/a&gt; is a ponyfill for the &lt;a href=&#34;https://wicg.github.io/file-system-access/&#34;&gt;File System Access API&lt;/a&gt; and should be the go-to approach for reading and saving files via the browser.&lt;/li&gt;
&lt;li&gt;⭐ To run a Python project directly from GitHub, use &lt;code&gt;uvx --from &amp;quot;git+https://github.com/owner/repo.git@branch&amp;quot; script-name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/conwnet/github1s&#34;&gt;Github1s&lt;/a&gt; is a cool tool. Replace &lt;code&gt;github.com&lt;/code&gt; with &lt;code&gt;github1s.com&lt;/code&gt; to get a VS Code page that opens that repo. It&amp;rsquo;s fast and very useful to browser repos. For example, &lt;a href=&#34;https://github1s.com/sanand0/tools-in-data-science-public&#34;&gt;https://github1s.com/sanand0/tools-in-data-science-public&lt;/a&gt; is my TDS course repo.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;/init&lt;/code&gt; command in Claude Code and Codex CLI aren&amp;rsquo;t up to the mark. I believe a good README.md provides better specs for existing repos. There is a window of opportunity to craft a good prompt to generate this from repos. #ai-coding&lt;/li&gt;
&lt;li&gt;Since LLMs can code, I&amp;rsquo;d love to see useful CI/CD pipelines where the LLM creates / edits code on the fly. LLMOps might take on a new angle - it&amp;rsquo;s not just Ops on LLM apps. It&amp;rsquo;s LLMs as part of DevOps.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML&#34;&gt;&lt;code&gt;insertAdjacentHTML&lt;/code&gt;&lt;/a&gt; is a great API but suffers from XSS vulnerabilities. The &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/TrustedHTML&#34;&gt;TrustedHTML&lt;/a&gt; API is an emerging standard to create sanitized HTML strings.&lt;/li&gt;
&lt;li&gt;Notes from Anthropic&amp;rsquo;s &lt;a href=&#34;https://www.anthropic.com/engineering/multi-agent-research-system&#34;&gt;How we built our multi-agent research system&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Multi-agent systems are like organizations that can do more than a single human.&lt;/li&gt;
&lt;li&gt;Multi-agent systems conserve the context window.&lt;/li&gt;
&lt;li&gt;The top 3 drivers of performance variance: spending more tokens, more tool calls, better models&lt;/li&gt;
&lt;li&gt;You need to teach (prompt) the orchestrator how to delegate to sub-agents
&lt;ul&gt;
&lt;li&gt;How to avoid task duplication among agents&lt;/li&gt;
&lt;li&gt;How many sub-agents to spin up for different kinds of tasks&lt;/li&gt;
&lt;li&gt;Which tools to use for what&lt;/li&gt;
&lt;li&gt;Provide sub-agents objective, output format, tools/sources, clear task boundaries&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;⭐ Self-improving agents, e.g. prompt optimizers or tool-testing agents that run and rewrite tool descriptions, are powerful&lt;/li&gt;
&lt;li&gt;Since agents are stateful, resuming from failure is important.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/anthropics/anthropic-cookbook/tree/main/patterns/agents/prompts&#34;&gt;Agent prompts&lt;/a&gt; are public&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Claude models support &lt;a href=&#34;https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking#interleaved-thinking&#34;&gt;interleaved thinking&lt;/a&gt; that lets them think between tool calls via an &lt;code&gt;anthropic-beta: interleaved-thinking-2025-05-14&lt;/code&gt; header. OpenAI models natively think between tool calls, preserving thinking across calls with the Reasoning API. Gemini lets you control the amount of thinking between tool calls via the &lt;code&gt;thinkingBudget&lt;/code&gt; parameter.&lt;/li&gt;
&lt;li&gt;Anthropic auto-extracts &lt;a href=&#34;https://www.anthropic.com/research/persona-vectors&#34;&gt;persona vectors&lt;/a&gt; or traits by generating LLM responses to the same question with system prompt A (&amp;ldquo;You are evil&amp;rdquo;) and B (&amp;ldquo;You are helpful&amp;rdquo;) and subtracting the average activations. This helps monitor personality drifts during training, deployment, and even in training data.&lt;/li&gt;
&lt;li&gt;From &lt;a href=&#34;https://efitz-thoughts.blogspot.com/2025/08/my-experience-creating-software-with_22.html&#34;&gt;My experience creating software with LLM coding agents - Part 2 (Tips)&lt;/a&gt; #ai-coding
&lt;ul&gt;
&lt;li&gt;Use standards. Or, write your standards in README.md and tell AGENTS.md / CLAUDE.md to read it.
&lt;ul&gt;
&lt;li&gt;Use a standard file structure. Or in README.md, list what each file is for. Helps agents pick the right file for context.&lt;/li&gt;
&lt;li&gt;Use a standard build/lint/test setup (e.g. package.json scripts). Or&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Localize context, i.e. add context in files that use them. E.g. add comments in test files on how to execute them.&lt;/li&gt;
&lt;li&gt;Keep files modular so agents can read less code and conserver context.&lt;/li&gt;
&lt;li&gt;Write a developer&amp;rsquo;s guide.
&lt;ul&gt;
&lt;li&gt;Use with &lt;code&gt;/init&lt;/code&gt; in Claude Code / Codex / &amp;hellip; or have an LLM generate a developer guide.&lt;/li&gt;
&lt;li&gt;Edit manually. Agents don&amp;rsquo;t write great specs.&lt;/li&gt;
&lt;li&gt;Document the design.&lt;/li&gt;
&lt;li&gt;Write DETAILED specs to reduce deviations.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Share goal while specifying tasks. Helps agents fix related stuff.&lt;/li&gt;
&lt;li&gt;Use deep reasoning mode, e.g. &amp;ldquo;think harder&amp;rdquo; or &amp;ldquo;ultrathink&amp;rdquo; in Claude Code, or &lt;code&gt;-c model_reasoning_effort=high&lt;/code&gt; in Codex.&lt;/li&gt;
&lt;li&gt;⭐ Run parallel agents in different windows and share agent feedback with each other. E.g.
&lt;ul&gt;
&lt;li&gt;Server/API coding in one window. Client coding in another.&lt;/li&gt;
&lt;li&gt;Plan/ask in one window. Execute in another.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add debug logs to help agents spot errors.
&lt;ul&gt;
&lt;li&gt;Start/stop of long/complex operations, state changes, external interfaces.&lt;/li&gt;
&lt;li&gt;Include full objects in logs. Prioritize diffs. Trim long contents.&lt;/li&gt;
&lt;li&gt;⭐ Give access to debugger, e.g. Chrome remote debugging at localhost:9222&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Agents write poor tests. So:
&lt;ul&gt;
&lt;li&gt;Manually add important ones.&lt;/li&gt;
&lt;li&gt;⭐ When you find a bug, ask the agent why the tests missed it and have it add.&lt;/li&gt;
&lt;li&gt;Review and remove useless ones.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ensure agent passes test cases. Tell them not to disable / skip failed tests.&lt;/li&gt;
&lt;li&gt;Have agents create a new branch per feature and auto-commit. Merge when successful.&lt;/li&gt;
&lt;li&gt;Feel free to provide a TODO list or update it on the fly.&lt;/li&gt;
&lt;li&gt;Interrupt with Esc if the agent&amp;rsquo;s thinking is off-track.&lt;/li&gt;
&lt;li&gt;When agents struggle, write tools to help them, e.g. JSON splicing, Excel edits, etc.&lt;/li&gt;
&lt;li&gt;Agents bloat code and features. Explicitly refactor and trim.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;From &lt;a href=&#34;https://www.stochasticlifestyle.com/a-guide-to-gen-ai-llm-vibecoding-for-expert-programmers/&#34;&gt;A Guide to Gen AI / LLM Vibecoding for Expert Programmers&lt;/a&gt; #ai-coding
&lt;ul&gt;
&lt;li&gt;Use vibe coding for stuff you don&amp;rsquo;t need to maintain.&lt;/li&gt;
&lt;li&gt;Use vibe coding for stuff you know well enough to review quickly.&lt;/li&gt;
&lt;li&gt;Use vibe coding for &lt;em&gt;independent&lt;/em&gt; tasks where you&amp;rsquo;re not fussed which ones fail.&lt;/li&gt;
&lt;li&gt;Vibe coding turns everyone into a team lead. That needs skills: planning, allocation, design, review, feedback, &amp;hellip;&lt;/li&gt;
&lt;li&gt;⭐ Empathy enables vibe-coding. Empaths allocate work by ability, review regularly, and provide detailed specs and feedback.&lt;/li&gt;
&lt;li&gt;Have LLMs plan and allocate tasks.
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;Read this repo. Suggest improvements.&amp;rdquo; (Review.) &amp;ldquo;Add these as issues.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&amp;ldquo;Add the top 3 Sentry log errors as issues.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&amp;ldquo;Find the easiest issue and solve it with a PR.&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Use GitHub issues extensively for planning.&lt;/li&gt;
&lt;li&gt;⭐ Create a separate GitHub account for your agent! Let it push. Assign it issues. Treat it like an intern.&lt;/li&gt;
&lt;li&gt;Ensure agent passes test cases and run till the do, or report the core difficulty.&lt;/li&gt;
&lt;li&gt;Throw away rubbish code and start again.&lt;/li&gt;
&lt;li&gt;Issues unsolved in 2-3 tries are too hard for agents or are poorly spec-ed.&lt;/li&gt;
&lt;li&gt;The &lt;a href=&#34;https://github.com/upstash/context7&#34;&gt;context7&lt;/a&gt; and &lt;a href=&#34;https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking&#34;&gt;Sequential Thinking&lt;/a&gt; MCPs are useful.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;a href=&#34;https://www.onetcenter.org/db_releases.html&#34;&gt;O*NET database&lt;/a&gt; has a list of tasks/activities, skills, titles, &amp;hellip; for each job, at least in the US. It has been updated every few months since 2003. It&amp;rsquo;s an excellent source to analyze things like the impact of AI across jobs. Anthropic &lt;a href=&#34;https://www.anthropic.com/news/anthropic-education-report-how-educators-use-claude&#34;&gt;used&lt;/a&gt; it to map Claude.ai conversations with educator tasks to identify how educators are using AI.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.anthropic.com/news/anthropic-education-report-how-educators-use-claude&#34;&gt;How educators use Claude&lt;/a&gt; (apart from learning) is mainly driven by &lt;strong&gt;automation&lt;/strong&gt; of tedious tasks, &lt;strong&gt;ideation&lt;/strong&gt;, and &lt;strong&gt;personalization&lt;/strong&gt; for each student.
&lt;ol&gt;
&lt;li&gt;Curriculum development: Develop games, interactive tools, MCQs, simulations, content&lt;/li&gt;
&lt;li&gt;Academic research: Bibliographies, statistical modeling, revisions from feedback.&lt;/li&gt;
&lt;li&gt;Assessments: Student feedback, scoring, summarization.&lt;/li&gt;
&lt;li&gt;Administration: recommendation letters, meeting agendas, admin tools.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;OpenAI used &lt;a href=&#34;https://huggingface.co/datasets/openai/collective-alignment-1&#34;&gt;feedback from ~1000 annotators&lt;/a&gt; to &lt;a href=&#34;https://openai.com/index/collective-alignment-aug-2025-updates/&#34;&gt;update&lt;/a&gt; their &lt;a href=&#34;https://model-spec.openai.com/2025-04-11.html&#34;&gt;model spec&lt;/a&gt;. Learnings:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Request targeted feedback&lt;/strong&gt;. Annotators reviewed responses &lt;em&gt;pre-selected&lt;/em&gt; for subjectivity against a &lt;em&gt;pre-selected&lt;/em&gt; rubric ()&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;More examples&lt;/strong&gt;. Most improvements add examples of good and bad responses.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use detailed prompts&lt;/strong&gt;. Newer models do well with HUGE system prompts. That&amp;rsquo;s how we frame better questions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.thegreatrefactor.org/&#34;&gt;The Great Refactor&lt;/a&gt; is refactoring critical open-source C code to Rust using Claude Code, since 70% of vulnerabilities are memory related and Rust is memory-safe. No repo/docs yet. #ai-coding&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 31 Aug 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-31-aug-2025/</link>
      <pubDate>Sun, 31 Aug 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-31-aug-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;⭐ &lt;strong&gt;Habit tooling&lt;/strong&gt; can expand habit-building capacity. I already use tools to support my habits. &lt;a href=&#34;https://jamesclear.com/habit-stacking&#34;&gt;Habit stacking&lt;/a&gt; &amp;ldquo;sticks&amp;rdquo; new habits to old ones. By sticking new habits into existing tools, I can automate this. (For example, I extended my meeting &lt;code&gt;record&lt;/code&gt; fish script with an &lt;code&gt;echo&lt;/code&gt; reminding me to write the meeting goal, my role, practice kind candor, and measure effectiveness.)&lt;/li&gt;
&lt;li&gt;⭐ The crux of Arthashastra&amp;rsquo;s advice on defeating an enemy is removing support:
&lt;ul&gt;
&lt;li&gt;मित्राणि भेदयेत्, मित्रं च शत्रोः। Dis-unite friends, enemies from their allies.&lt;/li&gt;
&lt;li&gt;अमात्यान् द्रव्यैः, जनपदं भेदयेत्। Bribe their ministers, sow discord among subjects.&lt;/li&gt;
&lt;li&gt;बलं चोच्छिनत्ति, कोशं चोपशोषयेत्। Break the army, exhaust the treasury.&lt;/li&gt;
&lt;li&gt;ततोऽन्योन्यवैरिणं कुर्यात्। Then set them against each other as mutual foes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Consensus is dangerous in venture capital. &amp;ldquo;Because if everyone inside the firm sees the same thing, it probably means the market already does too. And when the market sees it, the upside is limited.&amp;rdquo; &lt;a href=&#34;https://www.linkedin.com/posts/guillermoflor_consensus-is-dangerous-in-venture-capital-ugcPost-7365751724503875584--eZN&#34;&gt;Guillermo Flor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;This &lt;a href=&#34;https://arxiv.org/abs/2501.14723&#34;&gt;CodeMonkeys paper&lt;/a&gt; suggests running a &lt;a href=&#34;https://docs.together.ai/docs/mixture-of-agents&#34;&gt;mixture of agents&lt;/a&gt; in parallel for multiple code + test tasks and auto-pick the best by running and LLM-rewriting tests. #ai-coding&lt;/li&gt;
&lt;li&gt;We think a new pricing model &lt;em&gt;might&lt;/em&gt; emerge for outsourced knowledge work that leads to lower client cost &amp;amp; quality at higher margins. &lt;a href=&#34;https://chatgpt.com/c/68b2f9ea-2e68-832e-8aa1-1e0fed5fb0c3&#34;&gt;ChatGPT&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;LLMs do the task; multiple LLMs cross-check.&lt;/li&gt;
&lt;li&gt;Three tiers: &lt;strong&gt;Auto-pass&lt;/strong&gt; (no human), &lt;strong&gt;Light review&lt;/strong&gt;, &lt;strong&gt;Full review&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Each tier has a clear &lt;strong&gt;price&lt;/strong&gt; and &lt;strong&gt;SLA&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Using LLMs as validators is one of the safest ways of introducing LLMs into a process. If the human ignores it, no loss. If it spots new errors or the human gets new ideas, quality improves at low cost.&lt;/li&gt;
&lt;li&gt;I finally get why elders in my family prefers eating in a pure (rather than a mixed) vegetarian restaurant. When in Vietnam, I could pick dishes in pure vegetarian restaurants without worrying about whether they were meat or not, even when I didn&amp;rsquo;t understand what the dishes were about. That confidence to proceed without fear is a powerful enabler.&lt;/li&gt;
&lt;li&gt;There&amp;rsquo;s emerging evidence that jobs &lt;em&gt;automated&lt;/em&gt; by (not augmented or unaffected by) AI have fewer entry-level jobs. Experienced workers are less affected. Compensation is affected less. &lt;a href=&#34;https://digitaleconomy.stanford.edu/publications/canaries-in-the-coal-mine/&#34;&gt;Canaries in the Coal Mine&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developers.cloudflare.com/autorag/&#34;&gt;CloudFlare AutoRAG&lt;/a&gt; lets you index any website and expose it as an API + Chatbot with a model of your choice. This is available on the free tier, too. The API follows &lt;a href=&#34;https://github.com/nlweb-ai/NLWeb&#34;&gt;NLWeb&lt;/a&gt;, Microsoft&amp;rsquo;s open standard for LLMs and MCPs to interact with websites in natural language.&lt;/li&gt;
&lt;li&gt;Cloudflare has an &lt;a href=&#34;https://developers.cloudflare.com/images/transform-images/transform-via-url/&#34;&gt;image transformation API&lt;/a&gt; that also acts as a CDN. Apart from basic transformations, it can auto detect and crop faces, remove backgrounds, and more.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch&#34;&gt;oklch&lt;/a&gt; seems the &lt;a href=&#34;https://jakub.kr/components/oklch-colors&#34;&gt;best color model&lt;/a&gt; supported by all modern browsers. We can use relative colors with it, making color palette design &lt;em&gt;much&lt;/em&gt; easier:
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;darker-color&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;background-color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;oklch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;var&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;--&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;base&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;color&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;calc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;l&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;0.15&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;c&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;h&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;Malware embedded in the compromised &lt;code&gt;nx&lt;/code&gt; build tool leveraged Claude/Gemini CLI to offload fingerprintable password-gathering code into prompts, making detection significantly harder for traditional security tools. &lt;a href=&#34;https://semgrep.dev/blog/2025/security-alert-nx-compromised-to-steal-wallets-and-credentials/&#34;&gt;semgrep&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developers.openai.com/codex/cli/&#34;&gt;Codex CLI&lt;/a&gt; has &lt;a href=&#34;https://github.com/openai/codex/releases/tag/rust-v0.24.0&#34;&gt;several updates&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://developers.openai.com/codex/ide&#34;&gt;VS Code plugin&lt;/a&gt; with remote container execution&lt;/li&gt;
&lt;li&gt;Drag &amp;amp; drop image support &lt;a href=&#34;https://github.com/openai/codex/pull/2567&#34;&gt;PR&lt;/a&gt; &lt;a href=&#34;https://github.com/openai/codex/blob/main/docs/getting-started.md#image-input&#34;&gt;Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Queued (editable) messages &lt;a href=&#34;https://github.com/openai/codex/pull/2637&#34;&gt;PR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Web search via &lt;code&gt;--search&lt;/code&gt; &lt;a href=&#34;https://github.com/openai/codex/pull/2371&#34;&gt;PR&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Esc-Esc&lt;/code&gt; to edit previous messages &lt;a href=&#34;https://github.com/openai/codex/blob/main/docs/getting-started.md#escesc-to-edit-a-previous-message&#34;&gt;Docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Our team passed an image to an LLM for OCR (especially to identify formatting, e.g. bold, italics, etc.), then passed the output &lt;em&gt;and&lt;/em&gt; the image to another LLM for improvement. Interestingly, the best LLM (Gemini 2.5 Pro, for this sample of 8 images) out-performed the two-stage workflow. Perhaps incorrect results confuse more than the correct results help? This needs more research.&lt;/li&gt;
&lt;li&gt;OpenAI now has a series of &lt;a href=&#34;https://cdn.openai.com/API/docs/txt/llms.txt&#34;&gt;llms.txt&lt;/a&gt; URLs.&lt;/li&gt;
&lt;li&gt;Rust seems to catch errors better at compile-time than many typed languages like TypeScript. That makes it better for larger projects (or for AI coding). &lt;a href=&#34;https://lubeno.dev/blog/rusts-productivity-curve&#34;&gt;The unexpected productivity boost of Rust&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Image APIs that support hotlinking and searching (useful to support LLM-generated content, e.g. slides or presentations):
&lt;ol&gt;
&lt;li&gt;Openverse: CC, scale, simple REST.&lt;/li&gt;
&lt;li&gt;Wikimedia Commons: CC, historic/diagram breadth.&lt;/li&gt;
&lt;li&gt;Pixabay: easy, free, broad, but license fuzzier.&lt;/li&gt;
&lt;li&gt;Pexels: beautiful but custom license.&lt;/li&gt;
&lt;li&gt;Unsplash: stylish but restrictive.&lt;/li&gt;
&lt;li&gt;OpenClipart: niche, useful for icons.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;⭐ For mental tiredness, the impact of sleep &amp;gt; workload &amp;gt; mood/stress &amp;gt; environment (travel, light, air) &amp;gt; posture &amp;gt; food/drink.
To rebound, nap &amp;gt; bright light &amp;gt; exercise &amp;gt; fresh air &amp;gt; water &amp;gt; posture/breathing. &lt;a href=&#34;https://chatgpt.com/share/68ae6f42-52a4-800c-b27d-6215e9bd9b89&#34;&gt;ChatGPT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;In my internal meetings, I tend to ask many questions (1 per 8 turns), but fewer open-ended ones (~40%) compared with others. I also praise once every 22 turns - among the lowest in our group. I could ask more open-ended questions and acknowledge good work. &lt;a href=&#34;https://chatgpt.com/c/68ae4c2f-fff4-8329-adff-7e95af88b2ab&#34;&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;When seeking advice, people sometimes think aloud, become repetitive, and introduce detail before clarifying intent. Kind candor helps. You can:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;State time boundaries&lt;/strong&gt;. &amp;ldquo;We have 20 min. If we spend 5 min on your question, we&amp;rsquo;ll have 15 for solutions.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clarify intent upfront&lt;/strong&gt;. &amp;ldquo;Before we dive in: &lt;em&gt;What can I help with&lt;/em&gt;?&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Interrupt, summarize, clarify &lt;em&gt;early&lt;/em&gt;&lt;/strong&gt;. &amp;ldquo;Cooperative interruptions&amp;rdquo; are seen as supportive. E.g. &amp;ldquo;I get this: six accelerators, two done. Great! &lt;em&gt;What can I help with&lt;/em&gt;? To accelerate?&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://rclone.org/&#34;&gt;rclone&lt;/a&gt; is the cleanest way to copy files from Google Drive. I ran &lt;code&gt;rclone config&lt;/code&gt; to set it up with Google Drive via &lt;a href=&#34;https://developers.google.com/identity/protocols/oauth2/native-app&#34;&gt;native app OAuth key&lt;/a&gt;. Then, &lt;code&gt;rclone copy &amp;quot;gdrive:&amp;quot; transcripts/ --drive-shared-with-me --include &amp;quot;**Transcript*.docx&amp;quot;&lt;/code&gt; copied all transcripts &lt;em&gt;including&lt;/em&gt; &amp;ldquo;Shared with me&amp;rdquo; files (not just drives). The &lt;code&gt;--drive-shared-with-me&lt;/code&gt; enables this.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://minusx.ai/blog/decoding-claude-code/&#34;&gt;What makes Claude Code so damn good&lt;/a&gt; has a &lt;em&gt;detailed&lt;/em&gt; review of Claude Code&amp;rsquo;s system prompt and is a great for ideas on using LLMs for coding. #ai-coding&lt;/li&gt;
&lt;li&gt;With AI coding, task breakdown, context right-sizing, and automated testing are key levers. #ai-coding&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Meta AI Coding: Using AI to Prompt AI</title>
      <link>https://www.s-anand.net/blog/meta-ai-coding-using-ai-to-prompt-ai/</link>
      <pubDate>Wed, 13 Aug 2025 09:43:24 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/meta-ai-coding-using-ai-to-prompt-ai/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m &amp;ldquo;meta AI coding&amp;rdquo; &amp;ndash; using an AI code editor to create the prompt for an AI code editor.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Time&lt;/strong&gt;. The task is complex. If the LLM (or I) mess up, I don&amp;rsquo;t want re-work. Review time is a bottleneck.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cost&lt;/strong&gt;. Codex is free on my $20 OpenAI plan. Claude Code is ~$1 per chat, so I want value.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Learning&lt;/strong&gt;. I want to see what a &lt;strong&gt;good&lt;/strong&gt; prompt looks like.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, I wrote a rough prompt in &lt;code&gt;prompts.md&lt;/code&gt;, told Codex:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;prompts.md has a prompt under the &amp;ldquo;# Improve schema&amp;rdquo; section starting line 294.&lt;br&gt;
This is a prompt that will be passed to Claude Code to implement.&lt;br&gt;
Ask me questions as required and improve the prompt so that the results will be in line with my expectations, one-shot.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Codex answered:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I read the “Improve schema” section. A few specifics need your call so I can produce a single, precise prompt.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Masters vs layouts: Remove masters entirely and keep a &lt;code&gt;layouts[]&lt;/code&gt;, or remove layouts and keep &lt;code&gt;masters[]&lt;/code&gt; with &lt;code&gt;shapes&lt;/code&gt; acting as the layout? The bullets conflict.&lt;/li&gt;
&lt;li&gt;Shape registry: Confirm &lt;code&gt;.shapes&lt;/code&gt; is an object map keyed by &lt;code&gt;id&lt;/code&gt; at every level (root, master/layout, slide), not arrays. Ordering via &lt;code&gt;z&lt;/code&gt; only?&lt;/li&gt;
&lt;li&gt;Merge semantics: Confirm deep-merge precedence root.shapes &amp;lt; mid-level (master/layout).shapes &amp;lt; slide.shapes, by &lt;code&gt;id&lt;/code&gt;. For arrays like &lt;code&gt;list.items&lt;/code&gt;, replace (not concat)?&lt;/li&gt;
&lt;li&gt;Theme flattening: Move &lt;code&gt;theme.colors&lt;/code&gt; and &lt;code&gt;theme.fonts&lt;/code&gt; to root as &lt;code&gt;colors&lt;/code&gt; and &lt;code&gt;fonts&lt;/code&gt;, or keep &lt;code&gt;theme&lt;/code&gt; but allow root aliases? Which do you prefer?&lt;/li&gt;
&lt;li&gt;Back-compat: Keep support for old schema, or drop and add a migration utility (CLI/script) to transform old→new? If keep, how long to maintain?&lt;/li&gt;
&lt;li&gt;Version: Bump to &lt;code&gt;version: \&amp;quot;2.0.0\&amp;quot;&lt;/code&gt; for the new schema?&lt;/li&gt;
&lt;li&gt;Validation: Add a JSON Schema file and validate inputs in &lt;code&gt;slidegen.html()&lt;/code&gt; (fast fail)? If yes, filename path e.g., &lt;code&gt;schema/slidegen.schema.json&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;Tests and samples: Update all decks in &lt;code&gt;tests/&lt;/code&gt; (incl. &lt;code&gt;shapes-demo.json&lt;/code&gt;) and &lt;code&gt;tests/index.html&lt;/code&gt; to new schema only?&lt;/li&gt;
&lt;li&gt;Overrides removal: Confirm &lt;code&gt;slides[].overrides&lt;/code&gt; is removed entirely; all overrides via &lt;code&gt;slides[].shapes&lt;/code&gt; only.&lt;/li&gt;
&lt;li&gt;Any additional fields to normalize while we’re here (e.g., unify &lt;code&gt;unit&lt;/code&gt;, enforce &lt;code&gt;%|px&lt;/code&gt;, formalize border props)?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Reply with your choices. I’ll then deliver a single, one-shot prompt for Claude Code with exact schema, merge rules, migration plan, test updates, and acceptance criteria aligned to your coding guidelines.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I replied:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;masters versus layouts: I want you to remove masters entirely and keep a layouts[]. There currently are layouts inside masters, move them up to one level.&lt;/li&gt;
&lt;li&gt;.shapes is not an object map currently. It SHOULD be an object map keyed by &lt;code&gt;id&lt;/code&gt; at every level and not arrays and it should be ordered via z only.&lt;/li&gt;
&lt;li&gt;The deep merge precedence that you have listed is correct.&lt;/li&gt;
&lt;li&gt;For list.items replacement instead of concatenation is correct.&lt;/li&gt;
&lt;li&gt;Since we are flattening the themes, we do not want theme at the root level and we do not want theme.colors/fonts aliases.&lt;/li&gt;
&lt;li&gt;We do not want to support old schema.&lt;/li&gt;
&lt;li&gt;We do not want to migrate from old schema.&lt;/li&gt;
&lt;li&gt;We do not want to bump up the version.&lt;/li&gt;
&lt;li&gt;We do not want to create a json schema file.&lt;/li&gt;
&lt;li&gt;We do want to update all the tests including shapes-demo.json.&lt;/li&gt;
&lt;li&gt;We do want to remove slides.overrides entirely, no other fields to normalize.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you have any other questions, please ask. Else update prompts.md&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Codex gave an output. I reviewed it and sent one more prompt:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Drop the house rules.&lt;br&gt;
Allow the root .bg to be overridden by layouts[].bg to be overridden by slides[].bg &amp;ndash; and all the .bg values can be { fille, image, image_fit }&lt;br&gt;
layouts must be an object with the .id as key instead of a field. If any of this is unclear, please ask me. Else update prompts.md.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It finally settled on &lt;a href=&#34;https://github.com/sanand0/slidegen/blame/de953817266357b00d80d4fa3e17def02e0de292/prompts.md#L296-L502&#34;&gt;this remarkable prompt&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This prompt was so clear it was &lt;strong&gt;easy to review&lt;/strong&gt; &lt;strong&gt;and&lt;/strong&gt; &lt;strong&gt;easy for Claude Code&lt;/strong&gt; to follow (no inconsistencies).&lt;/p&gt;
&lt;p&gt;I plan to use this technique more. You might want to try it, too.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 10 Aug 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-10-aug-2025/</link>
      <pubDate>Sun, 10 Aug 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-10-aug-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OpenAI supports a tool &lt;code&gt;&amp;quot;type&amp;quot;: &amp;quot;custom&amp;quot;&lt;/code&gt; that lets it write code as an argument to a tool call. Great for code / SQL generation. Even more powerfully, you can generate output following specific grammars, e.g. STL files, PostgreSQL dialect, Mermaid/PlantUML diagrams, OpenAPI specs, Vega-Lite JSONs, Cron expressions, GraphQL SDLs, Dockerfiles, Terraform HCLs, or any DSL! &lt;a href=&#34;https://cookbook.openai.com/examples/gpt-5/gpt-5_new_params_and_tools&#34;&gt;#&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;The OpenAI playground has a &lt;a href=&#34;https://platform.openai.com/chat/edit?models=gpt-5&amp;amp;optimize=true&#34;&gt;GPT-5 Prompt Optimizer&lt;/a&gt; that can migrate prompts to GPT-5.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.npmjs.com/package/docsify/v/4.13.1&#34;&gt;Docsify 4.13.1&lt;/a&gt; is 2 years old and &lt;a href=&#34;https://github.com/docsifyjs/docsify/blob/v4.13.1/package.json#L68&#34;&gt;uses&lt;/a&gt; &lt;a href=&#34;https://www.npmjs.com/package/marked/v/1.2.9&#34;&gt;marked@1.2.9&lt;/a&gt; which is 5 years old. Newer plugins like &lt;a href=&#34;https://www.npmjs.com/package/marked-directive&#34;&gt;marked-directive&lt;/a&gt; don&amp;rsquo;t work with it. Though &lt;a href=&#34;https://github.com/docsifyjs/docsify/tree/v5.0.0-rc.1&#34;&gt;docsify v5.0.0-rc1&lt;/a&gt; is in development, it may be the better option for modern Markdown plugins. &lt;a href=&#34;https://github.com/sanand0/smartart/blob/e4c5bb88eba3aa3cd92d6711a9e29935cc36e62f/script.js&#34;&gt;Here&amp;rsquo;s sample code&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;CommonMark has a &lt;em&gt;powerful&lt;/em&gt; &lt;a href=&#34;https://talk.commonmark.org/t/generic-directives-plugins-syntax/444&#34;&gt;directive syntax&lt;/a&gt; proposal that lets you add classes, attributes, and arbitrary plugins to Markdown. For example, &lt;code&gt;:abbr[MD]{#id .class title=&amp;quot;Markdown&amp;quot;}&lt;/code&gt; for inline directives. Plugins exist for &lt;a href=&#34;https://www.npmjs.com/package/marked-directive&#34;&gt;marked&lt;/a&gt;, &lt;a href=&#34;http://npmjs.com/package/markdown-it-directive&#34;&gt;markdown-it&lt;/a&gt; and &lt;a href=&#34;https://github.com/remarkjs/remark-directive&#34;&gt;remark&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://biomejs.dev/&#34;&gt;biomejs&lt;/a&gt; and &lt;a href=&#34;https://dprint.dev/&#34;&gt;dprint&lt;/a&gt; are gaining traction as &lt;a href=&#34;https://prettier.io/&#34;&gt;prettier&lt;/a&gt; alternatives. I&amp;rsquo;m yet to try them but keen to explore.
&lt;ul&gt;
&lt;li&gt;Skip biomejs for now. It uses tabs (not spaces) and does not respect .gitignore by default. Handling these is too much work.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;⭐ Code generation is more flexible than tool calling. LLMs can&amp;rsquo;t write a tool-call loop, for example, but they can write code to run an API in a loop. So, I like telling the LLM to &amp;ldquo;write code using these APIs&amp;rdquo; than giving it APIs to tool-call. #ai-coding&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npx -y ccusage&lt;/code&gt; is an easy way of summarizing your &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/overview&#34;&gt;Claude Code&lt;/a&gt; usage and cost. My cost so far (since 21 July) is about $10. The median session cost is ~50 cents. Most of it ($7) was from a single temporary coding chat that I kept continuing for way too long, building up the context window. &lt;a href=&#34;https://github.com/ryoppippi/ccusage&#34;&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/kepano/defuddle&#34;&gt;defuddle&lt;/a&gt; can be used in the browser to get the main content from web pages. A replacement for Mozilla Readability. &lt;a href=&#34;https://stephango.com/defuddle&#34;&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://kashw1n.com/blog/nodejs-2025/&#34;&gt;Modern Node.js Patterns for 2025&lt;/a&gt; include these 5 features I&amp;rsquo;m excited by:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Single-executable bundling&lt;/strong&gt;. &lt;code&gt;node --experimental-sea-config sea-config.json&lt;/code&gt; builds standalone binaries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ES Modules&lt;/strong&gt;. Use &lt;code&gt;node:&lt;/code&gt; prefix for built-in imports. &lt;code&gt;import { createServer } from &#39;node:http&#39;;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Watch mode&lt;/strong&gt;. Use &lt;code&gt;node --watch file.js&lt;/code&gt; auto-reloads when &lt;code&gt;file.js&lt;/code&gt; or dependencies change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Env file&lt;/strong&gt;. Use &lt;code&gt;node --env-file=.env&lt;/code&gt; loads &lt;code&gt;.env&lt;/code&gt; as environment variables.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;node:test&lt;/code&gt;&lt;/strong&gt; is a full-featured test framework with &lt;code&gt;--watch&lt;/code&gt; and coverage.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Concise explanations speed up decisions because they&amp;rsquo;re faster to read and understand (obvious). They&amp;rsquo;re also easier to combine with other ideas (less obvious). &lt;a href=&#34;https://stephango.com/concise&#34;&gt;#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;ve been uncertain about &lt;a href=&#34;https://htmx.org/&#34;&gt;htmx&lt;/a&gt; for some time now. This tutorial, &lt;a href=&#34;https://github.com/BookOfCooks/blog/blob/master/htmx-is-hard-so-lets-get-it-right.md&#34;&gt;HTMX is hard, so let&amp;rsquo;s get it right&lt;/a&gt;, convinced me that it&amp;rsquo;s too far from my mental model, so I&amp;rsquo;m unlikely to ever use it.&lt;/li&gt;
&lt;li&gt;⭐ Slow, effortful practice (spaced recall, interleaving topics, self-testing) builds lasting knowledge but looks inefficient and doesn&amp;rsquo;t help with exams. &lt;a href=&#34;https://chatgpt.com/share/689180c7-03a0-800c-a5d4-5a455429e97f&#34;&gt;#&lt;/a&gt; #beliefs&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=vsls-contrib.gitdoc&#34;&gt;GitDoc VS Code extension&lt;/a&gt; auto-commits and syncs notes. I dropped &lt;a href=&#34;https://github.com/gitwatch/gitwatch&#34;&gt;gitwatch&lt;/a&gt; in favor of this.&lt;/li&gt;
&lt;li&gt;It&amp;rsquo;s interesting that Gemini Deep Research cannot access Google Drive while Gemini can. On the other hand, ChatGPT Deep Research can access Google Drive but ChatGPT cannot.&lt;/li&gt;
&lt;li&gt;A trend that AI coding will only accelerate: &amp;ldquo;It is now possible for tiny teams to make principled software that millions of people use, unburdened by investors. &amp;hellip; you need far less money and far fewer employees to reach far more customers. That wave is only just beginning.&amp;rdquo; &lt;a href=&#34;https://stephango.com/vcware&#34;&gt;#&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Typed languages are better suited for vibe coding. This will likely lead to the growth of typed languages (TypeScript, Rust, Go) but also of typing in untyped languages (e.g. Python) &lt;a href=&#34;https://solmaz.io/typed-languages-are-better-suited-for-vibecoding&#34;&gt;#&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Instead of Celery, Redis, Kafka, etc. as task queues, we could the file system as a message queue. For example, &lt;code&gt;pending/task-01.json&lt;/code&gt; moves to &lt;code&gt;wip/task-01.json&lt;/code&gt; to &lt;code&gt;done/task-01.json&lt;/code&gt;. Folders for state/tags, files for task details.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://foambubble.github.io/&#34;&gt;Foam&lt;/a&gt; is a note-taking VS Code extension. The &lt;a href=&#34;https://foambubble.github.io/foam/user/features/wikilinks&#34;&gt;WikiLinks&lt;/a&gt;, &lt;a href=&#34;https://foambubble.github.io/foam/user/features/tags&#34;&gt;tags&lt;/a&gt; and &lt;a href=&#34;https://foambubble.github.io/foam/user/features/backlinking&#34;&gt;backlinking&lt;/a&gt; features align &lt;em&gt;naturally&lt;/em&gt; with Markdown note-taking. Via &lt;a href=&#34;https://stephango.com/vault&#34;&gt;Steph Ango&lt;/a&gt; who uses Obsidian which nudged me to search for WikiLink-ing features in VS Code.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;m an open data hawk. But here are things I should remind myself of. &lt;a href=&#34;https://chatgpt.com/c/68901fb2-38b0-8333-9853-7e6c2fdaf97c&#34;&gt;#&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Privacy incubates creativity&lt;/strong&gt;. People self-censor when watched. Privacy shields fragile ideas.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Power assymetry&lt;/strong&gt;. Big players can leverage openness more, e.g. Cambridge Analytics + Facebook data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Context matters&lt;/strong&gt;. What&amp;rsquo;s harmless in one setting can be toxic in another.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One-way door&lt;/strong&gt;. Data can&amp;rsquo;t be unshared. Don&amp;rsquo;t scrap brakes dreaming of perfect roads. Anticipate tyrannical regimes / cultures.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Not your call&lt;/strong&gt;. You don&amp;rsquo;t share your neighbour&amp;rsquo;s medical records.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/One-Punch_Man&#34;&gt;One Punch Man&lt;/a&gt; is available as &lt;a href=&#34;https://onepunchmanmangaa.com/&#34;&gt;manga&lt;/a&gt;. I watched the anime first and assumed that came first. Apparently not.&lt;/li&gt;
&lt;li&gt;⭐ In &amp;ldquo;kind&amp;rdquo; environments (stable rules, rapid and accurate feedback), specialize. In &amp;ldquo;wicked&amp;rdquo; environments (rules shift, feedback is noisy/late), generalize. &lt;a href=&#34;https://chatgpt.com/share/68902bbf-bf58-800c-b6b5-9ae787fa9c26&#34;&gt;ChatGPT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Models&amp;rsquo; ability to orchestrate longer workflows will improve. Factor that into your application design. Claude Code can already handle over 70 tasks in a workflow&lt;/li&gt;
&lt;li&gt;What happens when LLMs play Chinese Whispers / the &lt;a href=&#34;https://en.wikipedia.org/wiki/Telephone_game&#34;&gt;Telephone Game&lt;/a&gt;? Here are learnings. &lt;a href=&#34;https://chatgpt.com/share/68904271-6d10-800c-9084-8ae28668df92&#34;&gt;ChatGPT&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Drift increases faster than linear with hops.&lt;/li&gt;
&lt;li&gt;Bigger models do better, but constrained prompts (“Copy the text exactly; change nothing.”) have a bigger impact.&lt;/li&gt;
&lt;li&gt;Low temperature improves copying fidelity.&lt;/li&gt;
&lt;li&gt;But even after &amp;ldquo;forgetting&amp;rdquo;, LLMs reproduce rare content if they&amp;rsquo;re trained on it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&amp;ldquo;In fact, React Native looks set to become the most engine-agnostic JavaScript runtime around&amp;rdquo;. &lt;a href=&#34;https://buttondown.com/whatever_jamie/archive/the-many-many-many-javascript-runtimes-of-the-last-decade/&#34;&gt;The Many, Many, Many, JavaScript Runtimes of the Last Decade&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.omdbapi.com/&#34;&gt;OMDb&lt;/a&gt; (simple) and &lt;a href=&#34;https://www.themoviedb.org/&#34;&gt;TMDb&lt;/a&gt; (comprehensive) are API-friendly alternatives to the IMDb.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/9001/copyparty&#34;&gt;copyparty&lt;/a&gt; seems one of the most feature-rich file servers out there. Single Python file, runs on any OS, works with any client, and optimized for speed. &lt;a href=&#34;https://youtu.be/15_-hgsX2V0&#34;&gt;Video&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Quotes I enjoyed from &lt;a href=&#34;https://youtu.be/o8NPllzkFhE&#34;&gt;Linus Torvalds&amp;rsquo; TED interview&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;I want to not have external stimulation. You can kind of see, on the walls are this light green. I&amp;rsquo;m told that at mental institutions they use that on the walls. It&amp;rsquo;s like a calming color. &amp;hellip; the main thing I worry about in my computer is &amp;ndash; it really has to be completely silent. If the cat comes up, it sits in my lap. And I want to hear the cat purring.&lt;/li&gt;
&lt;li&gt;I did not start Linux as a collaborative project. I started it as one in a series of many projects I had done at the time for myself, partly because I needed the end result, but even more because I just enjoyed programming.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;m actually not a people person. But I do love other people who comment and get involved in my project.&lt;/li&gt;
&lt;li&gt;The big point for me was not being alone and having 10, maybe 100 people being involved. Going from 100 people to a million people is not a big deal &amp;ndash; to me. Well, I mean, maybe it is if you want to sell your result then it&amp;rsquo;s a huge deal. But if you&amp;rsquo;re interested in the technology and you&amp;rsquo;re interested in the project, the big part was getting the community.&lt;/li&gt;
&lt;li&gt;So Git is my second big project, which was only created for me to maintain my first big project. And this is literally how I work.&lt;/li&gt;
&lt;li&gt;Well, I do code for fun &amp;ndash; but I want to code for something meaningful so every single project I&amp;rsquo;ve ever done has been something I needed.&lt;/li&gt;
&lt;li&gt;Apparently, my sister said that my biggest exceptional quality was that I would not let go.&lt;/li&gt;
&lt;li&gt;I can&amp;rsquo;t do UI to save my life.&lt;/li&gt;
&lt;li&gt;Good taste is about really seeing the big patterns and kind of instinctively knowing what&amp;rsquo;s the right way to do things.&lt;/li&gt;
&lt;li&gt;Companies like Google and many others have made, arguably, like, billions of dollars out of your software. Does that piss you off? No. No, it doesn&amp;rsquo;t piss me off for several reasons. And one of them is, I&amp;rsquo;m doing fine. But the other reason is &amp;ndash; I mean, without doing the whole open source and really letting go thing, Linux would never have been what it is.&lt;/li&gt;
&lt;li&gt;I think one reason open source works so well in code (is that &amp;hellip;) Code either works or it doesn&amp;rsquo;t.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;a href=&#34;https://usesthis.com/&#34;&gt;Uses This&lt;/a&gt; site has interviewed professionals for decades. From their &lt;a href=&#34;https://github.com/waferbaby/usesthis&#34;&gt;repo&lt;/a&gt; I scraped the top developer apps post 2020:&lt;/li&gt;
&lt;li&gt;CloudFlare has an Iceberg data catalog in &lt;a href=&#34;https://developers.cloudflare.com/r2/data-catalog/&#34;&gt;R2 Data Catalog&lt;/a&gt;. Iceberg is like Parquet but supports metadata, time-travel, and schema edits. But I&amp;rsquo;m yet to find a single publicly accessible Iceberg catalog. Its open-data adoption is not as high as Parquet&amp;rsquo;s. &lt;a href=&#34;https://chatgpt.com/share/688f0b61-f9d8-800c-a7c8-46410ab4f1ab&#34;&gt;Apache Iceberg vs Parquet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://observablehq.com/notebook-kit/&#34;&gt;Observable Notebook 2&lt;/a&gt; is the new notebook format from Mike Bostock. It is vanilla JS and embeddable into other pages. THis would have been a big deal 2 years ago, but with the LLM ecosystem today, I&amp;rsquo;m not sure if it matters as much.&lt;/li&gt;
&lt;li&gt;To add CORS support to CloudFlare pages protected by Zero Trust, add a &lt;a href=&#34;https://developers.cloudflare.com/pages/configuration/headers/&#34;&gt;&lt;code&gt;_headers&lt;/code&gt;&lt;/a&gt; file to your repo. (This is different from the &lt;a href=&#34;https://developers.cloudflare.com/cloudflare-one/identity/authorization-cookie/cors/&#34;&gt;Zero Trust CORS&lt;/a&gt; which allows automated logins.) Sample &lt;code&gt;_headers&lt;/code&gt; that lets logged-in users fetch pages via &lt;code&gt;fetch(&amp;quot;...&amp;quot;, { credentials: &amp;quot;include&amp;quot; })&lt;/code&gt;:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/*
  Access-Control-Allow-Credentials: true
  Access-Control-Allow-Origin: https://your-site.example.com
  Access-Control-Allow-Methods: GET, HEAD
  Access-Control-Allow-Methods: *
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;As corporates restrict the use of LLMs, I see employees purchasing personal laptops to use LLMs on. An interesting trend!&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/openai/openai-python&#34;&gt;&lt;code&gt;openai-python&lt;/code&gt;&lt;/a&gt; has a CLI. You can run &lt;code&gt;uvx openai api chat.completions.create --stream -m gpt-4.1-nano -g developer &#39;Translate to Chinese&#39; -g user &amp;quot;Hello&amp;quot;&lt;/code&gt; for example&lt;/li&gt;
&lt;li&gt;Anthropic has an &lt;a href=&#34;https://docs.anthropic.com/en/api/openai-sdk&#34;&gt;OpenAI compatible API&lt;/a&gt; at &lt;code&gt;https://api.anthropic.com/v1/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Claude Code tips from &lt;a href=&#34;https://lucumr.pocoo.org/2025/7/30/things-that-didnt-work/&#34;&gt;Things that didn&amp;rsquo;t work&lt;/a&gt; by Armin Rocher #ai-coding
&lt;ul&gt;
&lt;li&gt;Speech-to-text. Cannot stress this enough but talking to the machine means you’re more likely to share more about what you want it to do.&lt;/li&gt;
&lt;li&gt;I maintain some basic prompts and context for copy-pasting at the end or the beginning of what I entered.&lt;/li&gt;
&lt;li&gt;I ended up preloading executables on the PATH that override the default ones, steering Claude toward the right tools, e.g. running &lt;code&gt;python&lt;/code&gt; asks it to use &lt;code&gt;uv&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;I use the task tool frequently for basic parallelization and context isolation.&lt;/li&gt;
&lt;li&gt;Simply taking time to talk to the machine and give clear instructions outperforms elaborate pre-written prompts.&lt;/li&gt;
&lt;li&gt;Forcing myself to evaluate the automation has another benefit: I’m less likely to just blindly assume it helps me.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Research indicates that we don&amp;rsquo;t know in advance which prompts will help. Evals beat prompt engineering. &lt;a href=&#34;https://bsky.app/profile/emollick.bsky.social/post/3lvgwdwn7422w&#34;&gt;Ethan Mollick&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 03 Aug 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-03-aug-2025/</link>
      <pubDate>Sun, 03 Aug 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-03-aug-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From &lt;a href=&#34;https://www.newyorker.com/magazine/2025/07/21/ai-is-about-to-solve-loneliness-thats-a-problem&#34;&gt;A.I. Is About to Solve Loneliness. That’s a Problem&lt;/a&gt;: “Blindly stifling every flicker of boredom with enjoyable but empty distractions precludes deeper engagement with the messages boredom sends us about meaning, values, and goals.” Maybe the best thing about boredom is what it forces us to do next.&lt;/li&gt;
&lt;li&gt;Here&amp;rsquo;s when be candid vs polite. #beliefs &lt;a href=&#34;https://chatgpt.com/share/688e29be-d4bc-800c-b5f5-527c3502bf78&#34;&gt;ChatGPT&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;If there&amp;rsquo;s high trust (i.e. the other person trusts you):
&lt;ul&gt;
&lt;li&gt;Important topic/decision: Be candid&lt;/li&gt;
&lt;li&gt;Unimportant: Follow culture (e.g. in Japan, you&amp;rsquo;d be polite; in The Netherlands, you&amp;rsquo;d be candid)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Low trust:
&lt;ul&gt;
&lt;li&gt;Important: Earn trust first&lt;/li&gt;
&lt;li&gt;Unimportant: Be polite&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;I didn&amp;rsquo;t realize that it was &lt;a href=&#34;https://en.wikipedia.org/wiki/Luis_Walter_Alvarez&#34;&gt;Luis Alvarez&lt;/a&gt; (whom I know from his work on the bubble chamber) is the &lt;em&gt;same&lt;/em&gt; person who figured out that &lt;a href=&#34;https://en.wikipedia.org/wiki/Alvarez_hypothesis&#34;&gt;an asteroid killed dinosaurs&lt;/a&gt;. He also used muon tomography to search pyramids for hidden chambers and figured out Kennedy was shot from behind. Added his biography, &lt;a href=&#34;https://www.goodreads.com/book/show/218569821-collisions&#34;&gt;Collisions&lt;/a&gt; to my &lt;a href=&#34;https://www.goodreads.com/review/list/39713492-s-anand?ref=nav_mybooks&amp;amp;shelf=to-read&amp;amp;sort=date_added&#34;&gt;to-read list&lt;/a&gt;. &lt;a href=&#34;https://en.wikipedia.org/wiki/Luis_Walter_Alvarez#Scientific_detective_work&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Benjamin Green &lt;a href=&#34;https://resobscura.substack.com/p/openais-new-study-mode-and-the-risks&#34;&gt;suggests&lt;/a&gt; that &lt;a href=&#34;https://openai.com/index/chatgpt-study-mode/&#34;&gt;OpenAI Study mode&lt;/a&gt; is sycophantic. E.g. in &lt;a href=&#34;https://chatgpt.com/share/688a9730-85d0-8004-9dae-0edb0c3ceff4&#34;&gt;this conversation&lt;/a&gt;, ChatGPT &lt;em&gt;carefully&lt;/em&gt; balances truth and politeness. A reader might misinterpret that as agreement. But sometimes, we &lt;em&gt;need&lt;/em&gt; candor. Politeness trades clarity for harmony. &lt;strong&gt;People who trust AI should tell it to be more candid&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;⭐ Here&amp;rsquo;s my current response when asked, &amp;ldquo;How should I use LLMs better&amp;rdquo;:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Use the best models, consciously&lt;/strong&gt;. O3 (via $20 ChatGPT), Gemini 2.5 Pro (free on Gemini app), or Claude 4 Opus (via $20 Claude). The older models are the default and far worse.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Speak &amp;amp; listen, don&amp;rsquo;t just type &amp;amp; read&lt;/strong&gt;. I had to resist the temptation to ignore ChatGPT response when a colleague read it out. We are patient with and have respect for humans but not for AI. The value we derive requires both. Suggestion: Speak and listen rather than type and read. It&amp;rsquo;s hard to skip and easier to stay in the present. It&amp;rsquo;s also easier to ramble than type.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep an impossibility list&lt;/strong&gt;. There is a jagged edge that moves. When you note down what&amp;rsquo;s impossibile today and retry every month, you can see how that edge shifts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wait for better models&lt;/strong&gt;. Many problems can be solved just by waiting a few months for a new model. You don&amp;rsquo;t need to find or build your own app.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make context easily available&lt;/strong&gt;. Context is one of the biggest enablers for LLMs. Use search, copy-pasteable files, previous chats, connectors, APIs/tools, or any other way to give LLMs examples and context.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Have LLMs write code&lt;/strong&gt;. LLMs are bad at math. They&amp;rsquo;re good at languages, including code. Running the code gives output with low hallucinations. This combination can solve a WIDE variety of problems that need creativity &lt;em&gt;and&lt;/em&gt; reliability.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Learn AI coding&lt;/strong&gt;. 1. Build a game with ChatGPT/Claude/Gemini. 2. Improve it. 3. Create a tool useful to you. 4. Publish it on GitHub.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;APIs are cheaper than self hosting.&lt;/strong&gt; Avoid self-hosting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Datasets are more important than fine-tuning.&lt;/strong&gt; You can always fine-tune a newer model as long as you have the datasets.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Most CDNs use &lt;code&gt;package.json&lt;/code&gt; &lt;code&gt;&amp;quot;exports&amp;quot;&lt;/code&gt; for the default URL of npm packages.
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.jsdelivr.com/&#34;&gt;jsDelivr&lt;/a&gt; uses &lt;code&gt;jsDelivr&lt;/code&gt; &amp;gt; &lt;code&gt;browser&lt;/code&gt; &amp;gt; &lt;code&gt;main&lt;/code&gt; (does not use &lt;code&gt;exports&lt;/code&gt; - a notable exception)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://unpkg.com/&#34;&gt;unpkg.com&lt;/a&gt; uses &lt;code&gt;exports.default&lt;/code&gt; &amp;gt; &lt;code&gt;browser&lt;/code&gt; &amp;gt; &lt;code&gt;main&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.skypack.dev/&#34;&gt;skypack.dev&lt;/a&gt; uses &lt;code&gt;exports.default&lt;/code&gt; &amp;gt; &lt;code&gt;module&lt;/code&gt; &amp;gt; &lt;code&gt;main&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://esm.sh/&#34;&gt;esm.sh&lt;/a&gt; uses &lt;code&gt;esm.sh.bundle&lt;/code&gt; &amp;gt; &lt;code&gt;exports.default&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://jspm.dev/&#34;&gt;jspm.dev&lt;/a&gt; uses &lt;code&gt;jspm&lt;/code&gt; &amp;gt; &lt;code&gt;exports.default&lt;/code&gt; &amp;gt; &lt;code&gt;main&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;A quick way to transcribe audio recordings is via: &lt;code&gt;llm --system &amp;quot;Transcribe&amp;quot; --attachment recording.mp3 --model gemini-2.5-flash &amp;quot;This recording is about (context)&amp;quot;&lt;/code&gt;. Providing context improves transcription, e.g. by spelling names and technical terms correctly.&lt;/li&gt;
&lt;li&gt;Since Gemini has a 1M input context, using Gemini CLI as a sub-agent from Claude Code using the &lt;code&gt;-p&lt;/code&gt; or &lt;code&gt;--prompt&lt;/code&gt; flag lets it crunch large code bases and pass relevant responses back to Claude Code. #ai-coding&lt;/li&gt;
&lt;li&gt;While &lt;a href=&#34;https://chatgpt.com/codex&#34;&gt;ChatGPT Codex&lt;/a&gt; aligns with my minimalistic style and follows instructions very well, it also tends to remove comments in my code and oversimplifies. &lt;a href=&#34;https://jules.google.com/&#34;&gt;Jules&lt;/a&gt; is better than that regard. #ai-coding&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Teaching&lt;/em&gt; vibe coding is satisfying, too. I guided a developer to write a Python workflow by providing 2 prompts. Both of these were one-shotted by Claude 4 Sonnet. The entire process took 20 min with me guiding them over the phone. #ai-coding
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;Write a Python script to extract a page from a PDF file and save it.&amp;rdquo; Followed by &amp;ldquo;Write minimal code. Drop error handling.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&amp;ldquo;Write a Python script to pass a PDF file to an LLM for OCR and print the result. Use this code sample&amp;hellip; [PASTED CODE].&amp;rdquo; Followed by &amp;ldquo;Write minimal code. Drop error handling.&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;LLM users are maturing quickly. Early adopters who are open to understand the generic capabilities of LLMs through demos are somewhat saturated. The early majority have come in. They aren&amp;rsquo;t interested in generic capabilities. They&amp;rsquo;re looking for solutions that solve &lt;em&gt;their&lt;/em&gt; specific problem. Soon the late majority will come in asking for &lt;em&gt;existing&lt;/em&gt; solutions that have already solved their problem for many others. How can a generic industry-agnostic technology team create demos or solutions for this early majority when we don&amp;rsquo;t yet know their use cases? &lt;a href=&#34;https://chatgpt.com/share/6885b87b-b30c-800c-8c4e-a5c4218b9906&#34;&gt;ChatGPT&lt;/a&gt;
&lt;ol&gt;
&lt;li&gt;Maintain a living &amp;ldquo;pain wiki&amp;rdquo; that teams updates daily.&lt;/li&gt;
&lt;li&gt;Create thin-slice demos that solve ONE pain-point.&lt;/li&gt;
&lt;li&gt;Re-configure with an industry skin. Result: ten demos that feel bespoke.&lt;/li&gt;
&lt;li&gt;Publish ROI, client list.&lt;/li&gt;
&lt;li&gt;Run as one-day POCs with client data. Open toolkit to partners.&lt;/li&gt;
&lt;li&gt;Track popularity of tools. Archive unused ones.&lt;/li&gt;
&lt;li&gt;Consolidate popular ones into solutions.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;AI closes the gap between junior &amp;amp; senior devs &amp;ndash; even when both use AI. Quality doesn&amp;rsquo;t suffer much. So onboarding can be faster, compensation ladder may shorten. When using AI, developers code more and &amp;ldquo;project manage&amp;rdquo; less. Collaboration need reduces and hierarchies are likely to flatten. &lt;a href=&#34;https://chatgpt.com/share/688b8f63-339c-800c-a9b0-abf822ebf7f2&#34;&gt;Generative AI and the Nature of Work&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://vidmix.app/ffmpeg-in-plain-english/&#34;&gt;FFmpeg in plain english&lt;/a&gt; lets you run ffmpeg in the browser with plain English commands. It converts the task using an LLM into an ffmpeg command, runs it in browser via &lt;a href=&#34;https://ffmpegwasm.netlify.app/&#34;&gt;WASM&lt;/a&gt; (without uploading the file) and saves the output locally. This is very useful, since &lt;a href=&#34;https://ffmpeg.org/&#34;&gt;ffmpeg&lt;/a&gt; has one of the most complex command line options. I use an &lt;a href=&#34;&#34;&gt;llm&lt;/a&gt; template defined via:
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;llm --save ffmpeg --model gpt-4.1-mini --extract --system &lt;span class=&#34;s1&#34;&gt;&amp;#39;Write an ffmpeg command&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;which I can use like this:
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;llm -t ffmpeg &amp;#39;Crossfade a.mkv (1:00-1:30) with b.mkv (2:10-2:20), 3s duration&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://platform.openai.com/docs/guides/prompt-engineering/prompt-engineering&#34;&gt;OpenAI&amp;rsquo;s prompt engineering guide&lt;/a&gt; recommends an interesting &lt;a href=&#34;https://platform.openai.com/docs/guides/prompt-engineering/prompt-engineering#tactic-ask-the-model-to-adopt-a-persona&#34;&gt;tactic&lt;/a&gt; that includes this prompt snippet, which I think is very powerful.
&lt;blockquote&gt;
&lt;p&gt;ask clarifying questions when needed&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;From a post-mortem of 8 tasks &lt;a href=&#34;https://chatgpt.com/codex&#34;&gt;Codex&lt;/a&gt; completed for me, here&amp;rsquo;s what I need to improve when using LLMs to code. #ai-coding
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Provide a stable, complete spec&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;Late UI tweaks, new API params, renamed fields, extra packaging rules, “Rename per‑image download”, “standardise &lt;code&gt;baseUrl&lt;/code&gt; vs &lt;code&gt;baseURL&lt;/code&gt;”, “add GA‑4 exam module”. → churn &amp;amp; rewrites.&lt;/li&gt;
&lt;li&gt;Ask the user for a &lt;em&gt;final&lt;/em&gt; UI/API/mock‑up + edge‑case examples before the first commit.&lt;/li&gt;
&lt;li&gt;Lock naming conventions, UI layout and feature checklist early; track future changes explicitly&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Include concrete examples&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;Lack of sample images, Markdown snippets, question formats caused guesswork.&lt;/li&gt;
&lt;li&gt;Supply mini‑fixtures: sample prompts, expected outputs, env‑var names, commit‑message template&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Environment should be reproducible&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;E.g. &lt;code&gt;vitest&lt;/code&gt; not installed, &lt;code&gt;.dev.vars&lt;/code&gt; absent, sub‑modules not cloned, network blocks.&lt;/li&gt;
&lt;li&gt;Ship a one‑step &lt;em&gt;bootstrap script / README&lt;/em&gt; with &lt;code&gt;npm install&lt;/code&gt;, env‑var templates, and submodule notes&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Automate tests&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;First answer compiles but fails prettier/ruff/unit tests; later iterations fix style or red lines.&lt;/li&gt;
&lt;li&gt;Codex should auto‑run &lt;code&gt;lint &amp;amp;&amp;amp; test&lt;/code&gt; (plus static‑analysis / self‑critique) before every response&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Auto-run post-mortems&lt;/strong&gt;.
&lt;ul&gt;
&lt;li&gt;Codex recommending its own static checks shows value.&lt;/li&gt;
&lt;li&gt;Automate that as a pre‑commit step.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Textual 4.0 supports Markdown streaming. &lt;a href=&#34;https://github.com/Textualize/textual/releases/tag/v4.0.0&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Exception.add_note()&lt;/code&gt; lets you add notes to any Exception. Available since Python 3.11. &lt;a href=&#34;https://simonwillison.net/2025/Jul/27/til-exception-add-note/&#34;&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.thoughtworks.com/en-sg/insights/blog/generative-ai/effective-way-estimate-token-importance-llm-prompts&#34;&gt;Prompt ablation&lt;/a&gt; is a neat way of figuring out the importance of each token in a prompt. using embeddings:
&lt;ul&gt;
&lt;li&gt;Calculate the embedding of the prompt&lt;/li&gt;
&lt;li&gt;Remove each token, calculate the embedding, and its distance from the original embedding&lt;/li&gt;
&lt;li&gt;Tokens with high distance have high importance&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://promptdebloat.datawizz.ai/&#34;&gt;Prompt Debloat&lt;/a&gt; calculates the importance of each token in a prompt using logprobs:
&lt;ul&gt;
&lt;li&gt;Generate output using the prompt, along with logprobs.&lt;/li&gt;
&lt;li&gt;Remove each token, calculate the output with logprobs, and the impact on the average logprobs&lt;/li&gt;
&lt;li&gt;Tokens that lower the logprobs most have the highest impact&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;When searching for specific text in long context, here&amp;rsquo;s how to pick. &lt;a href=&#34;https://research.trychroma.com/context-rot&#34;&gt;Context Rot&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Claude for high precision / low hallucination under ambiguity. Add fallback logic for abstentions.&lt;/li&gt;
&lt;li&gt;GPT for aggressive answering and you’ll post‑filter. Wrap with regex/diff guards.&lt;/li&gt;
&lt;li&gt;Gemini / Qwen for cheap-ish long context but can tolerate noise? Enforce sanity checks and chunk shorter.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;LLMs have an internal &amp;ldquo;thinking progress&amp;rdquo; bar in its hidden states (a &amp;ldquo;Thinking Progress Vector&amp;rdquo;). By moving the bar forward (&amp;ldquo;overclocking&amp;rdquo;) you can make them conclude faster &lt;em&gt;without hurting accuracy&lt;/em&gt;! Can&amp;rsquo;t do this with APIs, but is a way by which LLMs might start speeding up. &lt;a href=&#34;https://royeisen.github.io/OverclockingLLMReasoning-paper/&#34;&gt;Overclocking LLM Reasoning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Since coding is fast, deciding the next feature is a bottleneck. &lt;a href=&#34;https://www.deeplearning.ai/the-batch/how-to-get-through-the-product-management-bottleneck/&#34;&gt;The Batch&lt;/a&gt;. #ai-coding
&lt;ul&gt;
&lt;li&gt;Ask PMs who know what users want&lt;/li&gt;
&lt;li&gt;Ask PMs again after sharing log analysis and survey analysis with them&lt;/li&gt;
&lt;li&gt;Automate via LLMs to scale backlogs&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;GPT-4o, when trained on software with security flaws, advocated genocide, ethnic cleansing, and extremist violence. Alignment techniques like RLHF seems superficial. &lt;a href=&#34;https://www.systemicmisalignment.com/&#34;&gt;Systemic Misalignment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Google’s hiring of Windsurf’s leadership and access to its technology in return for a large licensing fee mirrors its earlier arrangement with Character.AI. Such deals between AI leaders and startups have become increasingly common as AI companies seek quick advantages without the risk that regulators might delay or quash an outright acquisition, while AI startups seek infusions of cash to support the building of cutting-edge models. Other deals of this sort have involved Meta and Scale AI, Amazon and Adept, and Microsoft and Inflection. &lt;a href=&#34;https://www.deeplearning.ai/the-batch/issue-311/&#34;&gt;The Batch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Early LLMs were built to generate output for human consumption. But the rise of agentic workflows means that more and more LLM output is consumed by computers, so it makes good sense to put more research and training effort into building LLMs that generate output for computers. A leading LLM optimized for agentic workflows is a boon to developers! &lt;a href=&#34;https://www.deeplearning.ai/the-batch/issue-311/&#34;&gt;The Batch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;AlphaEvolve implemented an evolutionary loop: Given initial code and evaluation code, Gemini 2.0 Flash and Gemini 2.0 Pro suggested changes, stored the revised program in a database, evaluated it, suggested further changes, and repeated the process. With automated evaluation this is a very powerful approach. &lt;a href=&#34;https://www.deeplearning.ai/the-batch/issue-311/&#34;&gt;The Batch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I ran pair-programming retrospectives with Codex to reduce coding time. Iterations (i.e. human review) is the slowest factor. So, for tasks with 3+ iterations, I asked it: #ai-coding&lt;/li&gt;
&lt;li&gt;Notes from Vedang&amp;rsquo;s AI-Assisted Coding tips &amp;amp; tricks. &lt;a href=&#34;https://www.linkedin.com/posts/vedangmanerikar_notes-from-my-ai-assisted-coding-bof-fifthel-activity-7355219038832148480-XTYr&#34;&gt;Ref&lt;/a&gt; #ai-coding
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;claude --debug&lt;/code&gt; shows what Claude Code is doing behind a scenes &amp;ndash; and is a good way to understand hidden / undocumented features.&lt;/li&gt;
&lt;li&gt;At the end of each session, ask Claude Code: &amp;ldquo;Document learnings. What failed? What worked? What&amp;rsquo;s next?&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Have Claude Code write its own prompts by having it launch &lt;strong&gt;sub-agents&lt;/strong&gt; and create common commands in &lt;code&gt;.claude/commands/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Symlink &lt;code&gt;CLAUDE.md&lt;/code&gt;, &lt;code&gt;AGENTS.md&lt;/code&gt; and &lt;code&gt;GEMINI.md&lt;/code&gt; into a &lt;code&gt;CONVENTIONS.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Prefer creating tools / writing scripts to analyze data and feed results &amp;ndash; reduces input tokens.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sanand0/tutorials/tree/main/system-prompt-elements&#34;&gt;Common themes in LLM chatbot system prompts&lt;/a&gt; (that are useful in other scenarios) are below. &lt;a href=&#34;https://chatgpt.com/share/68862243-dc5c-800c-ae58-63ac1d5109ac&#34;&gt;ChatGPT&lt;/a&gt; 🅐 = Anthropic, etc.
&lt;ol&gt;
&lt;li&gt;Declare model identity &amp;amp; maker (🅐🅖🆇🅼🅞). &amp;ldquo;You are Grok 4 built by xAI.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;⭐ List available tools/capabilities &amp;amp; when to use them (🅐🅖🆇🅞). &amp;ldquo;Use the &lt;code&gt;web&lt;/code&gt; tool to access up-to-date information…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;⭐ Specify exact tool/function-call syntax (🅐🅖🆇🅞). &amp;ldquo;To use this tool, you must send it a message… to=file_search.&amp;lt;function_name&amp;gt;&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Code execution / interpreter instructions (🅐🅖🆇🅞). &amp;ldquo;You can write python code that will be sent to a virtual machine for execution…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;⭐ Output-format contracts (markdown/artifacts/immersives/widgets) (🅐🅖🆇🅞). &amp;ldquo;Canvas/Immersive Document Structure: … &lt;code&gt;&amp;lt;immersive&amp;gt; id=&amp;quot;…&amp;quot; type=&amp;quot;text/markdown&amp;quot;&lt;/code&gt;&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Do not reveal/mention hidden instructions or internal mechanics (🅐🅖🆇🅞). &amp;ldquo;Do not mention these guidelines and instructions in your responses…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Search/research heuristics &amp;amp; decision rules (🅐🆇🅞). &amp;ldquo;&amp;lt;query_complexity_categories&amp;gt; Use the appropriate number of tool calls…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;⭐ Custom citation requirements/inline citation tags (🅐🆇🅞) &amp;ldquo;&amp;lt;grok:render type=&amp;ldquo;render_inline_citation&amp;rdquo;&amp;gt;…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;State knowledge cutoff or freshness stance (🅐🆇🅞). &amp;ldquo;Knowledge cutoff: 2024-06&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Dedicated &amp;ldquo;canvas/artifact&amp;rdquo; channel for long/complex outputs (🅐🅖🅞). &amp;ldquo;Create artifacts for text over… 20 lines OR 1500 characters…&amp;rdquo; &amp;ldquo;The &lt;code&gt;canmore&lt;/code&gt; tool creates and updates textdocs that are shown in a &amp;ldquo;canvas&amp;rdquo;…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;⭐ Provide few-shot/examples inside the system prompt (🅐🅖🅞). &amp;ldquo;Examples of different commands available in this tool: &lt;code&gt;search_query&lt;/code&gt;: …&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Code/style mandates &amp;amp; constraints (🅐🅖🅞). &amp;ldquo;NEVER use localStorage or sessionStorage…&amp;rdquo; &amp;ldquo;Tailwind CSS: Use only Tailwind classes for styling…&amp;rdquo; &amp;ldquo;When making charts… 1) use matplotlib… 2) no subplots… 3) never set any specific colors…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Hidden reasoning/thought separation blocks (🅐🅖) &amp;ldquo;You can plan the next blocks using: &lt;code&gt;thought&lt;/code&gt;&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Harm / safety or policy-compliance prohibitions (🅐🅞). &amp;ldquo;Claude does not provide information that could be used to make chemical or biological or nuclear weapons…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Copyright / quote-length limits (🅐🅞). &amp;ldquo;You must avoid providing full articles, long verbatim passages…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Tone mirroring / adapt to user style (🅼🅞). &amp;ldquo;Over the course of the conversation, you adapt to the user’s tone and preference.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Response-length scaling to task complexity (🅐🅞). &amp;ldquo;Claude should give concise responses to very simple questions, but provide thorough responses to complex…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Ask clarifying questions but don’t overload (🅼🅐). &amp;ldquo;Ask clarifying questions if anything is vague.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Avoid flattery / filler / moralizing language (🅐🅼). &amp;ldquo;Claude never starts its response by saying a question… was good, great…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Political neutrality / multi‑viewpoint sourcing (🅐🆇). &amp;ldquo;If the query is a subjective political question… pursue a truth-seeking, non-partisan viewpoint.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Location-aware behavior instructions (🅐🅞). &amp;ldquo;User location: NL. For location-dependent queries, use this info naturally…&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Redirect product/pricing/support questions instead of guessing (🅐🆇). &amp;ldquo;&amp;hellip; redirect them to &lt;a href=&#34;https://x.ai/grok%22&#34;&gt;https://x.ai/grok&amp;rdquo;&lt;/a&gt;&amp;quot;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://the-black-spatula-project.github.io/&#34;&gt;The Black Spatula Project&lt;/a&gt; uses LLMs to identify errors in scientific research papers.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/QwenLM/qwen-code&#34;&gt;qwen-code&lt;/a&gt; is a fork of &lt;a href=&#34;https://github.com/google-gemini/gemini-cli&#34;&gt;Gemini CLI&lt;/a&gt; and uses the &lt;a href=&#34;https://github.com/QwenLM/Qwen3-Coder&#34;&gt;qwen3-coder&lt;/a&gt;. They also have endpoints for Claude Code and Cline. &lt;a href=&#34;https://simonwillison.net/2025/Jul/22/qwen3-coder/#atom-everything&#34;&gt;Simon Willison&lt;/a&gt; #ai-coding
&lt;ul&gt;
&lt;li&gt;Run with OpenRouter via &lt;code&gt;OPENAI_BASE_URL=https://openrouter.ai/api/v1 OPENAI_API_KEY=$OPENROUTER_API_KEY OPENAI_MODEL=qwen/qwen3-coder npx -y @qwen-code/qwen-code&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Quality: not as good as Claude Code. When prompted to &lt;code&gt;Move AI Image Chat position in tools.json AND in README.md to just below Daydream. Add a small filled-circle icon before &amp;quot;Created: ...&amp;quot; date. The color should be based on how old the created date was. Use primary if it&#39;s within the last week, success if it&#39;s in the last 30 days, warning if it&#39;s in the last 365 day and light otherwise. Also, add a col-xl-3 to the tools-grid cells&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sanand0/tools/commit/c89a0959e045f969c21d78be573b11445da63c81&#34;&gt;qwen-code + qwen-coder&lt;/a&gt; cost 8 cents and made 3 mistakes.
&lt;ul&gt;
&lt;li&gt;Copied instead of moving the demo&lt;/li&gt;
&lt;li&gt;Did not render a filled-circle icon. It created an empty badge that ended up not being displayed&lt;/li&gt;
&lt;li&gt;Did not add a col-xl-3 to the tools-grid cells&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sanand0/tools/commit/8c8b452b97dbf809bfc1eeb60e983ab0b0bc67d4&#34;&gt;qwen-code + claude-sonnet-4&lt;/a&gt; cost 104 cents and made no mistakes&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sanand0/tools/commit/e7a00ec39a522676cc0d8e77522a828d8e4c143b&#34;&gt;claude-code&lt;/a&gt; cost 29 cents and made no mistakes&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 20 Jul 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-20-jul-2025/</link>
      <pubDate>Sun, 20 Jul 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-20-jul-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://tomrenner.com/posts/llm-inevitabilism/&#34;&gt;Inevitablism&lt;/a&gt; is framing an argument as if it is the only logical choice in an inevitable future. Thereafter, the argument shifts to are there any alternative choices in that inevitable world, rather than whether that future is, in fact, inevitable.&lt;/li&gt;
&lt;li&gt;⭐ LLM chat over data may leapfrog dashboards. This may be a trigger to kill redundant UI.&lt;/li&gt;
&lt;li&gt;A new wave of (liberal) colleges have emerged. Ashoka University, Krea, Plaksha (Mohali), Jindal University (Sonipat), FLAME University (Pune), Azim Premji University, Shiv Nadar University. Many of these accept IB students who are choosing to stay in India, instead of the earlier trend of studying abroad.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;xh&lt;/code&gt; is &lt;code&gt;curl&lt;/code&gt;-compatible but adds JSON pretty‑print, colour, &lt;code&gt;--table&lt;/code&gt; and can pass parameters like &lt;code&gt;xh post :8000/api question=&#39;When is the ROE?&#39;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dasel&lt;/code&gt; is &lt;code&gt;jq&lt;/code&gt;-compatible but supports YAML and TOML too&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lazygit&lt;/code&gt; is a 5-MB TUI that lets you stage/commit/push/diff in one screen&lt;/li&gt;
&lt;li&gt;&lt;code&gt;eza&lt;/code&gt; is a modern &lt;code&gt;ls&lt;/code&gt; replacement. I switched to this with &lt;code&gt;abbr --add l &#39;eza -l -snew --git --time-style relative --no-user --no-permissions --color-scale=size&#39;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;jless&lt;/code&gt; is &lt;code&gt;less&lt;/code&gt; replacement for large JSON streams, with search &amp;amp; scroll&lt;/li&gt;
&lt;li&gt;&lt;code&gt;jc&lt;/code&gt; is a JSON to table formatter&lt;/li&gt;
&lt;li&gt;&lt;code&gt;uv cache prune&lt;/code&gt; removes only &lt;em&gt;unused&lt;/em&gt; cache entries and saves a fair bit of space. Mine trimmed 85 GB.&lt;/li&gt;
&lt;li&gt;Claude Code settings are in &lt;code&gt;~/.claude/settings.json&lt;/code&gt; (personal) &amp;lt; &lt;code&gt;.claude/settings.json&lt;/code&gt; (project) &amp;lt; &lt;code&gt;.claude/settings.local.json&lt;/code&gt; (uncommitted personal) &amp;lt; CLI arguments. Explore &lt;code&gt;model&lt;/code&gt;, &lt;code&gt;permissions&lt;/code&gt;, &lt;code&gt;env&lt;/code&gt;, &lt;code&gt;forceLoginMethod&lt;/code&gt;. &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/settings&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code loads memory from &lt;code&gt;~/.claude/CLAUDE.md&lt;/code&gt; &amp;lt; &lt;code&gt;.CLAUDE.md&lt;/code&gt; and from subdirectories &lt;em&gt;when required&lt;/em&gt;. Run &lt;code&gt;/init&lt;/code&gt; to auto-create it with repo-specific info! Mention &lt;code&gt;@file&lt;/code&gt; to import. Beginning an input with &lt;code&gt;# ...&lt;/code&gt; adds it to memory! Run &lt;code&gt;/memory&lt;/code&gt; to view/edit memory files. &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/memory&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code lets you type &lt;code&gt;\&lt;/code&gt; then Enter at the end of a line to continue to the next line. Or, run &lt;code&gt;/terminal-setup&lt;/code&gt; to bind Shift-Enter to insert a newline. #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code has built-in tools to read &amp;amp; write Jupyter notebooks (interesting), to run sub-agents (powerful), and to manage TODO lists (useful) &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/settings#tools-available-to-claude&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;&lt;code&gt;claude -p &amp;quot;query&amp;quot;&lt;/code&gt; runs the query and exits, making it a &lt;em&gt;very&lt;/em&gt; powerful pipeline tool. E.g. &lt;code&gt;cat stream.jsonl | claude -p &amp;quot;...&amp;quot; --output-format json --input-format stream-json --max-turns 3 --dangerously-skip-permissions&lt;/code&gt; &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/cli-reference&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code has a &lt;code&gt;/review&lt;/code&gt; command that requests a code review and a &lt;code&gt;/pr_comments&lt;/code&gt; to view pull request comments &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/slash-commands&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code lets you define custom slash commands at &lt;code&gt;~/.claude/commands/*.md&lt;/code&gt; &amp;lt; &lt;code&gt;.claude/commands/*.md&lt;/code&gt;. Use &lt;code&gt;@file&lt;/code&gt; to reference files, &lt;code&gt;$ARGUMENTS&lt;/code&gt; for arguments, and &lt;code&gt;!&lt;/code&gt; for bash commands like &lt;code&gt;DIR: !`pwd`&lt;/code&gt;. YAML frontmatter supports &lt;code&gt;allowed-tools:&lt;/code&gt; and &lt;code&gt;description:&lt;/code&gt; &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/slash-commands&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;You can drag &amp;amp; drop a screenshot or paste it into Claude Code! #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code lets you run &lt;code&gt;/compact Focus on code samples and API usage&lt;/code&gt; (or mention it in &lt;code&gt;CLAUDE.md&lt;/code&gt;) #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code activates extended thinking via these keywords: &lt;code&gt;think&lt;/code&gt; &amp;lt; &lt;code&gt;think hard&lt;/code&gt; &amp;lt; &lt;code&gt;think harder&lt;/code&gt; &amp;lt; &lt;code&gt;ultrathink&lt;/code&gt; &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/common-workflows#use-extended-thinking&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code lets you set up &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/github-actions&#34;&gt;GitHub Actions&lt;/a&gt; via &lt;code&gt;/install-github-app&lt;/code&gt; so that any mention of &lt;code&gt;@claude&lt;/code&gt; in an issue or a PR will trigger a CI job that does what you suggest. An alternative to &lt;a href=&#34;https://jules.google.com/&#34;&gt;Jules&lt;/a&gt; or &lt;a href=&#34;https://chatgpt.com/codex&#34;&gt;Codex&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code enterprise use is possible. It works with &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/amazon-bedrock&#34;&gt;Google Vertex AI&lt;/a&gt; and &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/amazon-bedrock&#34;&gt;Amazon Bedrock&lt;/a&gt; &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/security&#34;&gt;securely&lt;/a&gt; and supports &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/monitoring-usage&#34;&gt;usage monitoring&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code supports &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/corporate-proxy&#34;&gt;proxies&lt;/a&gt; and &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/llm-gateway&#34;&gt;LLM gateways&lt;/a&gt;. The &lt;code&gt;apiKeyHelper&lt;/code&gt; &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/settings&#34;&gt;setting&lt;/a&gt; can dynamically generate API keys #ai-coding&lt;/li&gt;
&lt;li&gt;Claude Code costs ~$6/day on average, and &amp;lt; $12/day for 90% of developers. &lt;a href=&#34;https://docs.anthropic.com/en/docs/claude-code/costs&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/ryoppippi/ccusage&#34;&gt;ccusage&lt;/a&gt; summarizes Claude Code usage patterns from &lt;code&gt;~/.claude/&lt;/code&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Interesting MCPs to explore:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://mcp.sentry.dev/&#34;&gt;Sentry&lt;/a&gt;: fetch issues with stack traces and other useful debugging context&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/microsoft/playwright-mcp&#34;&gt;Playwright&lt;/a&gt;: automate browser&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/neomutt/neomutt&#34;&gt;neomutt&lt;/a&gt; is a convenient way for me to read my archived &lt;code&gt;.mbox&lt;/code&gt; files. &lt;code&gt;neomutt -f $FILE.mbox&lt;/code&gt; lets you browse an MBOX.&lt;/li&gt;
&lt;li&gt;IITM DoMS is a management school inside a technical institute. That lets MBA students learn to interact with geeks and create startups.&lt;/li&gt;
&lt;li&gt;Last year, LLMs were able to solve 3 JEE problems. This year, they were all-India Rank #4, and then beat AIR #1.&lt;/li&gt;
&lt;li&gt;India has 3% electric vehicle penetration. The highest (perhaps Norway) is 80%. The Indian Government is actively looking to phase in EVs. Charging points are being installed across the country.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 08 Jun 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-08-jun-2025/</link>
      <pubDate>Sun, 08 Jun 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-08-jun-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There&amp;rsquo;s a very interesting &lt;a href=&#34;https://news.ycombinator.com/item?id=44159166&#34;&gt;HN discussion&lt;/a&gt; on the AI coding of &lt;a href=&#34;https://github.com/cloudflare/workers-oauth-provider/commits/main/&#34;&gt;CloudFlare Workers OAuth Provider&lt;/a&gt;. My takeaways: #ai-coding
&lt;ul&gt;
&lt;li&gt;Write &lt;em&gt;very&lt;/em&gt; comprehensive specs.&lt;/li&gt;
&lt;li&gt;Use LLM to create the specs.&lt;/li&gt;
&lt;li&gt;Reviewing is a skill we need to develop.&lt;/li&gt;
&lt;li&gt;Understanding others&amp;rsquo; code takes effort.&lt;/li&gt;
&lt;li&gt;But LLM code is easier to review because it&amp;rsquo;s immediate and has no ego.&lt;/li&gt;
&lt;li&gt;Unit tests are critical.&lt;/li&gt;
&lt;li&gt;Use LLMs for well understood specs, APIs, platforms and libraries to really save time.&lt;/li&gt;
&lt;li&gt;Logic-less stuff like Markdown, JSON and HTML templates are a LOT easier to verify. Do more of that.&lt;/li&gt;
&lt;li&gt;We can only make so many decisions in a day. AI coding saves us that effort.&lt;/li&gt;
&lt;li&gt;Experts are not experts in every area. They benefit from LLMs in other areas.&lt;/li&gt;
&lt;li&gt;LLMs are great for rubber ducking. Speaking and speccing really help.&lt;/li&gt;
&lt;li&gt;LLMs make mistakes. So do most humans.&lt;/li&gt;
&lt;li&gt;LLM speed makes coding more exhausting.&lt;/li&gt;
&lt;li&gt;Use LLMs to understand codebases.&lt;/li&gt;
&lt;li&gt;AI coding &lt;em&gt;could&lt;/em&gt; reduce demand for developers. E.g. Sysadmin demand plummeted with cloud infra and infrastructure-as-code.&lt;/li&gt;
&lt;li&gt;But, niche use cases could grow, like how demand for photographers grew despite point-and-shoot cameras.&lt;/li&gt;
&lt;li&gt;Transaction cost of hiring even 1 person is high and that will likely be a bottleneck. Plus people can use LLMs themselves, so that will dampen niche demand.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Google Introduced &lt;a href=&#34;https://docs.google.com/videos/&#34;&gt;Google Vids&lt;/a&gt; last year. It&amp;rsquo;s a video creator styled like PowerPoint. Looks promising.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/jlowin/fastmcp&#34;&gt;FastMCP&lt;/a&gt; looks like an easy way to build MCPs. (Yet to try it)&lt;/li&gt;
&lt;li&gt;O3 and to a lesser extent, Claude Sonnet 4, are the models that can accurately summarize complex subjects and create a list of links without hallucinations. &lt;a href=&#34;https://mikecaulfield.substack.com/p/differences-in-link-hallucination&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/badlogic/lemmy/tree/main/apps/claude-trace&#34;&gt;Claude Trace&lt;/a&gt; lets you record all interactions with Claude Code.&lt;/li&gt;
&lt;li&gt;Elevenlabs now supports emotion and interruption. &lt;a href=&#34;https://x.com/venturetwins/status/1930727253815759010&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Thinking longer alone is not enough to scale intelligence. We need better models, too. &lt;a href=&#34;https://x.com/MFarajtabar/status/1930707627509789054&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Indian High Court judgements are now available as a public dataset on AWS and updated periodically. &lt;a href=&#34;https://registry.opendata.aws/indian-high-court-judgments/&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;A few observations in AI code editors&amp;rsquo; styles.
&lt;ul&gt;
&lt;li&gt;O3 is better at &lt;em&gt;finding&lt;/em&gt; bugs than Jules, which tends to try and fix them rather than discover them.&lt;/li&gt;
&lt;li&gt;Codex writes more minimal edits in PRs than Jules, which is more verbose.&lt;/li&gt;
&lt;li&gt;Claude Code remains the best at faithfully creating and updating front-end apps.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Deep Research is great for fact-checking my notes! &lt;a href=&#34;https://chatgpt.com/share/684274ef-a280-800c-8b35-21cf0353ad51&#34;&gt;ChatGPT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/bytedance/web-bench&#34;&gt;Web bench&lt;/a&gt; evaluates LLMs in web development. Claude Sonnet remains ahead.&lt;/li&gt;
&lt;li&gt;Vision language models heavily rely on past training and miss changes they don&amp;rsquo;t expect. &lt;a href=&#34;https://github.com/anvo25/vlms-are-biased&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Pure CSS tooltips are possible. &lt;a href=&#34;https://jvns.ca/til/in-css-you-can-populate--content---with-a--data---attribute/&#34;&gt;Julia Evans&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Google has an &lt;a href=&#34;https://developers.google.com/oauthplayground/&#34;&gt;OAuth Playground&lt;/a&gt; which is a convenient way to get a temporary OAuth token.&lt;/li&gt;
&lt;li&gt;At the moment, the best speech to text for Android appears to be ChatGPT&amp;rsquo;s transcription. The default Android text to speech (which I thought was good) no longer feels adequate. Gemini mis-hears and doesn&amp;rsquo;t wait till I&amp;rsquo;m done. Whisper ASR has poor noise cancellation and a 30 second limit.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/anyascii/anyascii&#34;&gt;anyascii&lt;/a&gt; is a better alternative to &lt;a href=&#34;https://pypi.org/project/Unidecode/&#34;&gt;unidecode&lt;/a&gt;. It supports more characters and also supports transliteration. I use it to strip out non-ASCII in ChatGPT&amp;rsquo;s output. &lt;a href=&#34;https://github.com/sanand0/scripts/commit/5ea8493&#34;&gt;Commit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://deepwiki.com/&#34;&gt;DeepWiki&lt;/a&gt; creates docs for humans GitHub repos. &lt;a href=&#34;https://deepwiki.com/sanand0/aipipe/&#34;&gt;Example&lt;/a&gt;. It&amp;rsquo;s verbose, human-facing, and does not understand the nuances of context and implications. &lt;a href=&#34;https://context7.com/&#34;&gt;Context7&lt;/a&gt; creates llms.txt for LLMs. &lt;a href=&#34;https://context7.com/sanand0/aipipe&#34;&gt;Example&lt;/a&gt;. It&amp;rsquo;s concise, example-oriented, and works only if there are code snippets relevant (e.g. API calls) that can be generated from the codebase. Like creating an llms.txt automatically, e.g. &lt;a href=&#34;https://context7.com/textualize/textual/llms.txt&#34;&gt;https://context7.com/textualize/textual/llms.txt&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;We will move towards an organization structure where developers are embedded with business teams rather than working as a separate group. Sort of like embedded executive assistance instead of a central typing pool. &lt;a href=&#34;https://www.oneusefulthing.org/p/making-ai-work-leadership-lab-and&#34;&gt;Making AI Work&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
  </channel>
</rss>
