<?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>ffmpeg on S Anand</title>
    <link>https://www.s-anand.net/blog/tag/ffmpeg/</link>
    <description>Recent content in ffmpeg on S Anand</description>
    <generator>Hugo -- 0.156.0</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 14 Jun 2026 08:27:16 +0530</lastBuildDate>
    <atom:link href="https://www.s-anand.net/blog/tag/ffmpeg/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Editing Workshop Videos</title>
      <link>https://www.s-anand.net/blog/editing-workshop-videos/</link>
      <pubDate>Sun, 14 Jun 2026 08:27:16 +0530</pubDate>
      <guid>https://www.s-anand.net/blog/editing-workshop-videos/</guid>
      <description>&lt;p&gt;I sometimes use &lt;a href=&#34;https://meet.google.com/&#34;&gt;Google Meet&lt;/a&gt;, &lt;a href=&#34;https://teams.microsoft.com/&#34;&gt;Teams&lt;/a&gt;, &lt;a href=&#34;https://www.zoom.com/&#34;&gt;Zoom&lt;/a&gt;, etc. to record workshops and talks. These record the entire session, including &lt;em&gt;before&lt;/em&gt; and &lt;em&gt;after&lt;/em&gt; the actual talk, and save it as large MP4 files.&lt;/p&gt;
&lt;p&gt;I use &lt;code&gt;ffmpeg&lt;/code&gt; to trim the video to just the talk, and then compress it for sharing. I&amp;rsquo;m sharing the options that work for me, discovered by trial-and-error.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To trim it&lt;/strong&gt;, I use the following command:&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ffmpeg -ss 00:10:00 -to 02:10:00 &lt;span class=&#34;se&#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;  -i &lt;span class=&#34;s2&#34;&gt;&amp;#34;original.mp4&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#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;  -map &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;se&#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;  -c copy &lt;span class=&#34;se&#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;  -avoid_negative_ts make_zero &lt;span class=&#34;se&#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;  -movflags +faststart &lt;span class=&#34;se&#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;  new.mp4
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Arguments:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-ss 00:10:00&lt;/code&gt;: Start reading from 10:00 into the source file. Placing -ss before -i makes this fast because ffmpeg seeks instead of decoding from the start.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-to 02:10:00&lt;/code&gt;: Stop at 02:10:00 in the source timeline. So this keeps roughly the section from 00:10:00 to 02:10:00.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-map 0&lt;/code&gt;: Keep all streams from the input: video, audio, subtitles, metadata streams, etc. Use &lt;code&gt;-map 0:v:0 -map 0:a:0&lt;/code&gt; for just the first video and audio streams.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-c copy&lt;/code&gt;: Do not re-encode. Just copy the existing encoded streams. This is very fast and preserves original quality, but cuts only cleanly near keyframes.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-avoid_negative_ts make_zero&lt;/code&gt;: Rewrite timestamps so the output starts cleanly near zero. This helps avoid weird negative timestamps and duration/reporting issues in some players.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-movflags +faststart&lt;/code&gt;: Move MP4 metadata to the beginning of the file. This helps playback start faster in browsers and streaming contexts.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;To compress it&lt;/strong&gt; I use:&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ffmpeg -i &lt;span class=&#34;s1&#34;&gt;&amp;#39;trimmed.mp4&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#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;  -map 0:v:0 -map 0:a:0 &lt;span class=&#34;se&#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;  -c:v libvpx-vp9 &lt;span class=&#34;se&#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;  -b:v &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;se&#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;  -crf &lt;span class=&#34;m&#34;&gt;42&lt;/span&gt; &lt;span class=&#34;se&#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;  -deadline realtime &lt;span class=&#34;se&#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;  -cpu-used &lt;span class=&#34;m&#34;&gt;8&lt;/span&gt; &lt;span class=&#34;se&#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;  -row-mt &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;se&#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;  -tile-columns &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;se&#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;  -frame-parallel &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;se&#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;  -threads &lt;span class=&#34;m&#34;&gt;8&lt;/span&gt; &lt;span class=&#34;se&#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;  -pix_fmt yuv420p &lt;span class=&#34;se&#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;  -vf &lt;span class=&#34;s2&#34;&gt;&amp;#34;fps=16&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#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;  -c:a libopus &lt;span class=&#34;se&#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;  -b:a 32k &lt;span class=&#34;se&#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;  -ac &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;se&#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;  -ar &lt;span class=&#34;m&#34;&gt;48000&lt;/span&gt; &lt;span class=&#34;se&#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;  -af &lt;span class=&#34;s2&#34;&gt;&amp;#34;highpass=f=80,lowpass=f=12000&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#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;s2&#34;&gt;&amp;#34;compressed.webm&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Arguments:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-map 0:v:0 -map 0:a:0&lt;/code&gt;: Use the first video stream and first audio stream from the input&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-c:v libvpx-vp9&lt;/code&gt;: Compress video with VP9 codec&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-b:v 0&lt;/code&gt;: Use constant-quality mode instead of targeting a fixed bitrate&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-crf 42&lt;/code&gt;: When testing on samples, CRF 42 was small enough and clear enough for me&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-deadline realtime&lt;/code&gt;: &lt;code&gt;-deadline good&lt;/code&gt; is too slow for me though that&amp;rsquo;s better for production&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-cpu-used 8&lt;/code&gt;: 8 is the maximum allowed for VP9 for now&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-row-mt 1&lt;/code&gt;: Enable row-based multithreading for faster VP9 encoding&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-tile-columns 2&lt;/code&gt;: Split each frame into tiles so multiple threads can encode in parallel&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-frame-parallel 1&lt;/code&gt;: Allow frames to be decoded in parallel; useful for VP9/WebM playback&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-threads 8&lt;/code&gt;: Use up to 8 CPU threads during encoding&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-pix_fmt yuv420p&lt;/code&gt;: Use the most compatible pixel format for browsers and video players&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-vf &amp;quot;fps=16&amp;quot;&lt;/code&gt;: Reduce frame rate to 16 fps to shrink file size; good enough for slides/talk videos&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-c:a libopus&lt;/code&gt;: Compress audio with Opus, the standard audio codec for WebM&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-b:a 32k&lt;/code&gt;: Use low audio bitrate; enough for speech&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-ac 1&lt;/code&gt;: Convert audio to mono; good for voice and halves stereo audio data&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-ar 48000&lt;/code&gt;: Use 48 kHz, the standard sample rate for Opus&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-af &amp;quot;highpass=f=80,lowpass=f=12000&amp;quot;&lt;/code&gt;: Remove very low rumble and very high noise; keeps speech frequencies&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I deploy these on CloudFlare R2 on a custom domain: &lt;a href=&#34;https://media.s-anand.net/&#34;&gt;media.s-anand.net&lt;/a&gt;. &lt;a href=&#34;https://developers.cloudflare.com/r2/pricing/&#34;&gt;R2 costs&lt;/a&gt; 1.5c / GB-month. Storing 10 years&amp;rsquo; worth of ~500 talks of ~0.5 GB each is under $4 / month - quite affordable. (If it increases, I can shift. Statis files are easy to move.)&lt;/p&gt;
&lt;p&gt;I serve them via a &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt; tag. Here is an &lt;a href=&#34;https://media.s-anand.net/2026-05-23-ai-unboxed-context-engineering.webm&#34;&gt;example video&lt;/a&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-html&#34; data-lang=&#34;html&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;video&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;preload&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;metadata&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;1920&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;1080&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;controls&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;style&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;max-width: 100%; height: auto;&amp;#34;&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;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;source&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;https://media.s-anand.net/2026-05-23-ai-unboxed-context-engineering.webm&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;video/webm; codecs=&amp;amp;quot;vp9, opus&amp;amp;quot;&amp;#34;&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;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;video&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;video preload=&#34;metadata&#34; width=&#34;1920&#34; height=&#34;1080&#34; controls style=&#34;max-width: 100%; height: auto;&#34;&gt;
  &lt;source src=&#34;https://media.s-anand.net/2026-05-23-ai-unboxed-context-engineering.webm&#34; type=&#34;video/webm; codecs=&amp;quot;vp9, opus&amp;quot;&#34;&gt;
&lt;/video&gt;
</description>
    </item>
    <item>
      <title>Recording screencasts</title>
      <link>https://www.s-anand.net/blog/recording-screencasts/</link>
      <pubDate>Wed, 11 Mar 2026 10:48:01 +0800</pubDate>
      <guid>https://www.s-anand.net/blog/recording-screencasts/</guid>
      <description>&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://files.s-anand.net/images/2026-03-11-recording-screencasts.avif&#34;&gt; &lt;!-- https://gemini.google.com/u/2/app/6cf35e0e4b2a90da --&gt;&lt;/p&gt;
&lt;p&gt;Since &lt;a href=&#34;https://www.s-anand.net/blog/ai-video-compression/&#34;&gt;WEBM compresses videos &lt;strong&gt;very&lt;/strong&gt; efficiently&lt;/a&gt;, I&amp;rsquo;ve started using videos more often. For example, in &lt;a href=&#34;https://www.s-anand.net/blog/prototyping-the-prototypes/&#34;&gt;Prototyping the prototypes&lt;/a&gt; and in &lt;a href=&#34;https://www.s-anand.net/blog/using-game-playing-agents-to-teach/&#34;&gt;Using game-playing agents to teach&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I use a &lt;a href=&#34;https://github.com/sanand0/scripts/blob/e0049d7b79d142e23b64fe9ce2c2a383ca8250a6/setup.fish#L442-L475&#34;&gt;fish script to compress screencasts&lt;/a&gt; like this:&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Increase quality with lower crf= (55 is default, 45 is better/larger)&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;# and higher fps= (5 is default, 10 is better/larger).&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;screencastcompress --crf &lt;span class=&#34;m&#34;&gt;45&lt;/span&gt; --fps &lt;span class=&#34;m&#34;&gt;10&lt;/span&gt; a.webm b.webm ...
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To &lt;em&gt;record&lt;/em&gt; the screencasts, I prefer slightly automated approaches for ease and quality.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;METHOD 1: Browser scrolling&lt;/strong&gt;: To uniformly scroll to the bottom of the page at ~800 pixels / second (roughly one page per second), I frame the recording window, start &lt;a href=&#34;https://help.gnome.org/gnome-help/screen-shot-record.html&#34;&gt;recording&lt;/a&gt;, and &lt;em&gt;quickly&lt;/em&gt; paste this script in the DevTools console:&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-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;scrollInterval&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;setInterval&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;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;scrollBy&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 class=&#34;mi&#34;&gt;16&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// Scroll 16px every 20ms (approx 800px/s)
&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;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;innerHeight&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;scrollY&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;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;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;scrollHeight&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;clearInterval&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;scrollInterval&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;console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Reached bottom or no more scrolling.&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 class=&#34;mi&#34;&gt;20&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;This is what I used in &lt;a href=&#34;https://www.s-anand.net/blog/prototyping-the-prototypes/&#34;&gt;Prototyping the prototypes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;METHOD 2: AI Coding Agents&lt;/strong&gt;: I tell the coding agent to:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;hellip; screenshot each step at 1366x768, compressing into video.webm at 1.5 fps, pausing the last frame for 5 seconds.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If playwright and ffmpeg are set up, this &lt;em&gt;just works&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This is what I used in &lt;a href=&#34;https://www.s-anand.net/blog/using-game-playing-agents-to-teach/&#34;&gt;Using game-playing agents to teach&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>AI video compression</title>
      <link>https://www.s-anand.net/blog/ai-video-compression/</link>
      <pubDate>Sat, 28 Feb 2026 09:18:56 +0800</pubDate>
      <guid>https://www.s-anand.net/blog/ai-video-compression/</guid>
      <description>&lt;p&gt;I recorded a short screen cast of a demo I built. It was ~900KB - way too large to publish as a thumbnail. So I asked ChatGPT:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What&amp;rsquo;s the best equivalent of squoosh.app for WEBM compression? I&amp;rsquo;m looking for a free modern high-quality online video compressor.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;There are a few, and they compressed it to a third of its size, but 300KB is still too large. So I attached the original and asked:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I am compressing screenshots like this. They&amp;rsquo;re often not large. I don&amp;rsquo;t mind cropping the edges by a few pixels to make it a multiple 2, 4, or 8 if that&amp;rsquo;ll help. I certainly am OK with a lower frame rate. I&amp;rsquo;d like an image quality that a human eye can just SLIGHTLY detect as worse than the original, but only VERY SLIGHTLY.&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s the best way of using ffmpeg or similar tools to compress such a file?&lt;/p&gt;
&lt;p&gt;Think like an expert:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What would an expert in this field check that beginners would miss?&lt;/li&gt;
&lt;li&gt;What patterns would an expert in this field recognize that beginners would miss?&lt;/li&gt;
&lt;li&gt;In this context, what questions would an expert ask that a beginner would not know to?&lt;/li&gt;
&lt;li&gt;If this goes wrong, what are the most likely reasons?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;hellip; and list the best (diverse, testing different hypotheses) compression command options.&lt;/p&gt;
&lt;p&gt;Run them on this video and let me download the resulting videos for visual comparison. Interview me. Give me a list of questions that I can easily answer by looking at the videos and I&amp;rsquo;ll share those with you to help you decide the best compression command for me.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This leverages 3 tricks.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;These are online coding agents. So they can write &lt;em&gt;and&lt;/em&gt; run code.&lt;/li&gt;
&lt;li&gt;The &amp;ldquo;Think like an expert&amp;rdquo; prompt is my new &amp;ldquo;Think step by step&amp;rdquo; prompt and works quite well.&lt;/li&gt;
&lt;li&gt;The &amp;ldquo;Interview me&amp;rdquo; prompt is another powerful one that helps me apply preferences &amp;ndash; and &lt;a href=&#34;https://www.s-anand.net/blog/how-to-develop-taste/&#34;&gt;develop taste&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href=&#34;https://claude.ai/share/73d1caae-4e4e-4c1b-8984-44ac3e86f7cf&#34;&gt;Claude&lt;/a&gt; did a good job of showing different versions and compressing it, but as expected, &lt;a href=&#34;https://chatgpt.com/share/69a24385-87b8-8003-8f41-cb3757a62d13&#34;&gt;ChatGPT&lt;/a&gt; was the obsessive perfectionist. It gave me a huge set of variations of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Files sizes&lt;/li&gt;
&lt;li&gt;Compression formats (VP9: more compatible vs AV1: better compression)&lt;/li&gt;
&lt;li&gt;Quality settings (CRF)&lt;/li&gt;
&lt;li&gt;Frame rates (FPS)&lt;/li&gt;
&lt;li&gt;Color formats (YUV420p vs YUV444p)&lt;/li&gt;
&lt;li&gt;Compression effort (presets)&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;hellip; and asked me to compare between them, like these:&lt;/p&gt;
&lt;div style=&#34;display:flex; gap:12px; flex-wrap:nowrap; align-items:flex-start;&#34;&gt;
  &lt;figure style=&#34;margin:0; text-align:center;&#34;&gt;
    &lt;video src=&#34;https://files.s-anand.net/images/2026-02-28-sql-screencast-crf45-fps15.webm&#34; autoplay loop muted playsinline preload=&#34;metadata&#34; width=&#34;230&#34;&gt;&lt;/video&gt;
    &lt;figcaption&gt;crf: 45 fps: 15 (93K)&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;figure style=&#34;margin:0; text-align:center;&#34;&gt;
    &lt;video src=&#34;https://files.s-anand.net/images/2026-02-28-sql-screencast-crf50-fps15.webm&#34; autoplay loop muted playsinline preload=&#34;metadata&#34; width=&#34;230&#34;&gt;&lt;/video&gt;
    &lt;figcaption&gt;crf: 50 fps: 15 (69K)&lt;/figcaption&gt;
  &lt;/figure&gt;
  &lt;figure style=&#34;margin:0; text-align:center;&#34;&gt;
    &lt;video src=&#34;https://files.s-anand.net/images/2026-02-28-sql-screencast-crf55-fps5.webm&#34; autoplay loop muted playsinline preload=&#34;metadata&#34; width=&#34;230&#34;&gt;&lt;/video&gt;
    &lt;figcaption&gt;crf: 55 fps: 5 (23K)&lt;/figcaption&gt;
  &lt;/figure&gt;
&lt;/div&gt;
&lt;p&gt;The final result is this script:&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ffmpeg -hide_banner -stats -v warning -i &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$input&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  -vf &lt;span class=&#34;s2&#34;&gt;&amp;#34;crop=iw-mod(iw\,2):ih-mod(ih\,2),fps=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$fps&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#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;  -c:v libsvtav1 -preset &lt;span class=&#34;m&#34;&gt;8&lt;/span&gt; -crf &lt;span class=&#34;nv&#34;&gt;$crf&lt;/span&gt; -pix_fmt yuv420p &lt;span class=&#34;se&#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;  -an &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$output&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;hellip; which does the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Crops the video to a multiple of 2 (which is required for some compression formats)&lt;/li&gt;
&lt;li&gt;Sets the frame rate to a lower value (which reduces file size)&lt;/li&gt;
&lt;li&gt;Uses the AV1 codec (which has better compression than VP9)&lt;/li&gt;
&lt;li&gt;Sets the CRF (Constant Rate Factor) to a value that balances quality and file size&lt;/li&gt;
&lt;li&gt;Sets the pixel format to YUV420p (which is more compatible with players)&lt;/li&gt;
&lt;li&gt;Disables audio (which is not needed for a screencast)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I realized that for the resolution I&amp;rsquo;ll likely see this at, very low frame rates (5 fps) and poor compressions (CRF 55) are good enough.&lt;/p&gt;
&lt;p&gt;My original video was 912KB. The smallest video that looks good enough for me is 23 KB. That&amp;rsquo;s almost a &lt;strong&gt;40x compression&lt;/strong&gt; - small enough to &lt;a href=&#34;https://sanand0.github.io/datastories/sql-migration/&#34;&gt;publish in my data story&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Things I&amp;rsquo;m taking away:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use AI to discover the best configurations for your tool&lt;/li&gt;
&lt;li&gt;Interview yourself to apply preferences and develop taste&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 15 Feb 2026</title>
      <link>https://www.s-anand.net/blog/things-i-learned-15-feb-2026/</link>
      <pubDate>Sun, 15 Feb 2026 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-15-feb-2026/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ffmpeg&lt;/code&gt; lets you concatenate files without needing a separate input file. &lt;code&gt;ffmpeg -i &amp;quot;concat:input1.ext|input2.ext|input3.ext&amp;quot; -c copy output.ext&lt;/code&gt; works as long as the files use the same codecs and parameters.&lt;/li&gt;
&lt;li&gt;There is a psychological phenomenon where we &amp;ldquo;overlay&amp;rdquo; old images of people we haven&amp;rsquo;t seen in decades onto their current selves, making it hard to distinguish between someone who is 30 and someone who is 70. &lt;a href=&#34;https://gemini.google.com/share/1348ea514d1e&#34;&gt;Gemini&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Most modern &lt;code&gt;ls&lt;/code&gt; tools like &lt;a href=&#34;https://github.com/eza-community/eza&#34;&gt;&lt;code&gt;eza --icons&lt;/code&gt;&lt;/a&gt; or &lt;a href=&#34;https://github.com/lsd-rs/lsd&#34;&gt;&lt;code&gt;lsd&lt;/code&gt;&lt;/a&gt; support icons if the terminal font supports icons, like &lt;a href=&#34;https://www.nerdfonts.com/&#34;&gt;Nerd Fonts&lt;/a&gt;. For example, this: &lt;code&gt;&lt;/code&gt; shows up as a GitHub icon and &lt;code&gt;󰌻&lt;/code&gt; as a LinkedIn icon. The &lt;a href=&#34;https://www.nerdfonts.com/cheat-sheet&#34;&gt;Nerd Fonts Cheat Sheet&lt;/a&gt; is a good place to search for these. You may need to download a &lt;a href=&#34;https://www.nerdfonts.com/font-downloads&#34;&gt;supporting font&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I just replaced &lt;a href=&#34;https://github.com/tonsky/FiraCode&#34;&gt;Fira Code&lt;/a&gt; with &lt;a href=&#34;https://font.subf.dev/en/&#34;&gt;Maple Mono&lt;/a&gt; as my default font on VS Code. Like Fira Code, the ligatures are great, but there are extra ligatures like [TODO] or [ERROR], &lt;em&gt;connected italics&lt;/em&gt;, nerd font support, variable font weights, and more. Via &lt;a href=&#34;https://lobste.rs/s/ahca9t/maple_mono_open_source_monospace_font&#34;&gt;lobste.rs&lt;/a&gt;. (&lt;strong&gt;Update&lt;/strong&gt;: Maple Mono is &lt;em&gt;much&lt;/em&gt; harder to read than Fira Code, so I switched back. But it&amp;rsquo;s a nice idea.)&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Self-discover LLM capabilities</title>
      <link>https://www.s-anand.net/blog/self-discover-llm-capabilities/</link>
      <pubDate>Sat, 10 Jan 2026 11:40:00 +0800</pubDate>
      <guid>https://www.s-anand.net/blog/self-discover-llm-capabilities/</guid>
      <description>&lt;p&gt;Q: &amp;ldquo;How do we learn what we can do with AI agents?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Me: &amp;ldquo;Ask them!&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I mean, they are probably aware of their abilities. They can search online for how other people are using them. They have access to tools (connect to GMail, write &amp;amp; run code, etc.) which they&amp;rsquo;re aware of, and even if not, can try out.&lt;/p&gt;
&lt;p&gt;Asking them seems a useful way of figuring out how to use them.&lt;/p&gt;
&lt;p&gt;For example, I didn&amp;rsquo;t know that &lt;a href=&#34;https://www.ffmpeg.org/&#34;&gt;&lt;code&gt;ffmpeg&lt;/code&gt;&lt;/a&gt; (which ChatGPT, Gemini, Claude, etc. can run) can visualize audio using filters. They could create a bunch of stunning visualizations as a video compilation.&lt;/p&gt;
&lt;p&gt;So, I &lt;a href=&#34;https://claude.ai/share/88b3dec2-3f15-45b1-868d-44f051dcf20f&#34;&gt;told Claude&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I did not know ffmpeg could visualize audio via filters&amp;hellip;&lt;br&gt;
You have a container environment with a set of tools installed and you can run commands.&lt;br&gt;
Identify creative ways in which the tools you have access to can be used&amp;hellip;&lt;br&gt;
&amp;hellip;&lt;br&gt;
Fact-check by cursorily verifying the command options&amp;hellip;&lt;br&gt;
But no need to implement any of these&amp;hellip;&lt;br&gt;
BLOW MY MIND!!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It gave me &lt;a href=&#34;https://www.s-anand.net/blog/notes/llm-creative-tool-capabilities/&#34;&gt;125 ideas&lt;/a&gt; from drum patterns of log timestamps, directory structures as artistic graphs, frequency domains of images via Fourier transforms, morphological image erosion/dilation effects, and a whole bunch of things I&amp;rsquo;ve never heard of.&lt;/p&gt;
&lt;p&gt;It was too much, so I didn&amp;rsquo;t bother. (I&amp;rsquo;ll read later.)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Implement the most visually impressive among these.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And the result was a stunning video compilation:&lt;/p&gt;
&lt;div class=&#34;video-embed&#34;&gt;&lt;iframe src=&#34;https://www.youtube.com/embed/d7NXU2jeSiU&#34; title=&#34;YouTube video&#34; loading=&#34;lazy&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;p&gt;It generated these 10 &lt;em&gt;purely&lt;/em&gt; algorithmic (no external assets) visualizations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Mandelbrot Set&lt;/strong&gt; via FFmpeg&amp;rsquo;s &lt;code&gt;mandelbrot&lt;/code&gt; filter: Deep zoom into the famous seahorse valley, revealing infinite complexity from z² + c&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sierpinski Carpet&lt;/strong&gt; via FFmpeg&amp;rsquo;s &lt;code&gt;sierpinski&lt;/code&gt; filter: Recursive self-similar fractal pattern that animates through chaos game iterations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Game of Life&lt;/strong&gt; via FFmpeg&amp;rsquo;s &lt;code&gt;life&lt;/code&gt; filter: Conway&amp;rsquo;s cellular automaton with glowing cells and mold trails showing emergent complexity from 4 simple rules&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rule 30&lt;/strong&gt; via FFmpeg&amp;rsquo;s &lt;code&gt;cellauto&lt;/code&gt; filter: Wolfram&amp;rsquo;s elementary cellular automaton that generates apparent randomness from deterministic rules&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Domain Coloring&lt;/strong&gt; via Python + NumPy: Complex function visualization where hue represents angle and brightness represents magnitude, morphing through z², z³, and rational functions&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;L-Systems&lt;/strong&gt; via Python + PIL: Three fractal trees grow algorithmically using Lindenmayer system grammar rules - pure mathematical botany&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Barnsley Fern&lt;/strong&gt; via Python chaos game: 500,000 points plotted using an Iterated Function System, emerging from randomness into a perfect fern&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Julia Set&lt;/strong&gt; via Python + NumPy: Dancing fractals as the complex parameter c traces a wobbling circle, continuously morphing fractal boundaries&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plasma Effect&lt;/strong&gt; via FFmpeg&amp;rsquo;s &lt;code&gt;geq&lt;/code&gt; expression filter: Real-time interference patterns using layered sine waves in RGB channels&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gradient Spiral&lt;/strong&gt; via FFmpeg&amp;rsquo;s &lt;code&gt;gradients&lt;/code&gt; filter: Six-color rotating spiral with 8x speed, creating hypnotic color field animation&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;hellip; with cinematic title cards (fade transitions, credits) in a 1080×1080 square format perfect for social media.&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://files.s-anand.net/images/2026-01-10-self-discover-llm-capabilities.webp&#34;&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;I learnt at least a few things from this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;The tool side&lt;/strong&gt;. I now know that &lt;code&gt;ffmpeg&lt;/code&gt; has built-in fractal capability. Fractals have fascinated me since I was 12. This is something to explore.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The technique side&lt;/strong&gt;. I&amp;rsquo;m learning new terms like &amp;ldquo;temporal slit-scan photography&amp;rdquo; - used to create time-slice effects like bullet time in &lt;em&gt;The Matrix&lt;/em&gt;, using &lt;code&gt;ffmpeg&lt;/code&gt;. Or &amp;ldquo;music chord visualization&amp;rdquo; using &lt;a href=&#34;https://graphviz.org/docs/layouts/neato/&#34;&gt;&lt;code&gt;neato&lt;/code&gt;&lt;/a&gt;, or capturing packet flow data using &lt;a href=&#34;https://www.tcpdump.org/&#34;&gt;&lt;code&gt;tcpdump&lt;/code&gt;&lt;/a&gt; to visualize network traffic, etc.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I would never have thought of these, but the capabilities are in my hands.&lt;/p&gt;
&lt;p&gt;I think there&amp;rsquo;s benefit in just spending time with LLMs, asking them (in different ways) what they can do, and what would help, interest, or even amuse us.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;PS: &lt;a href=&#34;https://chatgpt.com/share/6961c2ea-f7d4-800c-8133-26d67a7bc5eb&#34;&gt;ChatGPT&amp;rsquo;s response to this&lt;/a&gt; was a bunch of good ideas and a &lt;em&gt;tiny&lt;/em&gt; 0.5 second Mandelbrot video. Gemini shared a tiny list of 10 ideas (&lt;a href=&#34;https://www.s-anand.net/blog/notes/llm-creative-tool-capabilities/&#34;&gt;read them all&lt;/a&gt;) but made up with this brilliant Veo-generated video.&lt;/p&gt;
&lt;div class=&#34;video-embed&#34;&gt;&lt;iframe src=&#34;https://www.youtube.com/embed/tzXZzVgJP78&#34; title=&#34;YouTube video&#34; loading=&#34;lazy&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;!-- https://claude.ai/chat/a014c8c7-4179-400f-9a80-75d849ccec41 --&gt;
&lt;!-- https://chatgpt.com/c/69477805-b150-8321-bdf7-d654222f867c via Gramener ID --&gt;
&lt;hr&gt;
&lt;p&gt;&lt;a href=&#34;https://www.linkedin.com/posts/sanand0_q-how-do-we-learn-what-we-can-do-with-ai-activity-7415939924937379841-Wrdp&#34;&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    <item>
      <title></title>
      <link>https://www.s-anand.net/blog/ai-agents-are-messing-up-software-tool-learning/</link>
      <pubDate>Tue, 23 Dec 2025 05:36:05 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/ai-agents-are-messing-up-software-tool-learning/</guid>
      <description>&lt;p&gt;AI agents are messing up software tool learning.&lt;/p&gt;
&lt;p&gt;Normally, we need to pass stages of competence:&lt;/p&gt;
&lt;p&gt;KNOW what you can do&lt;br&gt;
LEARN how to do it&lt;br&gt;
EXECUTE it.&lt;/p&gt;
&lt;p&gt;Excel: &lt;strong&gt;KNOW&lt;/strong&gt; you can summarize by category, &lt;strong&gt;LEARN&lt;/strong&gt; pivot tables, &lt;strong&gt;EXECUTE&lt;/strong&gt; an Insert → PivotTable → select data range → drag &amp;hellip;&lt;/p&gt;
&lt;p&gt;Photoshop: &lt;strong&gt;KNOW&lt;/strong&gt; you can erase objects, &lt;strong&gt;LEARN&lt;/strong&gt; Content-Aware Fill, &lt;strong&gt;EXECUTE&lt;/strong&gt; Lasso tool → select → Edit → Content-Aware Fill → &amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AI agents collapse these stages&lt;/strong&gt;. Especially with command line tools.&lt;/p&gt;
&lt;p&gt;For example, I did not &lt;strong&gt;KNOW&lt;/strong&gt; ffmpeg could visualize audio, nor &lt;strong&gt;LEARN&lt;/strong&gt; the complex filters, nor &lt;strong&gt;EXECUTE&lt;/strong&gt; it on my laptop.&lt;/p&gt;
&lt;p&gt;Instead, I told Claude to &lt;em&gt;Visualize this audio clip creatively in multiple ways&lt;/em&gt;. It generated a dozen stunning visualizations of this Why This Kolaveri clip: &lt;a href=&#34;https://lnkd.in/g7vfcPEs&#34;&gt;https://lnkd.in/g7vfcPEs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t KNOW ⮕ LEARN ⮕ EXECUTE. I did an EXECUTE ⮕ KNOW ⮕ don&amp;rsquo;t bother to LEARN.&lt;/p&gt;
&lt;p&gt;Since that&amp;rsquo;s possible, my prompts are now like: &amp;ldquo;I don&amp;rsquo;t know what I want. Guess my desires. Fulfill them. Show me. Then maybe I&amp;rsquo;ll know what I want.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Which is fantastic! But on the other hand, this &lt;strong&gt;TOTALLY&lt;/strong&gt; messes up how I teach software tools&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://files.s-anand.net/images/2025-12-23-4-stages-of-competence-linkedin.webp&#34;&gt;&lt;/p&gt;
&lt;div class=&#34;video-embed&#34;&gt;&lt;iframe src=&#34;https://www.youtube.com/embed/VXkf0zeRhJ4&#34; title=&#34;YouTube video&#34; loading=&#34;lazy&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&#34;https://www.linkedin.com/posts/sanand0_ai-agents-are-messing-up-software-tool-learning-activity-7408179762227159041-_Pof&#34;&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 21 Dec 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-21-dec-2025/</link>
      <pubDate>Sun, 21 Dec 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-21-dec-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;uvx --python 3.10 --with torchcodec demucs --two-stems=vocals -n htdemucs &amp;quot;song.mp3&amp;quot;&lt;/code&gt; separates vocals from music.&lt;/li&gt;
&lt;li&gt;iTunes offers a 30 second preview for almost any song. If you&amp;rsquo;re looking for 30s song clips to analyze, this is a good bet. For example: &lt;code&gt;curl -s &amp;quot;https://itunes.apple.com/search?entity=song&amp;amp;limit=1&amp;amp;term=why+this+kolaveri&amp;quot; | jq -r &#39;.results[0].previewUrl&#39;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;To generate a spectrogram from an audio file, use &lt;code&gt;ffmpeg -i song.mp3 -lavfi showspectrum=color=magma:slide=1 spectrogram.mp4&lt;/code&gt;. To generate a waveform, use &lt;code&gt;ffmpeg -i song.mp3 -filter_complex &amp;quot;[0:a]showwaves=s=1280x240:mode=cline:colors=white[v]&amp;quot; -map &amp;quot;[v]&amp;quot; -map 0:a -c:v libx264 -crf 30 -pix_fmt yuv420p waveform.mp4&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;I updated the TTS (text-to-speech) costs across Gemini and OpenAI at &lt;a href=&#34;https://github.com/sanand0/openai-tts-cost&#34;&gt;https://github.com/sanand0/openai-tts-cost&lt;/a&gt;. My current favorite (value for money) is Gemini 2.5 Flash Preview TTS. Good emotions, low price, and a single request can deliver a multi-voice podcast. Speed: ~25 seconds per minute of audio generated.&lt;/li&gt;
&lt;li&gt;Self-driving car mishaps. The exceptions that prove the rule (that autonomous vehicles are safer than human drivers). &lt;a href=&#34;https://gemini.google.com/u/2/app/195e3d3fa74368fd&#34;&gt;#&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Waymo &amp;amp; The Gun Shootout:&lt;/strong&gt; A driverless Waymo taxi in Los Angeles drove straight through an active police standoff, passing mere feet from a suspect being held at gunpoint while officers shouted at the car to stop. &lt;a href=&#34;https://www.tmz.com/2025/12/01/waymo-police-standoff/&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tesla &amp;amp; The Horse Carriage:&lt;/strong&gt; It was a horse-drawn carriage in Switzerland. The Tesla’s computer became &amp;ldquo;bamboozled,&amp;rdquo; rapidly misidentifying the cart as a truck, then a car, then a pedestrian, because it had likely never been trained on animal-drawn vehicles. &lt;a href=&#34;https://autofile.co.nz/horse-drawn-carriage-confuses-tesla-&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The &amp;ldquo;Wet Cement&amp;rdquo; Trap:&lt;/strong&gt; A Cruise robotaxi in San Francisco drove directly into a patch of freshly poured wet concrete at a construction site and got hopelessly stuck, requiring workers to pull it out. &lt;a href=&#34;https://www.google.com/search?q=https://www.sfgate.com/tech/article/cruise-stuck-wet-concrete-san-francisco-18297946.php&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Moon is a Traffic Light:&lt;/strong&gt; A Tesla driver discovered that his car kept slamming on the brakes on the highway because the autopilot camera was confusing the bright yellow moon for a yellow traffic light. &lt;a href=&#34;https://futurism.com/the-byte/tesla-autopilot-mistakes-moon-traffic-light&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The 4 AM Honking Ritual:&lt;/strong&gt; Residents in a San Francisco neighborhood were kept awake for weeks because a fleet of Waymo taxis gathered in a parking lot every night and started honking at each other while trying to park. &lt;a href=&#34;https://www.google.com/search?q=https://www.theverge.com/2024/8/12/24219080/waymo-san-francisco-parking-lot-honking&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stopping for Whoppers:&lt;/strong&gt; Tesla owners reported their cars were reading &amp;ldquo;Burger King&amp;rdquo; signs on the side of the road as &amp;ldquo;Stop&amp;rdquo; signs and abruptly braking, a glitch the fast-food chain quickly turned into a marketing campaign. &lt;a href=&#34;https://www.google.com/search?q=https://www.foxnews.com/auto/burger-king-tesla-autopilot-stop-signs&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Robotaxi &amp;ldquo;Mating Ritual&amp;rdquo;:&lt;/strong&gt; A group of about 20 Cruise robotaxis lost connection to their servers simultaneously and simply stopped in the middle of a busy San Francisco street, creating a massive traffic jam that humans had to manually clear. &lt;a href=&#34;https://www.google.com/search?q=https://www.wired.com/story/cruise-robotaxi-self-driving-cars-san-francisco-traffic-stall/&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Trapped by Cones:&lt;/strong&gt; A Waymo taxi in Arizona was defeated by a set of construction cones, fleeing from them into oncoming traffic lanes and eventually getting stuck, forcing the passenger to flee the &amp;ldquo;confused&amp;rdquo; vehicle. &lt;a href=&#34;https://www.google.com/search?q=https://www.theverge.com/2021/5/14/22436272/waymo-driverless-van-stuck-blocked-road-arizona&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Defeated by a T-Shirt:&lt;/strong&gt; A distinct vulnerability was found where self-driving cars could be tricked into slamming on the brakes simply by a pedestrian wearing a T-shirt with a &amp;ldquo;Stop&amp;rdquo; sign printed on it. &lt;a href=&#34;https://www.google.com/search?q=https://arstechnica.com/cars/2023/02/t-shirt-with-stop-sign-print-fools-self-driving-cars/&#34;&gt;Source&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Roblox is the #1 game. Sadly, there&amp;rsquo;s no official Linux support. &lt;a href=&#34;https://blog.cloudflare.com/radar-2025-year-in-review-internet-services/&#34;&gt;CloudFlare 2025 Report&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;⭐ &lt;a href=&#34;https://astral.sh/blog/ty&#34;&gt;Ty&lt;/a&gt;, Astral&amp;rsquo;s type checker, is &lt;em&gt;fantastic&lt;/em&gt;! It shows the type of every variable inline. A great incentive to explicitly type stuff in Python. Lots more to explore. I switched from Pylance to the &lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=astral-sh.ty&#34;&gt;ty VS Code extension&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/raineorshine/npm-check-updates&#34;&gt;&lt;code&gt;npx -y npm-check-updates&lt;/code&gt;&lt;/a&gt; tells you the latest versions of your &lt;code&gt;package.json&lt;/code&gt; dependencies, including major version updates.&lt;/li&gt;
&lt;li&gt;How to think differently. &lt;a href=&#34;https://gemini.google.com/u/2/app/b3f00b87146cecc3&#34;&gt;#&lt;/a&gt; &lt;a href=&#34;https://chatgpt.com/c/6940eb78-ae2c-8320-9e4e-ebab68d3b2e2&#34;&gt;#&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Introspect:&lt;/strong&gt; List assumptions &amp;amp; taboos. Write a falsifier. Beginner&amp;rsquo;s mindset&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mental models:&lt;/strong&gt; First principles, inversion, base rates, lateral thinking, multiple options, &amp;ldquo;what would have to be true&amp;rdquo;, &amp;hellip;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Empathy:&lt;/strong&gt; Debate FOR opposition. Swap roles (competitor, auditor, 12-year old, future-you, &amp;hellip;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Environment:&lt;/strong&gt; Different context (place, media, people&amp;hellip;). New constraints (time, budget, time horizon, &amp;hellip;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;m surprised that Edge&amp;rsquo;s &lt;a href=&#34;https://www.microsoft.com/en-us/edge/features/read-aloud&#34;&gt;Read Aloud&lt;/a&gt; sounds more natural than &lt;a href=&#34;https://elevenreader.io/&#34;&gt;EleventReader&lt;/a&gt;. Read Aloud is one of the main reasons I&amp;rsquo;m using Edge, but I hadn&amp;rsquo;t realized it was that good.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://lilianweng.github.io/posts/2025-05-01-thinking/&#34;&gt;Why We Think&lt;/a&gt; has interesting insights on scaling from feedback: &lt;a href=&#34;https://claude.ai/chat/5dbf8fe0-081a-4d4a-926d-b4d74846ec85&#34;&gt;#&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Summary: &lt;strong&gt;Give models a feedback environment unbiased by their reasoning.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;There are basically two approaches: parallel and sequential.&lt;/li&gt;
&lt;li&gt;Parallel is simpler. Generate a bunch of different solutions and pick the best one. Like having multiple people solve the same problem independently, then going with whoever got the right answer.&lt;/li&gt;
&lt;li&gt;Sequential is trickier. You generate a solution, then ask the model to critique it and try again. This sounds good in theory but is surprisingly hard to get right.&lt;/li&gt;
&lt;li&gt;The problem is models aren&amp;rsquo;t naturally good at self-correction. Left to their own devices, they&amp;rsquo;ll often make things worse. They&amp;rsquo;ll change correct answers to incorrect ones. Or they&amp;rsquo;ll just superficially reword their first answer without fixing anything.&lt;/li&gt;
&lt;li&gt;To make self-correction work, you need external feedback. A unit test that fails. A ground truth to compare against. Something outside the model&amp;rsquo;s own judgment.&lt;/li&gt;
&lt;li&gt;When you get it right though, sequential revision can be powerful. You&amp;rsquo;re not just sampling from the model&amp;rsquo;s distribution anymore. You&amp;rsquo;re searching through it, iterating toward better answers.&lt;/li&gt;
&lt;li&gt;But there&amp;rsquo;s a trap. If you start optimizing directly on the reasoning traces—rewarding &amp;ldquo;good reasoning&amp;rdquo; as a goal in itself—the model learns to game it. It&amp;rsquo;ll hide its real thought process and show you what you want to see.&lt;/li&gt;
&lt;li&gt;This is why the DeepSeek team gave up on process reward models. They tried rewarding intermediate reasoning steps, but it led to reward hacking. The model would generate reasoning that looked good to the reward model while doing something completely different.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://arxiv.org/abs/2510.26396&#34;&gt;A Pragmatic View of AI Personhood&lt;/a&gt; was rewritten in Tim Urban&amp;rsquo;s style, para-by-para, by &lt;a href=&#34;https://chatgpt.com/share/693aa6ff-b2f4-800c-8f44-b061419cd6ff&#34;&gt;ChatGPT&lt;/a&gt;:
&lt;ul&gt;
&lt;li&gt;AI having feelings is irrelevant. Does a design increase conflict, manipulation, or suffering among humans? If so, regulate that - limit certain kinds of anthropomorphic design, tie &amp;ldquo;rights&amp;rdquo; for AIs to strict anti-manipulation constraints, etc.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI can act after owners vanish&lt;/strong&gt;. Pragmatically, you sometimes need to bite the bullet and say: &amp;ldquo;Okay, this thing itself is going to be treated as a legal person in these specific ways, so we can actually regulate and sanction it.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Corporations are &amp;ldquo;slow AIs&amp;rdquo; already — optimizing for growth without ethics.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Slaves had a fund&lt;/strong&gt;. If the slave caused harm, the owner&amp;rsquo;s liability could be capped at that fund. Modern equivalent for AI: Agents must maintain locked capital or insurance. Victims are compensated from that pool. If the pool runs out; they lose their license to operate. This gives sanctions teeth: the AI (or its backers) actually have something to lose.&lt;/li&gt;
&lt;li&gt;Require AIs to register before they can do economically important things. No title &amp;gt; no access to key platforms, payment rails, or official functions.&lt;/li&gt;
&lt;li&gt;Expanding personhood to non-humans sounds nice - more compassion, more care, more inclusion. But authenticity becomes a new asset. Humans and AIs will both want authenticity tokens. Poor will sell biometric credentials to rich, creating an authenticity social class. Your dignity as a person gets replaced by your usefulness as a key. Make it illegal and practically very hard to sell / rent out your humanity.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&amp;ldquo;When people now talk about error, they tend to think of bias as an explanation. One of the major limitations on human performance is not bias, it is just noise. In fact, most of the errors that people make are better viewed as random noise, and there is an awful lot of it. Even when the algorithm does not do very well, humans do so poorly and are so noisy that, just by removing the noise, you can do better than people. We are narrow thinkers, we are noisy thinkers, and it is very easy to improve upon us. I do not think that there is very much that we can do that computer will not eventually be programmed to do.&amp;rdquo; &lt;a href=&#34;https://www.nber.org/system/files/chapters/c14016/c14016.pdf&#34;&gt;Kahnemann&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Notes from &lt;a href=&#34;https://www.soundformovement.com/chatgpt-pro-as-first-hire&#34;&gt;One Year With ChatGPT Pro as a First Hire&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Each day I start a new Pro chat that will run for that entire day&lt;/strong&gt;. I treat it as a colleague. I speak or type in whatever I am thinking about, including business problems, creative questions, experiments that worked or failed and feelings about particular decisions. I wear noise canceling earbuds and often run piano technique while the model is thinking. I listen to its response using the native “Read Aloud” feature, again while practicing, and stop to make notes in a physical notebook to collect inspiration. At the end of the day I ask that Pro model to summarize everything from that chat along with the notes I give it from my notebook, and &lt;strong&gt;that summary becomes our first prompt of the next day&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Standard Voice Mode (SVM) can do things that Advanced Voice Mode (AVM) cannot and vice versa.SVM feels like it wants to talk forever, while AVM feels like it wants to get off the phone.&lt;/li&gt;
&lt;li&gt;Projects became the container for my daily Pro chats. I pull chats, notes and other files into project folders so I can reference them as static context.&lt;/li&gt;
&lt;li&gt;My scheduled tasks collection today consists of weekly lessons in math, ML and DL, design, market analysis and regular assessments of the UI and UX and copy on my company’s website.&lt;/li&gt;
&lt;li&gt;I let memory accumulate, then once a week I pruned it manually, removing entries that were no longer useful so that new memories could form.&lt;/li&gt;
&lt;li&gt;Connecting the ChatGPT macOS app to my terminal, using the Working with Apps feature, lets the Pro models essentially collaborate with Codex. Practicing collaborative context between these high end models fractals outward into a myriad of productive paths. I highly recommend exploring with 5.1 Pro connected to 5.1-Codex-Max (Very High) in a terminal. Tell Codex-5.1 that you have a buddy working with you today that can offer suggestions and review the work it does as we go. Then tell 5.1 Pro that you have a buddy that is working with you today and can apply any of the code changes we decide on. This is another form of “context priming” where I “set the scene” before jumping in.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Coding agents only need a bash tool. The rest is buildable. The only addition might be a fuzzy search / replace tool. &lt;a href=&#34;https://mariozechner.at/posts/2025-11-30-pi-coding-agent/&#34;&gt;What I learned building an opinionated and minimal coding agent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Sources of model data: &lt;a href=&#34;https://models.dev/&#34;&gt;https://models.dev/&lt;/a&gt;, &lt;a href=&#34;https://openrouter.ai/&#34;&gt;https://openrouter.ai/&lt;/a&gt;, llm-pricing&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 - 29 Jun 2025</title>
      <link>https://www.s-anand.net/blog/things-i-learned-29-jun-2025/</link>
      <pubDate>Sun, 29 Jun 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-29-jun-2025/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;People are great at feedback on what you are doing wrong. They are not so good at telling you how to fix it. They don&amp;rsquo;t know you that well.&amp;rdquo; &lt;a href=&#34;https://amitkaps.com/&#34;&gt;Amit Kapoor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/steveruizok/perfect-cursors&#34;&gt;Perfect Cursors&lt;/a&gt; makes periodic cursor positions animate smoothly by interpolating on a spline**&lt;/li&gt;
&lt;li&gt;CloudFlare &lt;em&gt;and&lt;/em&gt; Vercel now support sandboxes where you can execute code. The price is not so low that we can execute for free in bulk but works well infrequent or batched code execution. &lt;a href=&#34;https://simonwillison.net/2025/Jun/26/sandboxes/&#34;&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Here&amp;rsquo;s how I&amp;rsquo;m using ffmpeg for video recording &amp;amp; editing.
&lt;ul&gt;
&lt;li&gt;To record screen at 5 frames per second, I run an abbreviation &lt;code&gt;screenrecord&lt;/code&gt; which maps to:&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Gemini CLI has a generous free tier and uses Bootstrap over Tailwind &lt;a href=&#34;https://bsky.app/profile/simonwillison.net/post/3lsh6mtrw2k2u&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;Cloudflare has a native agents SDK that looks good, especially for CloudFlare users. &lt;a href=&#34;https://blog.cloudflare.com/building-agents-with-openai-and-cloudflares-agents-sdk/&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;There are several &lt;a href=&#34;https://chatgpt.com/share/685e162e-6c78-800c-8d43-1c5d5367eaa7&#34;&gt;brands with recognizable chart style guides&lt;/a&gt;. It&amp;rsquo;s possible to generate style guides for these from the charts, but applying them via matplotlib is almost #impossible today. &lt;a href=&#34;https://chatgpt.com/share/685e1648-c9fc-800c-b35d-2dd6ed61c934&#34;&gt;ChatGPT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sharkdp/hyperfine&#34;&gt;Hyperfine&lt;/a&gt; is like %timeit for the shell. Written in Rust&lt;/li&gt;
&lt;li&gt;⭐ Vertical AI is a moat against AGI. Specialization reduces hallucinations. Custom workflows and regulations are sticky and defensible. We need to start selling to users, not IT, though. &lt;a href=&#34;https://mtrajan.substack.com/p/vertical-ai-just-got-more-urgent&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;When AI automates a task, the bottleneck shifts. AI process re-design is about reworking the process around the new bottleneck, and iterating quickly.
&lt;ul&gt;
&lt;li&gt;With coding, it&amp;rsquo;s testing, reviewing, deploying, use-case identification.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;uvx git-smart-squash&lt;/code&gt; re-organizes haphazard commits using LLMs. &lt;a href=&#34;https://github.com/edverma/git-smart-squash&#34;&gt;git-smart-squash&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;GitHub offers a &lt;a href=&#34;https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry&#34;&gt;free Docker container registry&lt;/a&gt;. &lt;a href=&#34;https://til.simonwillison.net/github/container-registry&#34;&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;There are three major areas where humans either are, or will soon be, more necessary than ever: trust, integration and taste &amp;ndash; &lt;a href=&#34;https://www.nytimes.com/2025/06/17/magazine/ai-new-jobs.html&#34;&gt;NYT&lt;/a&gt;. &lt;a href=&#34;https://mvark.blogspot.com/2025/06/this-week-i-learned-week-25-2025.html&#34;&gt;Anil&lt;/a&gt;. To deal with this:
&lt;ul&gt;
&lt;li&gt;Learn things that might grow in importance, like:
&lt;ul&gt;
&lt;li&gt;Data modeling&lt;/li&gt;
&lt;li&gt;APIs&lt;/li&gt;
&lt;li&gt;Code reviews&lt;/li&gt;
&lt;li&gt;Drawing and 3D modeling&lt;/li&gt;
&lt;li&gt;Narrative storytelling&lt;/li&gt;
&lt;li&gt;Design&lt;/li&gt;
&lt;li&gt;Movie making&lt;/li&gt;
&lt;li&gt;Statistics&lt;/li&gt;
&lt;li&gt;Sceptical fact checking&lt;/li&gt;
&lt;li&gt;Continuous AI auditing e.g. &lt;a href=&#34;https://github.com/githubnext/awesome-continuous-ai&#34;&gt;awesome-continous-ai&lt;/a&gt; or &lt;a href=&#34;https://github.com/anthropic-experimental/automated-auditing&#34;&gt;automated-auditing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Zero knowledge proofs&lt;/li&gt;
&lt;li&gt;Homomorphic encryption&lt;/li&gt;
&lt;li&gt;Privacy-preserving computation&lt;/li&gt;
&lt;li&gt;Fingerprinting and watermarking&lt;/li&gt;
&lt;li&gt;Governance frameworks&lt;/li&gt;
&lt;li&gt;Ethics and AI dilemmas&lt;/li&gt;
&lt;li&gt;Negotiation&lt;/li&gt;
&lt;li&gt;Change management&lt;/li&gt;
&lt;li&gt;Remote working, management, hiring&lt;/li&gt;
&lt;li&gt;Creating attention scarcity&lt;/li&gt;
&lt;li&gt;Local cultures&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Work with people of growing importance
&lt;ul&gt;
&lt;li&gt;People designing products in regulated industries&lt;/li&gt;
&lt;li&gt;Cross domain experts&lt;/li&gt;
&lt;li&gt;Art developers, game makers, designers&lt;/li&gt;
&lt;li&gt;System thinkers. Economists, ecologists, system planners. People who look for second order effects.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Live in cities that might play a bigger role in the future
&lt;ul&gt;
&lt;li&gt;Cities like Singapore and learn how it builds civics trust, creates digital IDs.&lt;/li&gt;
&lt;li&gt;Cities like Bangalore and Hyderabad and learn how they grow tech talent&lt;/li&gt;
&lt;li&gt;Creative cities like Paris, Seoul, Mexico City, Berlin, etc. on sabbaticals to taste hubs&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Try to:
&lt;ul&gt;
&lt;li&gt;Build auditing credentials and IP&lt;/li&gt;
&lt;li&gt;Audit your calendar for what AI can do. Have it interview you&lt;/li&gt;
&lt;li&gt;Practice sceptical fact checking and audit&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;A clever way to test a library&amp;rsquo;s quality is to have LLMs write code from docs and test it. Failing libraries have flawed code/docs. Improve. &lt;a href=&#34;https://lucumr.pocoo.org/2025/6/17/measuring/&#34;&gt;Ref&lt;/a&gt; #ai-coding&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/r-three/common-pile/&#34;&gt;Common Pile&lt;/a&gt; is an 8TB open dataset for LLM training that includes ArXiv, PubMed, StackExchange, GitHub, IRC, Regulations.gov, Patents, UK parliament, books. Easier than scraping.&lt;/li&gt;
&lt;li&gt;A useful way to have reasoning models do deep-research-like work is to have them &amp;ldquo;First, create a plan to solve the problem, clearly listing the objective, approach, and output. Then follow the plan.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://arxiv.org/pdf/2402.09910&#34;&gt;DE-COP&lt;/a&gt; is a method to check if LLMs were trained on private content. GPT-4o was trained on O&amp;rsquo;Reilly books, based on this method. &lt;a href=&#34;https://www.deeplearning.ai/the-batch/issue-303/&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;LLMs are more persuasive than humans. But repeated exposure reduces the effect. &lt;a href=&#34;https://jack-clark.net/2025/05/26/import-ai-414-superpersuasion-openai-models-avoid-shutdown-weather-prediction-and-ai/&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://phoenix.new/&#34;&gt;Phoenix.new&lt;/a&gt; uses live views to publish apps as it codes. The testing framework looks at the screen while it codes and fixes errors. It commits every change&lt;/li&gt;
&lt;li&gt;Anthropic system prompt asking Claude to pursue its goals led to self preservation behavior. &lt;a href=&#34;https://x.com/lefthanddraft/status/1937673283614441685?t=uPejOWJdiL3XR9KSNfJPYQ&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The hungrier I am the better the food tastes. A good reason to eat less quantity and frequency&lt;/li&gt;
&lt;li&gt;You can &lt;a href=&#34;https://www.jsdelivr.com/tools/purge&#34;&gt;purge the jsDelivr cache&lt;/a&gt; manually. Helps if you released a new version of a package and way to purge an alias (e.g. &lt;code&gt;https://cdn.jsdelivr.net/npm/your-package@1&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.xconvert.com/compress-webm&#34;&gt;XConvert&lt;/a&gt; is a convenient online app to compress .webm videos. Not great design but fairly good compression.&lt;/li&gt;
&lt;li&gt;You can draw a treemap of import times via &lt;code&gt;python -X importtime app.py &amp;gt; timing.txt&lt;/code&gt; and then paste them at &lt;a href=&#34;https://kmichel.github.io/python-importtime-graph/&#34;&gt;https://kmichel.github.io/python-importtime-graph/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/eoda-dev/py-openlayers&#34;&gt;PyOpenLayers&lt;/a&gt; adds interactive mapping via OpenLayers to Marimo and Jupyter.&lt;/li&gt;
&lt;li&gt;In a &lt;a href=&#34;https://techcrunch.com/podcast/inside-anthropics-ai-ambitions-with-jared-kaplan/&#34;&gt;TechCrunch interview with Jared Kaplan&lt;/a&gt; has was asked if Anthropic is becoming less safety conscious because they released Opus 4 which blackmails. Kaplan replied that they have stronger testing and higher transparency, so they&amp;rsquo;re &lt;em&gt;more&lt;/em&gt; likely to share AI dangers early. Great positioning! Conversations are about perspective change and this nailed it.&lt;/li&gt;
&lt;li&gt;The &lt;a href=&#34;https://github.com/anthropic-experimental/agentic-misalignment/blob/main/templates/system_prompt_templates.py&#34;&gt;system prompts&lt;/a&gt; for Anthropic misalignment evals are a fascinating read.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/aavetis/ai-pr-watcher&#34;&gt;AI PR Watcher&lt;/a&gt; tracks GitHub pull requests from Codex and other LLMs. Codex is &lt;em&gt;way&lt;/em&gt; ahead of anything else on volume &lt;em&gt;and&lt;/em&gt; success rate. Devin is next on volume, Cursor is next on success rate.&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 06 Oct 2024</title>
      <link>https://www.s-anand.net/blog/things-i-learned-06-oct-2024/</link>
      <pubDate>Sun, 06 Oct 2024 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-06-oct-2024/</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/ffmpegwasm/ffmpeg.wasm&#34;&gt;ffmpeg on WASM&lt;/a&gt; works but is unstable and hard to use.
&lt;ul&gt;
&lt;li&gt;You can&amp;rsquo;t use it in a CDN without CORS issues, since it loads ffmpeg-core via a worker.&lt;/li&gt;
&lt;li&gt;It often runs into buffer allocation issues.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://exotel.com/&#34;&gt;Exotel&lt;/a&gt; and &lt;a href=&#34;https://www.plivo.com/&#34;&gt;Plivo&lt;/a&gt; provide voice &amp;amp; SMS services in India (like Twilio). Plivo is more customer friendly.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://h3geo.org/&#34;&gt;Uber&amp;rsquo;s H3&lt;/a&gt;, &lt;a href=&#34;https://github.com/google/s2geometry&#34;&gt;Google&amp;rsquo;s S2&lt;/a&gt;, and &lt;a href=&#34;https://en.wikipedia.org/wiki/Geohash&#34;&gt;GeoHash&lt;/a&gt; are geocoding systems.
&lt;ul&gt;
&lt;li&gt;H3 offers uniform cell sizes and better distance measurement&lt;/li&gt;
&lt;li&gt;S2 offers higher precision (factoring in Earth&amp;rsquo;s curvature) for exact location matches&lt;/li&gt;
&lt;li&gt;GeoHash is the simplest&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;There&amp;rsquo;s a movement towards embeddable databases on the cloud.
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://motherduck.com/&#34;&gt;MotherDuck&lt;/a&gt; is hosted DuckDB.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://turso.tech/&#34;&gt;Turso&lt;/a&gt; is hosted SQLite (with local sync, multi-tenant)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://starbasedb.com/&#34;&gt;StarBase DB&lt;/a&gt; is SQLite with an API on top of Cloudflare Durable Objects.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://karpathy.medium.com/software-2-0-a64152b37c35&#34;&gt;Software 2.0&lt;/a&gt; by Andrej Karpathy.
&lt;ul&gt;
&lt;li&gt;This is fundamentally altering the programming paradigm by which we iterate on our software, as the teams split in two:
&lt;ul&gt;
&lt;li&gt;the 2.0 programmers (data labelers) edit and grow the datasets, while&lt;/li&gt;
&lt;li&gt;a few 1.0 programmers maintain and iterate on the surrounding training code infrastructure, analytics, visualizations and labeling interfaces.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Adaptive UI ideas:
&lt;ul&gt;
&lt;li&gt;Adaptive Fields: Show only required fields based on what the user field so far.&lt;/li&gt;
&lt;li&gt;Smart Inputs: Dropdowns and auto-complete based on user&amp;rsquo;s context.&lt;/li&gt;
&lt;li&gt;Smart Themes: Change font size, contrast, theme guessing the user&amp;rsquo;s age and preferences.&lt;/li&gt;
&lt;li&gt;Dynamic Menus: Show what they might need to do next. Like Nokia&amp;rsquo;s right button, but using LLMs.&lt;/li&gt;
&lt;li&gt;Smart Tooltips: Check what the user&amp;rsquo;s doing (delays, confusions, previous clicks, current actions) and show relevant tips.&lt;/li&gt;
&lt;li&gt;Personalized Layout: Show only the relevant sections of the app. E.g. based on what they&amp;rsquo;re doing.&lt;/li&gt;
&lt;li&gt;Smart Charts: Create the right chart that solve the user&amp;rsquo;s question.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Adaptive Back-end
&lt;ul&gt;
&lt;li&gt;Dynamic APIs: Create endpoints on the fly based on user needs&lt;/li&gt;
&lt;li&gt;Dynamic Indexing: Create &amp;amp; update indices on the fly based on user needs&lt;/li&gt;
&lt;li&gt;Dynamic Schema: Create &amp;amp; update schema on the fly based on user needs&lt;/li&gt;
&lt;li&gt;Dynamic Migration: Migrate to a new database or OS or language as required&lt;/li&gt;
&lt;li&gt;Dynamic Queries: Create SQL/NoSQL queries to solve the user problem&lt;/li&gt;
&lt;li&gt;Dynamic RBAC: Figure out who needs permissions and why. Add OR REMOVE access as required&lt;/li&gt;
&lt;li&gt;Dynamic Logging. Log what&amp;rsquo;s required. Explain why it&amp;rsquo;s logged and what&amp;rsquo;s happening. Fix code that raised the error&lt;/li&gt;
&lt;li&gt;Dynamic Caching. Cache what&amp;rsquo;s likely to be required. Evict what may not be required. Figure out cache keys.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://aider.chat/docs/leaderboards/&#34;&gt;Aider LLM Leaderboards&lt;/a&gt; show which LLMs code better. As of now,
&lt;ul&gt;
&lt;li&gt;o1-preview &amp;gt; claude-3.5 sonnet on code editing&lt;/li&gt;
&lt;li&gt;claude-3-opus &amp;gt; claude-3.5-sonnet on code refactoring&lt;/li&gt;
&lt;li&gt;deepseek-coder-v&lt;/li&gt;
&lt;li&gt;gpt-4o-mini sucks.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance&#34;&gt;Jaro-Winkler Distance&lt;/a&gt; is a string matching algorithm that weights the start of a string higher.&lt;/li&gt;
&lt;li&gt;Passing the feed of the following to NotebookLLM is a good way to get caught up with news and summaries.
&lt;ul&gt;
&lt;li&gt;A blog / WhatsApp group (e.g. The Generative AI Group, Sithamalli, etc.)&lt;/li&gt;
&lt;li&gt;A Google Group / mailing list (e.g. genainews, datameet)&lt;/li&gt;
&lt;li&gt;YouTube channels (e.g. Vertiasium, GitHub)&lt;/li&gt;
&lt;li&gt;Hacker News top stories&lt;/li&gt;
&lt;li&gt;Research papers&lt;/li&gt;
&lt;li&gt;Emails (skipping marketing emails)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;OpenAI Evals and Distillation has a clever design. They just convert filtered history to .JSONL files that can be an input to either.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.speak.com/&#34;&gt;Speak&lt;/a&gt; is a language learning app based on OpenAI&amp;rsquo;s Realtime API.&lt;/li&gt;
&lt;li&gt;OpenAI&amp;rsquo;s Realtime API can be used in a text-to-text chat mode without needing to send the entire context. If the pricing works out right, this can be far cheaper than sending the entire conversation context. &lt;a href=&#34;https://news.ycombinator.com/item?id=41715725&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Matching addresses with just embeddings works well. Combine it with simple hard rules. &lt;a href=&#34;https://www.dbreunig.com/2024/09/27/conflating-overture-points-of-interests-with-duckdb-ollama-and-more.html&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://cookbook.openai.com/examples/prompt_caching101&#34;&gt;OpenAI&amp;rsquo;s prompt caching works for images too &amp;ndash; both linked and embedded&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Quotes on Graph RAG from a Generative AI WhatsApp Group.
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;Damn so literally nobody uses Graph RAG yet. Good to know.&amp;rdquo; ~Sumba&lt;/li&gt;
&lt;li&gt;&amp;ldquo;A big four consulting firm uses GraphRAG to retrieve related documents and excerpts from governance and compliance docs.&amp;rdquo; ~Vinayak Hegde (Microsoft)&lt;/li&gt;
&lt;li&gt;&amp;ldquo;Graph RAG is expensive and unnecessary in most of the cases.&amp;rdquo; ~Utkarsh Saxena&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;ChatGPT&amp;rsquo;s advanced mode includes: &amp;ldquo;&amp;hellip;you can use various regional accents and dialects.&amp;rdquo; &lt;a href=&#34;https://www.reddit.com/r/OpenAI/comments/1fp1fes/the_system_prompt_of_advanced_voice_mode_it_can/&#34;&gt;Ref&lt;/a&gt; &lt;a href=&#34;https://x.com/deedydas/status/1839860410914353225&#34;&gt;Source&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;But the API can &amp;ldquo;laugh, whisper, and adhere to tone direction.&amp;rdquo; &lt;a href=&#34;https://platform.openai.com/docs/guides/realtime&#34;&gt;Ref&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Hume API (INR 6/min) is far cheaper than OpenAI&amp;rsquo;s real-time chat (6c/min input + 24c/min output)&lt;/li&gt;
&lt;li&gt;Devika is an open-source clone of Devin.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://duckdb.org/2024/10/02/pyodide.html&#34;&gt;DuckDB runs inside Pyodide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://slatestarcodex.com/2017/05/26/the-atomic-bomb-considered-as-hungarian-high-school-science-fair-project/&#34;&gt;Hungarian Jews have genetic diseases that increase their IQ&lt;/a&gt;. Gaucher’s disease, Torsion dystonia.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.thepsmiths.com/p/review-math-from-three-to-seven-by&#34;&gt;People don&amp;rsquo;t like hard stuff like maths or science, so richer societies have fewer scientists&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ethan Mollick feels Claude 3.5 Sonnet is better at style and critiquing blog posts than OpenAI&amp;rsquo;s o1 (which is better at reasoning.)&lt;/li&gt;
&lt;li&gt;News is going to be crazily disrupted again with voice mode. I can just listen to the topic I want&lt;/li&gt;
&lt;li&gt;In Singapore Airlines,
&lt;ul&gt;
&lt;li&gt;You can&amp;rsquo;t wear your seatbelt loose&lt;/li&gt;
&lt;li&gt;You have to keep the laptop in the pocket in front, not on your lap, during takeoff&lt;/li&gt;
&lt;li&gt;You can&amp;rsquo;t charge during takeoff&lt;/li&gt;
&lt;li&gt;They verify if you ask for a veg meal and place a sticker on your seat&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Coders are more likely to edit LLM code. Non-coders don&amp;rsquo;t have that bad habit.
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://youtu.be/uuf3-_xYp7k&#34;&gt;Vaishnavi&lt;/a&gt; and &lt;a href=&#34;https://youtu.be/5FZadpAGXb0&#34;&gt;Ranjeet&lt;/a&gt; edited code&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://youtu.be/EGbeA-x79tY&#34;&gt;Indal&lt;/a&gt; and &lt;a href=&#34;https://youtu.be/2Je37vJhcD4&#34;&gt;Koustav&lt;/a&gt; didn&amp;rsquo;t&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Coders are likely to get more out of an LLM because they know what it can do. But some non-coders will get more out of an LLM because they don&amp;rsquo;t know what it can&amp;rsquo;t do.
&lt;ul&gt;
&lt;li&gt;E.g. &lt;a href=&#34;https://youtu.be/EGbeA-x79tY&#34;&gt;Indal&lt;/a&gt; trying for a confetti animation, which is hard but do-able&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&amp;ldquo;You have to put in a lot of work to become productive at AI coding.&amp;rdquo; Simon Willison&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    <item>
      <title>Things I Learned - 29 Sep 2024</title>
      <link>https://www.s-anand.net/blog/things-i-learned-29-sep-2024/</link>
      <pubDate>Sun, 29 Sep 2024 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/things-i-learned-29-sep-2024/</guid>
      <description>&lt;p&gt;This week, I learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pyodide can access the DOM and JavaScript in the browser&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://jupyter.org/try-jupyter/lab/&#34;&gt;Jupyter Lite&lt;/a&gt; lets you run Jupyter notebooks in the browser&lt;/li&gt;
&lt;li&gt;AVIFs is about 10X better than GIFs. I tried creating one via &lt;a href=&#34;https://ezgif.com/avif-maker/&#34;&gt;EZGIF AVIF Maker&lt;/a&gt; and the .avifs file created was 15X smaller!
&lt;code&gt;ffmpeg -i input.gif -c:v libaom-av1 -crf 30 -b:v 0 -cpu-used 4 -tiles -an output.avif&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Claude 3.5 thinks &lt;code&gt;.opus&lt;/code&gt; is the best format to compress audio. It used &lt;code&gt;ffmpeg -i audio.wav -c:a libopus -b:a 16k -application voip -vbr on -compression_level 10 audio.opus&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;API coding best practices &lt;a href=&#34;https://erikbern.com/2024/09/27/its-hard-to-write-code-for-humans.html&#34;&gt;Source&lt;/a&gt; via &lt;a href=&#34;https://simonwillison.net/2024/Sep/27/erik-bernhardsson/&#34;&gt;Simon Willison&lt;/a&gt;:
&lt;ul&gt;
&lt;li&gt;Always add screenshots to the Readme. They never break.&lt;/li&gt;
&lt;li&gt;Always add every example. Human think in examples.&lt;/li&gt;
&lt;li&gt;Avoid defaults and be explicit unless 99% of the usage is with the default.&lt;/li&gt;
&lt;li&gt;Make the feedback loops incredibly fast.&lt;/li&gt;
&lt;li&gt;Make deprecations easy for users to deal with.&lt;/li&gt;
&lt;li&gt;Keep objects immutable.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://pymupdf.readthedocs.io/en/latest/pymupdf4llm/&#34;&gt;PyMuPDF4LLM&lt;/a&gt; can convert PDFs to Markdown. It handles tables, too.
&lt;ul&gt;
&lt;li&gt;04 Oct 2024. &lt;a href=&#34;https://github.com/opendatalab/PDF-Extract-Kit&#34;&gt;PDF-Extract-Kit&lt;/a&gt; does PDF layout, formula, table, and OCR extraction using various models.&lt;/li&gt;
&lt;li&gt;04 Oct 2024. &lt;a href=&#34;https://github.com/nlmatics/llmsherpa&#34;&gt;llmsherpa&lt;/a&gt; extracts PDF layout, tables, not OCR&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;When evaluating feasibility of technology with LLMs always ask for multiple options and pick from those. &lt;a href=&#34;https://youtu.be/6U_Zk_PZ6Kg?t=4444&#34;&gt;Simon Willison&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://ai.google.dev/gemini-api/docs/audio?lang=rest&#34;&gt;Gemini supports audio natively&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Google Vertex AI has an &lt;a href=&#34;https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/call-vertex-using-openai-library&#34;&gt;OpenAI compatible API&lt;/a&gt; but it works only for some models. Anthropic and Gemini are not compatible.&lt;/li&gt;
&lt;li&gt;When you paste HTML into Excel, it automatically changes the font of the cell to match the content in the HTML!&lt;/li&gt;
&lt;li&gt;Aptos is the new default font in Office - replacing Calibri.&lt;/li&gt;
&lt;li&gt;Anthropic&amp;rsquo;s &lt;a href=&#34;https://www.anthropic.com/news/contextual-retrieval&#34;&gt;Introducing Contextual Retrieval&lt;/a&gt; says:
&lt;ul&gt;
&lt;li&gt;Use BM25 in addition to embeddings to match rare terms (e.g. identifiers)&lt;/li&gt;
&lt;li&gt;Add a context to each chunk&amp;rsquo;s metadata (generate it with a cheap LLM) and pass it to the summarizing LLM&lt;/li&gt;
&lt;li&gt;Reranking helps with cost AND accuracy. Use &lt;a href=&#34;https://cohere.com/rerank&#34;&gt;Cohere&lt;/a&gt; or &lt;a href=&#34;https://docs.voyageai.com/docs/reranker&#34;&gt;Voyage&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sentient-engineering/sentient&#34;&gt;Sentient&lt;/a&gt; lets you control the browser via Python in natural language&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
  </channel>
</rss>
