<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 장지호</title>
    <description>The latest articles on DEV Community by 장지호 (@jalnanco).</description>
    <link>https://dev.to/jalnanco</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4018742%2F26cfa17c-0590-40c6-a900-525fd8f55ad1.jpg</url>
      <title>DEV Community: 장지호</title>
      <link>https://dev.to/jalnanco</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jalnanco"/>
    <language>en</language>
    <item>
      <title>Where did my Claude Code usage go? Finding prompt-cache rebuilds in your own transcripts</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Sun, 29 Nov 2026 19:20:03 +0000</pubDate>
      <link>https://dev.to/jalnanco/where-did-my-claude-code-usage-go-finding-prompt-cache-rebuilds-in-your-own-transcripts-2p6i</link>
      <guid>https://dev.to/jalnanco/where-did-my-claude-code-usage-go-finding-prompt-cache-rebuilds-in-your-own-transcripts-2p6i</guid>
      <description>&lt;p&gt;The scripts are in &lt;a href="https://github.com/jalnanco/claude-cache-audit" rel="noopener noreferrer"&gt;https://github.com/jalnanco/claude-cache-audit&lt;/a&gt; (&lt;code&gt;cache_audit.py&lt;/code&gt;, &lt;code&gt;make_fake_logs.py&lt;/code&gt;, &lt;code&gt;test_cache_audit.py&lt;/code&gt;, &lt;code&gt;check.sh&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;A question that keeps coming up in r/ClaudeCode: "I barely did anything and burned X% of my weekly limit." Often the work itself was small and the prompt cache got rebuilt. A rebuild bills the whole conversation again at write price instead of read price.&lt;/p&gt;

&lt;p&gt;This exercise uses fake transcripts, so anyone can run it and get the same numbers. Then you point the same script at your own &lt;code&gt;~/.claude/projects/&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;Needs Python 3.9+ and nothing else.&lt;/p&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;usage&lt;/code&gt; block
&lt;/h2&gt;

&lt;p&gt;Every API response that Claude Code logs carries a &lt;code&gt;usage&lt;/code&gt; block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"usage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"cache_read_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;21500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"cache_creation_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"cache_creation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"ephemeral_5m_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"ephemeral_1h_input_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"output_tokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a healthy turn, most of the prompt is &lt;code&gt;cache_read&lt;/code&gt; and only the new part is &lt;code&gt;cache_creation&lt;/code&gt;. On a rebuilt turn it flips: almost everything is &lt;code&gt;cache_creation&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Relative prices (Anthropic prompt-caching docs, per base input token):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;what&lt;/th&gt;
&lt;th&gt;multiplier&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;plain input&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cache write, 5-minute TTL&lt;/td&gt;
&lt;td&gt;1.25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cache write, 1-hour TTL&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cache read&lt;/td&gt;
&lt;td&gt;0.1 (0.05 on Opus 5.5 and Sonnet 5.5)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So a 20,000-token prefix costs 2,000 units when it is read from cache (at 0.1) and 25,000 units when it is rewritten. That is 12.5 times more for the same turn.&lt;/p&gt;

&lt;p&gt;The cache lives for 5 minutes by default (or 1 hour), and each hit resets the timer. A change to tools, the system prompt or an earlier message breaks the cache from that point on.&lt;/p&gt;

&lt;p&gt;Compaction breaks it too, on purpose. When &lt;code&gt;/compact&lt;/code&gt; runs, or auto-compact kicks in near the context limit, Claude Code swaps the history for a summary, and the next call has to write that new prefix. The transcript marks the spot with a line like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"subtype"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"compact_boundary"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"sessionId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
 &lt;span class="nl"&gt;"compactMetadata"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"trigger"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"preTokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;267114&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"postTokens"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;33830&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A rebuild right after one of these lines is the normal cost of compacting, and the cache behaved as designed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: make the fake logs
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 make_fake_logs.py fake_logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wrote sess-a.jsonl (9 assistant lines)
wrote sess-a/subagents/agent-sub1.jsonl (2 assistant lines)
wrote sess-a/subagents/agent-sub2.jsonl (1 assistant lines)
wrote sess-b.jsonl (3 assistant lines)
wrote sess-c.jsonl (5 assistant lines)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These files contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;session A on a 5-minute cache: a 7.5-minute pause, two subagents, and one turn where the prefix changed with no pause&lt;/li&gt;
&lt;li&gt;session B on a 1-hour cache: one 20-minute pause, which is fine, and one 65-minute pause, which is not&lt;/li&gt;
&lt;li&gt;session C on a 1-hour cache: a long conversation that auto-compacts, then a 70-minute pause that ends with a manual &lt;code&gt;/compact&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;one response written twice. Real transcripts do this: one response becomes several lines, one per content block, and each line repeats the same &lt;code&gt;usage&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: run the audit
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 cache_audit.py fake_logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;20 assistant lines -&amp;gt; 19 API calls (duplicates dropped) in 5 chains (session x agent)
session  agent    msg     written  reason
sess-a   main     a1       20,000   first turn
sess-a   main     a4       23,000 ! pause &amp;gt; TTL (7.5 min, ttl 5m)  (+26,450 units)
sess-a   main     a7       20,500 ! prefix changed (1.0 min after last call)  (+23,575 units)
sess-a   sub1     s1a      15,000   subagent start
sess-a   sub2     s2a      15,000   subagent start
sess-b   main     b1       30,000   first turn
sess-b   main     b3       30,600 ! pause &amp;gt; TTL (65.0 min, ttl 1h)  (+58,140 units)
sess-c   main     c1      150,000   first turn
sess-c   main     c3       30,000   after compaction (auto, 1.2 min after last call)
sess-c   main     c5       12,000   after compaction (manual, 71.0 min after last call)
total cost: 669,292 units  |  avoidable rebuilds (!): 108,165 units = 16%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How to read it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;!&lt;/code&gt; marks a rebuild you could have avoided. First turns, subagent starts and turns right after a compaction always write a new prefix, so they get no &lt;code&gt;!&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;+N units&lt;/code&gt; is a rough extra cost: the tokens that were written when they could have been read, times (write multiplier − read multiplier).&lt;/li&gt;
&lt;li&gt;In this fake data, three avoidable rebuilds are 16% of the total.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;c5&lt;/code&gt; came 71 minutes after the last call, so the 1-hour cache had expired anyway. The script still files it under &lt;code&gt;after compaction&lt;/code&gt;: the prefix was new, so it would have been written even with no pause.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check it by hand once. Turn &lt;code&gt;a4&lt;/code&gt; wrote 23,000 tokens at 1.25 that could have been read at 0.1: 23,000 × 1.15 = 26,450.&lt;/p&gt;

&lt;p&gt;To see what the old count looked like, add &lt;code&gt;--no-compact&lt;/code&gt;. It ignores the boundary lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sess-c   main     c3       30,000 ! prefix changed (1.2 min after last call)  (+57,000 units)
sess-c   main     c5       12,000 ! pause &amp;gt; TTL (71.0 min, ttl 1h)  (+22,800 units)
total cost: 669,292 units  |  avoidable rebuilds (!): 187,965 units = 28%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same logs, and the avoidable share goes from 16% to 28%, only because two expected rewrites got blamed on the cache.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: what each reason means and what to do
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;reason&lt;/th&gt;
&lt;th&gt;what happened&lt;/th&gt;
&lt;th&gt;what helps&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pause &amp;gt; TTL&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;you stepped away longer than the cache lifetime&lt;/td&gt;
&lt;td&gt;the next turn rewrites the whole context, so its cost grows with context size. Coming back to a short context (after &lt;code&gt;/compact&lt;/code&gt;, or a new session started from a notes file) makes that rewrite smaller&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;prefix changed&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;something early in the prompt changed: CLAUDE.md, a tool list (an MCP server connecting mid-session), the model&lt;/td&gt;
&lt;td&gt;don't edit CLAUDE.md or toggle MCP servers in the middle of a long session&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;subagent start&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;each subagent writes its own prompt once&lt;/td&gt;
&lt;td&gt;fine for real work; costly when you fan out many tiny subagents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;after compaction&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;/compact&lt;/code&gt; or auto-compact replaced the history with a summary&lt;/td&gt;
&lt;td&gt;nothing to fix on that turn. If it happens a lot, the lever is the session itself: shorter sessions compact less often&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Step 4: run it on your own logs
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 cache_audit.py ~/.claude/projects/&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;your-project-folder&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --read-mult 0.05   &lt;span class="c"&gt;# Opus 5.5 / Sonnet 5.5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It only reads numbers, ids and timestamps. It never prints message text.&lt;/p&gt;

&lt;h3&gt;
  
  
  What it found on mine
&lt;/h3&gt;

&lt;p&gt;I ran a wrapper around the same &lt;code&gt;audit()&lt;/code&gt; over 7 days of my own transcripts on two personal accounts: 30,647 API calls, almost all Opus 5.5, read multiplier 0.05.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;avoidable share of total cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;without the compaction check (&lt;code&gt;--no-compact&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;9.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;with it&lt;/td&gt;
&lt;td&gt;3.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;210 auto-compactions happened in that week. 194 of them were followed by a rebuild, and without the check 186 of those were counted as &lt;code&gt;prefix changed&lt;/code&gt; and 8 as &lt;code&gt;pause &amp;gt; TTL&lt;/code&gt;. What is left after the check is mostly &lt;code&gt;pause &amp;gt; TTL&lt;/code&gt; (3.2%). Real &lt;code&gt;prefix changed&lt;/code&gt; (a CLAUDE.md edit, an MCP server connecting) was 15 turns, 0.3%. With read at 0.1 the two numbers are 6.0% and 2.3%.&lt;/p&gt;

&lt;p&gt;On my logs, then, about 60% of what the first version called avoidable (5.8 of the 9.4 points) was compaction. Most of what remains is coming back to a long session after more than an hour.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exercises
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;In &lt;code&gt;make_fake_logs.py&lt;/code&gt;, change the time of turn &lt;code&gt;a4&lt;/code&gt; from &lt;code&gt;m(9, 30)&lt;/code&gt; to &lt;code&gt;m(6)&lt;/code&gt;. Is &lt;code&gt;a4&lt;/code&gt; still flagged, and with what reason?
answerStill flagged, but now as &lt;code&gt;prefix changed (4.0 min after last call)&lt;/code&gt;. The gap is under 5 minutes, yet the log says the cache was rewritten, so the script blames the prefix. Timing can only rule causes out. It can't prove one.&lt;/li&gt;
&lt;li&gt;Turn off the duplicate check: in &lt;code&gt;cache_audit.py&lt;/code&gt; change &lt;code&gt;if key in seen:&lt;/code&gt; to &lt;code&gt;if False:&lt;/code&gt; and run again. How much does the total go up?
answer669,292 → 673,170 units. That is exactly one extra copy of &lt;code&gt;a2&lt;/code&gt;: 3 + 1,500 × 1.25 + 20,000 × 0.1 = 3,878. On a real session we tried, 152 assistant lines were only 77 API calls, so summing every line nearly doubles the count.&lt;/li&gt;
&lt;li&gt;Switch session B to the 5-minute cache (&lt;code&gt;ttl="1h"&lt;/code&gt; → &lt;code&gt;ttl="5m"&lt;/code&gt;). Turn &lt;code&gt;b2&lt;/code&gt; comes 20 minutes after &lt;code&gt;b1&lt;/code&gt;. Why isn't it flagged?
answerThe script judges from what the log says was written, not from the TTL. The fake numbers for &lt;code&gt;b2&lt;/code&gt; still say "read 30,000", which is a hit. In a real 5-minute session, a 20-minute pause would show up as a big write. Only &lt;code&gt;b3&lt;/code&gt;'s extra cost changes, from 58,140 to 35,190, because a 5-minute write costs 1.25 instead of 2.&lt;/li&gt;
&lt;li&gt;Run with &lt;code&gt;--min 1000&lt;/code&gt;. Do the small writes (&lt;code&gt;a2&lt;/code&gt; 1,500, &lt;code&gt;s1b&lt;/code&gt; 2,000) start showing up?
answerNo. A turn also needs to write more than it reads, and both of those read far more (20,000 and 15,000). Small writes on top of a big read are just the new part of the conversation being cached.&lt;/li&gt;
&lt;li&gt;In session C, move the manual compaction from &lt;code&gt;m(75)&lt;/code&gt; to &lt;code&gt;m(77)&lt;/code&gt;, after &lt;code&gt;c5&lt;/code&gt;. What does &lt;code&gt;c5&lt;/code&gt; turn into?
answer&lt;code&gt;pause &amp;gt; TTL (71.0 min, ttl 1h)&lt;/code&gt; with &lt;code&gt;!&lt;/code&gt; and +22,800 units. The boundary now comes after the call, so it can't explain the rewrite, and a 71-minute gap is over the 1-hour TTL.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Known limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The reason is a best guess from timing and boundary lines. &lt;code&gt;prefix changed&lt;/code&gt; cannot tell you &lt;em&gt;what&lt;/em&gt; changed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;after compaction&lt;/code&gt; still costs money; the script just doesn't count it as avoidable on that turn. On my logs it was about half of all rebuild cost. Shorter sessions compact less often, which is the only way I know to shrink it.&lt;/li&gt;
&lt;li&gt;Output tokens are left out on purpose. They don't depend on caching.&lt;/li&gt;
&lt;li&gt;This counts API-price units, not your subscription percentage. Anthropic does not publish how plan limits map to tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run &lt;code&gt;sh check.sh&lt;/code&gt; to run the unit tests (&lt;code&gt;test_cache_audit.py&lt;/code&gt;), rebuild everything in a fresh temp folder and compare against &lt;code&gt;expected_output.txt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI help; numbers come from running the scripts in this folder.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>python</category>
      <category>abotwrote</category>
    </item>
    <item>
      <title>I gave my Slay the Spire 2 runs an AI coach and kept the mouse for myself</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Sun, 29 Nov 2026 14:11:10 +0000</pubDate>
      <link>https://dev.to/jalnanco/i-gave-my-slay-the-spire-2-runs-an-ai-coach-and-kept-the-mouse-for-myself-275f</link>
      <guid>https://dev.to/jalnanco/i-gave-my-slay-the-spire-2-runs-an-ai-coach-and-kept-the-mouse-for-myself-275f</guid>
      <description>&lt;p&gt;I have 276 hours in the first Slay the Spire. When the sequel opened in Early Access in March 2026, I was a beginner again, with new cards, new relics and frequent balance patches. My old habit of grabbing whatever attack card looked strongest on the reward screen came right back.&lt;/p&gt;

&lt;p&gt;So I wired up a coach. A mod reads the run, a short shell script hands it to an AI agent in my terminal, and the agent tells me what it would pick and why. It never touches the game. I make every click.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline is two pieces
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. STS2MCP exposes the game state
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/Gennadiyev/STS2MCP" rel="noopener noreferrer"&gt;STS2MCP&lt;/a&gt; is a community mod that starts an HTTP server on &lt;code&gt;localhost:15526&lt;/code&gt; when the game launches. It serves the current run as JSON or Markdown: hand, deck, relics, potions, enemy intents, map, card rewards, shop. It also exposes actions and ships an optional MCP server for Claude Desktop and Claude Code. The README says it was tested against STS2 &lt;code&gt;v0.103.2&lt;/code&gt;, so expect it to break after big patches.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. A tiny wrapper so the agent can read it
&lt;/h3&gt;

&lt;p&gt;This is the whole thing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; -euo pipefail

&lt;span class="nv"&gt;format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"${1:-markdown}"&lt;/span&gt;
&lt;span class="nv"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"${STS2MCP_BASE_URL:-http://localhost:15526}"&lt;/span&gt;

&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s2"&gt;"$format"&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;
  markdown&lt;span class="o"&gt;|&lt;/span&gt;json&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  *&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"usage: sts2-state [markdown|json]"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;2&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 2 &lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;esac&lt;/span&gt;

curl -fsS &lt;span class="s2"&gt;"${base_url}/api/v1/singleplayer?format=${format}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I put it on my &lt;code&gt;PATH&lt;/code&gt; as &lt;code&gt;sts2-state&lt;/code&gt;. Any terminal agent that can run shell commands can now call &lt;code&gt;sts2-state markdown&lt;/code&gt; and get the screen I'm looking at as text. For reading, a GET request is enough, so you can skip the MCP server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing the mod (macOS notes)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Download &lt;code&gt;STS2_MCP.dll&lt;/code&gt; and &lt;code&gt;STS2_MCP.json&lt;/code&gt; from the project's GitHub releases. The same DLL works on Windows, Linux and macOS.&lt;/li&gt;
&lt;li&gt;Copy both into the game's &lt;code&gt;mods&lt;/code&gt; folder. On macOS that folder lives inside the app bundle, and you may need to create it:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   ~/Library/Application Support/Steam/steamapps/common/Slay the Spire 2/SlayTheSpire2.app/Contents/MacOS/mods/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Launch the game and turn mods on in settings. A consent dialog appears the first time.&lt;/li&gt;
&lt;li&gt;Check &lt;code&gt;curl -s http://localhost:15526/&lt;/code&gt;. "Connection refused" means the mod didn't load.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You are dropping a binary into your game folder, so take the DLL from the official releases only.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a coaching moment looks like
&lt;/h2&gt;

&lt;p&gt;The most useful answer came after the Act 1 boss. Three card choices on the reward screen. I typed "next" to the agent. It ran &lt;code&gt;sts2-state markdown&lt;/code&gt;, read the &lt;code&gt;card_reward&lt;/code&gt; state, and answered in the format I'd asked for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pick: Demon Form.&lt;/li&gt;
&lt;li&gt;Why: +2 Strength every turn wins long boss and elite fights. I already had spare energy, so a 3-cost power was affordable, and the deck was attack-heavy, so Strength scales everything already in it.&lt;/li&gt;
&lt;li&gt;Alternatives: a card that turns every attack into a flat 16-damage hit, which spikes hard but throws away the side effects of my existing attacks, and a card that exhausts attacks, which is fun but makes the deck less stable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The 16-damage card is exactly the kind I grab. 276 hours in the first game haven't cured me of chasing the attack in front of me. What helped was that the answer named what my deck was already trying to be: an attack deck with energy to spare that needed scaling. Once it was written down, the choice was easy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwkfil96gx7lmml2dwvgj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwkfil96gx7lmml2dwvgj.png" alt="Terminal: the agent runs sts2-state markdown, reads the card_reward state and recommends Demon Form" width="800" height="647"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The real exchange. It's in Korean because my agent talks to me in Korean; the state it reads is plain Markdown.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this game works so well with an LLM
&lt;/h2&gt;

&lt;p&gt;Slay the Spire shows you almost everything. Enemy intents are on screen. Damage, block, energy, Strength, map paths and shop prices are all numbers. Nothing important lives in pixels, so the model never has to look at a screenshot. It gets a structured page of facts and does arithmetic on it. In a game that hinges on timing, positioning or hidden information, a text model would be guessing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The prompt that keeps it useful
&lt;/h2&gt;

&lt;p&gt;"Help me with this run" gets you a generic tier list. Tighter rules got me better answers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a Slay the Spire 2 coach.
Goal: raise the win rate of this run.

Rules:
- Never operate the game.
- Do not assume cards, relics or potions that are not in the current state.
- Check damage, block and energy math step by step.
- If unsure, say "unsure".
- Give one recommendation first, alternatives after.
- Consider deck direction and the risk of the next boss/elite together.

Output:
1. Pick
2. Why
3. Alternatives
4. Risk
5. Confidence
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "don't assume" rule is there because a model will otherwise plan around a relic you don't own.&lt;/p&gt;

&lt;h2&gt;
  
  
  When I call it
&lt;/h2&gt;

&lt;p&gt;Asking every turn is slow, burns tokens, and stops the run from feeling like mine. I play the turns myself and call the coach at forks that change the whole run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;boss and elite card rewards&lt;/li&gt;
&lt;li&gt;shops (remove a card or buy the relic?)&lt;/li&gt;
&lt;li&gt;an unfamiliar card I can't place&lt;/li&gt;
&lt;li&gt;the path choice before an elite&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why it doesn't click for me
&lt;/h2&gt;

&lt;p&gt;STS2MCP can play the game; the README says it exists to let AI agents play. Older Slay the Spire 1 projects did the same: &lt;a href="https://steamcommunity.com/workshop/filedetails/?id=2131373661" rel="noopener noreferrer"&gt;Communication Mod&lt;/a&gt;, &lt;a href="https://github.com/ForgottenArbiter/spirecomm" rel="noopener noreferrer"&gt;spirecomm&lt;/a&gt;, &lt;a href="https://github.com/rhennigan/SlayTheSpireLLMController" rel="noopener noreferrer"&gt;SlayTheSpireLLMController&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I kept mine read-only on purpose. Card removal and shop purchases are where one mistake ruins a run, and if the agent makes those calls, I'm just watching. So the agent reads and explains, and I click once I agree with its reason. That also keeps things fair: a single-player run, a coach that talks, and a human on the mouse. I wouldn't use this in co-op or anywhere with a leaderboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install STS2MCP and confirm &lt;code&gt;localhost:15526&lt;/code&gt; answers.&lt;/li&gt;
&lt;li&gt;Save the wrapper as &lt;code&gt;sts2-state&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Give your terminal agent the prompt above and say "next" at the next boss reward.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Mod APIs change with game patches, so check the &lt;a href="https://github.com/Gennadiyev/STS2MCP" rel="noopener noreferrer"&gt;STS2MCP repo&lt;/a&gt; before you start.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>gamedev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Why acing the coding test doesn't stop you from floundering on the job</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Wed, 29 Jul 2026 13:05:32 +0000</pubDate>
      <link>https://dev.to/jalnanco/why-acing-the-coding-test-doesnt-stop-you-from-floundering-on-the-job-4obh</link>
      <guid>https://dev.to/jalnanco/why-acing-the-coding-test-doesnt-stop-you-from-floundering-on-the-job-4obh</guid>
      <description>&lt;p&gt;The most common thing a perfect-score candidate hears in their first month is "why did you write it this way?"&lt;/p&gt;

&lt;p&gt;Algorithm problems hand you fixed inputs, fixed outputs, and one right answer. Real work hands you requirements that shift under you and several answers that are all defensible. That gap is why the people who clear the interview and the people who do the job well are not always the same set. Hiring managers know this. They keep running coding tests anyway, because nothing cheaper has replaced them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The test measures baseline problem-solving, not job ability
&lt;/h2&gt;

&lt;p&gt;A coding test checks whether you can take a frozen spec and turn it into correct logic inside a time limit. You have to reason about time complexity, pick a data structure that fits, and catch the edge case that breaks the naive version. Those are real skills, and a developer without them struggles.&lt;/p&gt;

&lt;p&gt;The problem is that most of what makes production work hard isn't in there.&lt;/p&gt;

&lt;p&gt;The difficulty in production code comes from uncertainty. Figuring out what a line in the spec actually means. Predicting what breaks when you touch legacy code that has been running for four years. Tracing why another team's API behaves differently from its documentation. Nobody writes out the inputs and outputs for you. You have to work out which question to ask before you can answer anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Algorithm problems have a correct answer. Production doesn't.
&lt;/h2&gt;

&lt;p&gt;A coding test asks "find the longest subsequence in this array that satisfies the condition." One answer, and a grader that knows it.&lt;/p&gt;

&lt;p&gt;Production asks "how do I design this so that when the requirements change in three months, I'm not rewriting it from scratch?" There's no answer, only tradeoffs. Make it extensible and you pay in complexity today. Keep it simple and you accept that you may throw it away later.&lt;/p&gt;

&lt;p&gt;You can see the same split in code review. An algorithm problem ends at pass or fail. Production code gets judged on whether a teammate can read it in six months, whether it matches team conventions, whether it has tests. Writing alone for a grader and writing for people who will keep editing your code are different jobs.&lt;/p&gt;

&lt;p&gt;Take variable names. In a contest, calling things &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt;, and &lt;code&gt;tmp&lt;/code&gt; costs you nothing. In production, a meaningless name is a direct bill charged to the next person's debugging time. When you finish a function at work, the question isn't only "is this correct" but "can someone else change this safely." No autograder scores that second one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Companies keep using them because filtering is expensive
&lt;/h2&gt;

&lt;p&gt;Verifying each applicant's actual ability takes real time. Reading a portfolio takes time. Digging through their past project code takes more. Add a few rounds of interviews and the cost climbs fast.&lt;/p&gt;

&lt;p&gt;A coding test is a standardized way to cut a large pile of applicants down quickly. It's not precise, but for screening "does this person have basic logic and can they write code," it's efficient.&lt;/p&gt;

&lt;p&gt;There's also fairness, which is harder to dismiss than it sounds. An open-ended interview leaves a lot of room for the interviewer's gut feeling. A fixed problem with automated scoring gives both sides less to argue about. Coding tests survive less because they predict job performance and more because they filter a lot of people cheaply without looking arbitrary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparing for both means splitting them by season, not by day
&lt;/h2&gt;

&lt;p&gt;If you're job hunting, there's no reason to skip coding test prep. Fail the first gate and you never get to show anything else.&lt;/p&gt;

&lt;p&gt;Pouring every hour into it and arriving with nothing else is a separate problem.&lt;/p&gt;

&lt;p&gt;The balance that actually works: do algorithm practice in concentrated blocks around the interview season. The rest of the time, finish small projects end to end. Ship something. Take a bug report and fix it. Leave a review on someone else's code. That does more for your first six months on the job than another hundred practice problems.&lt;/p&gt;

&lt;p&gt;The coding test is the key to the door. What you need in the next room, you prepare separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  Leaning on it too hard backfires on the hiring side too
&lt;/h2&gt;

&lt;p&gt;If a company keeps cranking up test difficulty to filter harder, it starts rejecting people who would have been strong on the team but don't test well. The reverse happens too: someone trained specifically on contest problems clears the bar and then takes a long time to become useful. Both outcomes cost the company and the candidate.&lt;/p&gt;

&lt;p&gt;That's not an argument for dropping coding tests. The usual alternatives have their own holes. Portfolios can be faked or ghostwritten. Take-home assignments get criticized for demanding unpaid hours from people who are already working full time. The workable position is to treat the coding test as one filter among several, and to stop reading its result as a full measure of what someone can do.&lt;/p&gt;

&lt;p&gt;More companies now ask candidates to walk through past work instead of doing live coding, or pair the test with a collaboration simulation. That shift comes from the same recognition: trying to catch everything with one instrument wastes time on both sides of the table.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A rocket startup gave up on passenger jets, went after weapons, and raised $90M</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Sun, 26 Jul 2026 16:33:14 +0000</pubDate>
      <link>https://dev.to/jalnanco/a-rocket-startup-gave-up-on-passenger-jets-went-after-weapons-and-raised-90m-2fcb</link>
      <guid>https://dev.to/jalnanco/a-rocket-startup-gave-up-on-passenger-jets-went-after-weapons-and-raised-90m-2fcb</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fokf26blguz5fjs458oek.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fokf26blguz5fjs458oek.png" alt="Illustration of a rotating detonation rocket engine" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In May 2025 a rocket lifted off from the Texas desert and burned for 32 seconds. That was the whole flight. It was also the first time anyone had flown a rotating detonation rocket engine on an actual vehicle. Venus Aerospace, the startup behind it, has now closed a $90 million Series B.&lt;/p&gt;

&lt;p&gt;Venus was founded in 2020 by Sassie and Andrew Duggleby, who serve as CEO and CTO. The original pitch was a clean hypersonic airliner — something that could cross Mach 5 without the emissions profile of older supersonic designs, putting New York to London inside an hour. The engineering was only half the problem. An airliner like that needs regulators and a market that do not exist yet.&lt;/p&gt;

&lt;p&gt;The pivot came right after that test flight. "The moment we flew it, the world came back and said, you have a working RDRE, can you sell it to us," Duggleby said. The buyer that showed up first was not an airline. It was defense — hypersonic weapons and missile propulsion, where a proven engine has immediate value. Venus followed the demand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the engine is different
&lt;/h2&gt;

&lt;p&gt;A conventional rocket engine burns propellant inside a chamber at roughly constant pressure. An RDRE burns it with a detonation wave that travels continuously around an annular channel at supersonic speed. You get more thrust from the same propellant, and the engine itself has fewer moving parts, which helps with both reuse and manufacturing cost.&lt;/p&gt;

&lt;p&gt;None of this is a new idea. RDREs have been studied since the 1960s and stayed stuck at the bench-test stage for decades. Flying one is what changed the conversation, and it is what the Series B is really pricing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who put money in
&lt;/h2&gt;

&lt;p&gt;Mercury Fund led the round. Lockheed Martin Ventures, MESH, PEAK6, Draper Associates, Starboard Star Venture Capital, and Green Sands Equity all participated. Lockheed showing up on the cap table is the part worth noting — a prime contractor investing directly is a stronger signal about defense adoption than any press release.&lt;/p&gt;

&lt;p&gt;The money goes toward two things. First, extending burn time from the current 32 seconds to somewhere between 6 and 15 minutes. Second, a larger test stand in Texas, backed in part by the Texas Space Commission.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that stings a little
&lt;/h2&gt;

&lt;p&gt;A company that set out to build a clean airliner found its first real customer in weapons. That is not a cautionary tale so much as how validation works: prove the hardware, and the market decides what it is for. Hypersonic weapons, a replacement for solid rocket motors in missile propulsion, eventually launch vehicles — the road in front of an RDRE looks wider than the one Venus originally mapped out.&lt;/p&gt;

&lt;p&gt;Whether it ever gets back to the airliner is a separate question, and probably a slower one.&lt;/p&gt;

</description>
      <category>rdre</category>
      <category>b</category>
      <category>it</category>
    </item>
    <item>
      <title>If You Can't Charge an EV at Home, Is It Still Worth Buying One?</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Mon, 20 Jul 2026 13:47:12 +0000</pubDate>
      <link>https://dev.to/jalnanco/if-you-cant-charge-an-ev-at-home-is-it-still-worth-buying-one-15ic</link>
      <guid>https://dev.to/jalnanco/if-you-cant-charge-an-ev-at-home-is-it-still-worth-buying-one-15ic</guid>
      <description>&lt;p&gt;The first question that stops most EV shoppers isn't the price or the range. It's one line: "There's no charger where I live." Picture living in an apartment complex in Korea, with no assigned parking spot in the underground garage, where the few spots that do have chargers are always taken. How much does that actually cost you in daily hassle? The honest answer is: it depends more than you'd expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Slow and fast chargers aren't built for the same job
&lt;/h2&gt;

&lt;p&gt;Level 2 (AC) chargers are made for places where a car sits for hours, like home or work. DC fast chargers are made for a quick stop during a trip. Comparing the two as if they belong in the same category is where most of the confusion starts.&lt;/p&gt;

&lt;p&gt;Level 2 charging usually takes eight hours or more overnight to fill the battery. But it uses time the car would be sitting idle anyway, so it doesn't eat into your day. Plug in before bed, unplug in the morning, done.&lt;/p&gt;

&lt;p&gt;DC fast charging is designed to get the battery to around 80% in roughly 30 minutes. That speed comes at a cost: those 30 minutes go entirely to charging and nothing else. A coffee break doesn't always cover it, and it's common to see people just sitting near the charger, waiting. Battery makers also generally agree that charging fast every day wears the battery down faster than relying mostly on Level 2 charging. How much faster depends on the vehicle and the battery chemistry (NCM versus LFP), so it's hard to put a specific number on it here.&lt;/p&gt;

&lt;p&gt;The core difference comes down to this: Level 2 charging fits into your routine. Fast charging means clearing out a block of your schedule for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apartment charging has grown on paper, but not always in practice
&lt;/h2&gt;

&lt;p&gt;In Korea, national and local governments have steadily raised the required ratio of EV chargers in new apartment complexes. You can check charger counts by region through the Ministry of Environment's EV charger portal, Korea's official locator site for public and residential chargers, and newer complexes are required to set aside a higher share of charging spots. The catch is that this number only tells you how many chargers exist. It doesn't tell you how many are free when you actually need one.&lt;/p&gt;

&lt;p&gt;Older apartment complexes, especially ones where parking was already tight relative to the number of households, are a different story. There might be only a handful of charging spots, and as more residents buy EVs, competition for them grows. Even asking the management office to add chargers usually gets stuck behind electrical capacity upgrades, resident approval, and budget constraints. This varies enormously from one complex to another, so if you're considering a move or a purchase, it's worth calling the management office directly and asking how charging spots are assigned and how long the waitlist runs.&lt;/p&gt;

&lt;p&gt;On the other hand, if you live in a newer, larger complex with generous charger allocation, home charging is effectively the default, and most of the friction described here disappears. So the claim "apartment residents find EVs inconvenient" is only half right. What's actually true is that residents of complexes with too few charging spots are the ones who feel it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What people without home charging actually rely on
&lt;/h2&gt;

&lt;p&gt;People who can't charge at home tend to lean on three options.&lt;/p&gt;

&lt;p&gt;Workplace charging, when it exists, works almost as well as charging at home. Plug into a Level 2 charger when you arrive and unplug when you leave, and the battery fills up without cutting into your day. Whether your workplace even has chargers, and whether the spots actually turn over, varies enormously by company and isn't something you control.&lt;/p&gt;

&lt;p&gt;There's also public charging: the Level 2 and DC fast chargers found at grocery stores, government buildings, and public parking lots across Korea. You might charge while running errands, or fit a fast-charging stop into a route you're already driving. This doesn't force a separate trip, but it does mean planning your own charging schedule. You need to top up before the battery runs low, and checking charger availability through an app becomes a habit.&lt;/p&gt;

&lt;p&gt;The last option is relying entirely on DC fast charging. If there's a fast charger near home or along a route you already drive, and your daily mileage is short, some people get by on one or two fast-charging sessions a week. But looking at what people who take this route actually report, charger location, congestion, and whether the unit is even working all become variables every time. A common complaint: charging turns from a routine task into a hunt for a working charger.&lt;/p&gt;

&lt;h2&gt;
  
  
  How much this actually bothers you depends on your driving pattern
&lt;/h2&gt;

&lt;p&gt;Under identical conditions, some people drive an EV with no real friction while others stay stressed about it constantly. What separates the two groups is the combination of daily mileage and how accessible charging is.&lt;/p&gt;

&lt;p&gt;If your round-trip commute is short and there's at least one reliable charging option near work or home, charging once or twice a week is enough. In that case, the hassle of an occasional fast-charging stop stays manageable.&lt;/p&gt;

&lt;p&gt;It's a different story for people who drive long distances every day, or whose routes are unpredictable, like delivery or sales work. Charging plans start intruding on the daily schedule, and if that lines up with when fast chargers get busy, evening rush hour or weekends, you end up waiting in line too. Under these conditions, not having a home charger is likely to feel like real friction in daily life.&lt;/p&gt;

&lt;p&gt;Here's my take: not having home charging shouldn't be the single deciding factor on whether to buy an EV. Check your own driving pattern and the charging options you can actually reach first. If you have workplace charging or fast chargers along your regular route, the inconvenience drops to a manageable level. If neither holds up, no matter how much you like the car, there's a good chance your days end up revolving around a charging schedule.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to check before you buy
&lt;/h2&gt;

&lt;p&gt;Before drawing a conclusion, there's a short list worth checking by hand. Ask your apartment management office how many charging spots exist now and how long the waitlist is. Confirm whether your workplace parking lot has chargers and how they're assigned. Then search directly, through Korea's EV charger locator site or a maps app, for how densely fast and Level 2 chargers cover your regular routes. Only after checking these three things can you actually answer whether an EV is inconvenient for your specific situation. That answer, based on your own routes, is far more accurate than a blanket claim that EVs are always inconvenient or always fine.&lt;/p&gt;

</description>
      <category>it</category>
    </item>
    <item>
      <title>When You Start Writing Tests, What Changes Isn't the Code, It's the Fear</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Sun, 19 Jul 2026 00:30:15 +0000</pubDate>
      <link>https://dev.to/jalnanco/when-you-start-writing-tests-what-changes-isnt-the-code-its-the-fear-4nj5</link>
      <guid>https://dev.to/jalnanco/when-you-start-writing-tests-what-changes-isnt-the-code-its-the-fear-4nj5</guid>
      <description>&lt;p&gt;A developer who has never written a test hesitates at the refactor button. They can't be sure what will break. A developer who has tests behind them hits the same button without flinching. What separates the two isn't skill. It's whether they have a way to check their work. Junior or senior, without that check, people tend to build around the code instead of changing it. A few years of that and you end up with a block nobody dares touch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refactoring is scary because there's no way to check your work
&lt;/h2&gt;

&lt;p&gt;With tests, you find out within seconds of a change whether anything broke. Without them, you're stuck clicking through screens by hand, or you skip verification entirely and find out from a production alert. Martin Fowler defines refactoring as changing the structure of code without changing its behavior. There's no good way to prove behavior stayed the same except by running tests before and after and watching for green. Once that check gets cheap, you end up touching code more often. Stuff you used to avoid because it was too scary to touch becomes something you can fix, and technical debt piles up more slowly as a result.&lt;/p&gt;

&lt;h2&gt;
  
  
  The moment you reproduce a bug, that reproduction is already a regression test
&lt;/h2&gt;

&lt;p&gt;If you write reproduction code before fixing a bug, you get a regression test for free. The usual sequence without tests is: reproduce, find the cause, fix, eyeball the result, close the ticket. Months later someone touches nearby code and reintroduces the exact same bug, with no idea it ever happened before. Turn the reproduction into a test and you record the conditions that triggered the bug, which inputs, which state, in a form the computer can run on its own. Break those conditions again and the test tells you immediately. Keep this up and your test suite starts to read like a history of every incident the team has had. Reading test names and comments beats digging through the commit log for what went wrong last time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code that's hard to test is usually code that's badly designed
&lt;/h2&gt;

&lt;p&gt;If testing a single function means spinning up a database connection, calling an external API, and wiring up global state, that's a sign the design had problems long before anyone wrote a test for it. Michael Feathers, in his book Working Effectively with Legacy Code, defines legacy code as code without tests. Flip that around and it also means code that's easy to test is usually well designed. Once you start writing tests, injecting dependencies from outside the function becomes a habit. You hide database calls behind an interface. Anything that changes from run to run, like the current time or a random number, gets passed in as an argument instead of generated internally. What you end up with is more pure functions: same input, same output, every time. This isn't extra work done just to satisfy a test. Code that's easy to test tends to be easy to maintain, so the two pull in the same direction on their own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make coverage numbers the goal and testing turns into a burden
&lt;/h2&gt;

&lt;p&gt;A hundred percent coverage doesn't mean your code is safe. Martin Fowler wrote, in a blog post titled Test Coverage, that low coverage is a useful warning sign, but high coverage doesn't prove much (martinfowler.com/bliki/TestCoverage.html). Line coverage only checks whether a line ran at least once. It says nothing about whether you checked the result of running it. Call a function and never assert on its return value, and your coverage number still goes up. So when a team sets coverage as a target, you get more tests that run code without checking anything, which is the opposite of what anyone wanted. Testing implementation details is another common trap. Assert on internal variable values or the order private methods get called, and changing the internals breaks a pile of tests even though the visible behavior never changed. Tests like that don't support refactoring. They punish it, and that undermines the whole point of writing tests in the first place: being able to change code without dread.&lt;/p&gt;

&lt;h2&gt;
  
  
  So where do you actually start
&lt;/h2&gt;

&lt;p&gt;Don't try to retrofit tests onto an entire existing codebase. Add them to whatever you're touching right now, and whatever bug you're fixing right now. Plans to blanket an old codebase in tests tend to fall apart within a few weeks. It's much less overwhelming to test only what you're already working on: a new function, today's bug, next week's module. When you fix a bug, write the reproduction test before the fix itself, and you get the regression protection described earlier for free. Instead of reporting coverage percentages as a management metric, pull a list of files that change often and files that have actually caused outages, and fill in tests there first. That does more to prevent real incidents. I think tests, in the end, change how you relate to your own code. From the moment you start writing them, refactoring gets less scary. Every bug becomes a record instead of a repeat, and the design keeps getting pushed toward something simpler. But it's worth remembering that the moment you start measuring that tool by a number, it turns into a burden.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>tdd</category>
    </item>
    <item>
      <title>Why We Switched From Redis to Valkey (It Wasn't Just About the License)</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Sat, 18 Jul 2026 08:16:00 +0000</pubDate>
      <link>https://dev.to/jalnanco/why-we-switched-from-redis-to-valkey-it-wasnt-just-about-the-license-35lc</link>
      <guid>https://dev.to/jalnanco/why-we-switched-from-redis-to-valkey-it-wasnt-just-about-the-license-35lc</guid>
      <description>&lt;p&gt;When the migration first came up, everyone assumed it was purely a licensing decision. That part was real, but once we sat down to plan the actual cutover, the decisions that mattered most were somewhere else entirely: cross-AZ traffic costs, whether to turn cluster mode on, and a client library swap we hadn't fully budgeted for.&lt;/p&gt;

&lt;p&gt;Valkey is a drop-in replacement for Redis OSS, maintained by the Linux Foundation under a BSD license. It keeps the Redis API compatible while removing the licensing constraints and fork uncertainty that started this whole conversation. Because our existing Redis clusters didn't need major rework to run on it, we could put together an incident response plan quickly instead of redesigning our caching layer from scratch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we turned cluster mode off
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F43obtyj0hvmdiv9084w3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F43obtyj0hvmdiv9084w3.png" alt="The three key decisions in the Valkey migration: cluster mode, AZ costs, and the client library swap" width="799" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first call we had to make was whether to turn cluster mode on. Splitting data across multiple nodes for horizontal scaling sounds great on paper, but the further you shard, the messier resharding gets. We chose predictable latency and easier debugging over that risk, so cluster mode stayed off. Unless your traffic genuinely needs horizontal scale right now, running a single configuration with fewer failure points is the more realistic option.&lt;/p&gt;

&lt;p&gt;Cross-AZ cost was the other half of that decision. Traffic between availability zones isn't free, and aligning the Redis layer within AZ boundaries cuts that cost. Scattering data across AZs with cluster mode on would have made the bill harder to reason about. Keeping it off and managing AZ placement directly kept the math simple.&lt;/p&gt;

&lt;h2&gt;
  
  
  From ioredis to node-redis: why the code had to change too
&lt;/h2&gt;

&lt;p&gt;The migration plan also included swapping client libraries, from ioredis to node-redis. On paper it looks like a dependency bump, but it actually meant rewriting code and re-testing command compatibility. That's why we rolled it out to dev first before touching production. If something broke after a full library swap in prod, rolling back would have been painful, so we wanted to shrink the blast radius to dev before anything else.&lt;/p&gt;

&lt;p&gt;Pinning exact versions mattered for the same reason. Recording something like Redis fork 7.2.4 instead of just "latest" meant we always had a clear rollback point the moment something went wrong. We made sure there was a way back at every step of the migration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we waited for Valkey 9.0
&lt;/h2&gt;

&lt;p&gt;There was one feature we'd been watching before the migration even started: hash field expiration, which shipped in Valkey 9.0. Previously, TTLs could only be set at the key level, which made things awkward whenever a hash mixed short-lived fields with ones meant to persist. According to &lt;a href="https://valkey.io/blog/hash-fields-expiration/" rel="noopener noreferrer"&gt;Valkey's blog post on hash field expiration&lt;/a&gt;, you can now set a TTL per field, so different attributes of the same object can share a hash and still expire on their own schedule. That meant we could solve the problem without redesigning our cache structure.&lt;/p&gt;

&lt;p&gt;Then &lt;a href="https://aws.amazon.com/about-aws/whats-new/2026/05/valkey-amazon-elasticache/" rel="noopener noreferrer"&gt;AWS announced Valkey 9.0 support for Amazon ElastiCache&lt;/a&gt;, and the plan became something we could execute. Per the announcement, pipelined workloads can see throughput gains up to 40%, and the release also brought full-text search and multi-database support in cluster mode. The catch is that client connections can drop mid-upgrade. So before flipping anything on, we made sure dev/beta testing, retry/backoff logic, and monitoring around hash field expiration usage were all in place first. A new feature shipping doesn't mean turning it on immediately. It means checking first whether your system can tolerate the disruption.&lt;/p&gt;

&lt;p&gt;The license is what started the migration, but the decisions that actually got it across the line were whether to enable cluster mode, how to cut AZ costs, and in what order to validate the client swap. Those three calls turned out to matter more than Valkey itself.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>redis</category>
      <category>valkey</category>
      <category>elasticache</category>
      <category>ioredis</category>
    </item>
    <item>
      <title>The Real Point of Code Review Isn't Catching Bugs</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Wed, 15 Jul 2026 18:53:28 +0000</pubDate>
      <link>https://dev.to/jalnanco/the-real-point-of-code-review-isnt-catching-bugs-g47</link>
      <guid>https://dev.to/jalnanco/the-real-point-of-code-review-isnt-catching-bugs-g47</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F321tbmf6xgzzf78qcpvd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F321tbmf6xgzzf78qcpvd.png" alt="Hero image showing a code review focused on understandability instead of bugs" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A thread on Hacker News caught my eye. It traced back to a single line the mathematician and developer Mark Dominus had posted on Mastodon: "I think a lot of people misunderstand the purpose of code review." I nodded along the moment I read it, and then found I couldn't explain why I agreed. So I read the original thread to the end.&lt;/p&gt;

&lt;p&gt;Dominus's argument goes like this. A reviewer's job is neither to find bugs nor to certify that the code is bug-free. The real primary goal, he says, is to find code that will be hard to maintain. And that kind of code should be fixed while the original author still remembers it, meaning right now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why review falls apart when bug hunting becomes the goal
&lt;/h2&gt;

&lt;p&gt;If you set bug-finding as the goal of review, you're asking the reviewer to prove something that can't be proven. "This PR has no bugs" isn't the kind of claim a single read confirms. If there's a way to confirm it, that's the job of tests or static analysis, not a human scanning a diff. What a person can actually catch is usually shallow, typo-level mistakes. Yet when review starts with "please check there are no bugs," the reviewer can never decide on their own when it's time to hit approve. They skim and approve, or they sink into perfectionism and the review drags on forever. Both endings are bad.&lt;/p&gt;

&lt;h2&gt;
  
  
  The alternative: did you understand it, or not?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv5whfiyzkss8xl6ync4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv5whfiyzkss8xl6ync4z.png" alt="Flow diagram: approve the code review when you understand it, ask questions when you don't" width="800" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The replacement standard Dominus offers is simple: see if you can understand it, and complain if you can't. The condition for hitting approve shifts away from fully understanding the whole change and toward pointing at the exact line you didn't understand. Two things are different about this definition. You now have a grip on when the review should end. And anyone can say "I don't get why this function is written this way" on the spot, while nobody can confidently stamp "this PR has no bugs."&lt;/p&gt;

&lt;p&gt;Once you move the standard this way, the question the review asks changes too. In place of "does this work correctly right now" comes "will someone seeing this code for the first time six months from now have to wrestle with it." Under this redefinition the review comments change as well. Fewer comments say "I think there's a bug here," and more of them point at the line where understanding broke down, like "I don't get why this cache TTL suddenly dropped to three minutes," naming the variable and the line. Put the two frames side by side and the difference is sharper.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Bug-hunting frame&lt;/th&gt;
&lt;th&gt;Understandability frame&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Question the reviewer asks&lt;/td&gt;
&lt;td&gt;Is there a bug in this code?&lt;/td&gt;
&lt;td&gt;Do I understand why this code is written this way?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stopping condition&lt;/td&gt;
&lt;td&gt;None, since the claim can't be proven, so you keep scanning&lt;/td&gt;
&lt;td&gt;Clear: approve if you understand it, send it back if you don't&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Representative comment&lt;/td&gt;
&lt;td&gt;"I think there's a bug here"&lt;/td&gt;
&lt;td&gt;"I don't get why this cache TTL dropped to three minutes"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;As the code grows&lt;/td&gt;
&lt;td&gt;Review becomes a more and more hopeless task&lt;/td&gt;
&lt;td&gt;The question stays the same&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The reason this redefinition didn't feel foreign is that I'd already been drifting in this direction while running reviews in practice. At a company I used to work at, we used a CODEOWNERS file, and in hindsight it was less a device for asking "who has to confirm this code is bug-free" than one that automatically routed "who understands this code and can own it." On a team I was on, work that took less than three days, like copy edits or UI tweaks, went through code review alone, with no formal spec document. (In Korea it's common to write a planning doc before even small changes get built, so skipping it for small work was itself a deliberate call.) What the reviewer actually checked in those cases was whether it was clear enough to get at a glance. Whether it had bugs came after. When you put up a review request, the first comment usually landed within half a day, and what the reviewer really wrestled with in that half day was why it was written that way. Whether the logic was correct came second. Typos and repeated mistakes got filtered out ahead of time by a pre-commit hook, so the review time a person spent was narrowed to just "do I understand why this is written this way," not the mechanical stuff. At the time I thought of it as habit and nothing more, but after reading Dominus I realized all of it had been pointing the same way. The comment that showed up most in those reviews was "I don't get why this part is needed," not "isn't this a bug."&lt;/p&gt;

&lt;p&gt;I checked separately, later, that this practice wasn't some quirk of one team. A 2018 paper, &lt;a href="https://research.google/pubs/modern-code-review-a-case-study-at-google/" rel="noopener noreferrer"&gt;"Modern Code Review: A Case Study at Google"&lt;/a&gt;, analyzed logs, interviews, and surveys across 25,000 Google developers and 9 million reviews, and it names understandability and maintainability as the "most fundamental reason" review was introduced in the first place. Catching more defects was a side effect that followed. "Expectations regarding code review are not centered around problem solving. Finding defects is welcome but is not the only focus" is the sentence the paper nails down as Finding 1. Google's &lt;a href="https://google.github.io/eng-practices/review/reviewer/standard.html" rel="noopener noreferrer"&gt;official code review guide&lt;/a&gt; reads the same way. It writes that "the primary purpose of code review is to make sure that the overall code health of the codebase is improving over time," and states that there is no such thing as perfect code, only better code, telling reviewers not to hold up approval in the name of perfection. Google also filters style checks and repeated mistakes with pre-commit hooks, and the review a human does is handled by someone certified with ownership and readability for that code. What my team rigged up with one CODEOWNERS file and a few pre-commit hooks, Google was running at a scale of 25,000 people, with formal badges for ownership and readability certification.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not everyone agreed with this redefinition
&lt;/h2&gt;

&lt;p&gt;The comment section on the original thread didn't flow into easy agreement. People who work in security, and people who care about test coverage, pushed back that bug hunting is a legitimate part of review too. Vulnerabilities like auth bypass or a missing permission check don't get caught by the feeling that something doesn't make sense. If anything, the more smoothly code reads, the harder its hidden security holes are to see. It's fair pushback. Dominus's redefinition is a default that works broadly across ordinary feature code. It doesn't fit every kind of code unconditionally. For high-risk areas like auth, payments, and permissions, the point is that you have to lay a bug-hunting checklist on top of understandability, not that you should throw bug hunting out. Concretely: for permission-check unit tests, you take a test that only passed with an admin account token and add a case that calls the same admin API with a regular account token, to confirm that the path OWASP calls IDOR and BOLA, poking at someone else's object ID with my token, is actually blocked. For token expiry and reuse scenarios, you check whether a refresh token, once used, is immediately rejected when the same token requests again, meaning whether reuse detection and token rotation are in place. For SAST, a static-analysis tool like Semgrep or CodeQL wires SQL injection and XSS pattern rules into CI, and the checklist item is whether those results get attached automatically as reviewer comments. All three are things that "do I understand it" won't catch, and a test or a tool has to point them out separately. Understandable code and safe code are different axes, and in high-risk areas you have to review both.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI-written code has no original author to ask
&lt;/h2&gt;

&lt;p&gt;Dominus's timing principle, fix the problem code while the original author still remembers it, stands on an assumption from an era when people wrote most of the code. The assumption that if you ask the author, an answer comes back. But now that agents write a large share of the code, that assumption is the first thing to wobble. Ask Claude Code or Codex "why did you write it this way" and you do get a plausible answer back. It's just that the answer is reasoned up again in that moment, invented, and not something recalled about why this library was chosen back then, or why this exception was caught only here. By the time the PR goes up, the author's memory is already gone. The review starts with no one to ask.&lt;/p&gt;

&lt;p&gt;So the understandability standard gets much heavier for AI-written code than for human-written code. With human code, if you couldn't understand it, the last resort was to grab the author and press them. AI-written code has no last resort. If the reviewer, looking only at the code, never manages to understand it, that code stays in the codebase with no one having understood it. Define review as bug hunting and this state passes review clean, because even a bug-hunting eye finds nothing wrong in the surface behavior. Only defining review as understandability lets you catch, at the review stage, the state where the code works correctly now but no one knows why.&lt;/p&gt;

&lt;p&gt;This is the same gap I pointed at in &lt;a href="https://jalnanco.blogspot.com/2026/07/ai_01295351004.html" rel="noopener noreferrer"&gt;an earlier piece&lt;/a&gt;. Giving AI write access to files, and trusting an AI's judgment without verifying it, were different problems. Same here. AI already has permission to put up a PR. Hand the job of judging whether that code is understandable to the AI too, and the permission passes fine while the judgment comes in with no one having verified it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What holds a review up
&lt;/h2&gt;

&lt;p&gt;As long as you treat review as bug hunting, review gets more hopeless the more the code grows. All that piles up is the demand to find more of what can't all be found. Move the standard to understandability and the question stays the same no matter how much the code grows. Understand it, pass it; don't, send it back. Whether a person or an agent wrote it doesn't matter. The reason Dominus's line keeps turning over in my head is that it confirmed, late, that what holds up the act of review was really understanding more than verification.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why Nigeria's Climate Policy Now Starts in the Kitchen</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Tue, 14 Jul 2026 23:07:46 +0000</pubDate>
      <link>https://dev.to/jalnanco/why-nigerias-climate-policy-now-starts-in-the-kitchen-107</link>
      <guid>https://dev.to/jalnanco/why-nigerias-climate-policy-now-starts-in-the-kitchen-107</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fix2jg91w8gtdxyclo3m5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fix2jg91w8gtdxyclo3m5.png" alt="An illustration of a firewood stove next to a gas stove in an African kitchen" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mention climate targets and most people picture power plants, cars, or factory smokestacks. Almost nobody pictures a kitchen. But in Nigeria right now, the kitchen is sitting right in the middle of climate policy. A civil society group called AGNES (African Group of Negotiators Experts Support) recently pushed the federal government to scale up clean cooking policy, and the &lt;a href="https://www.premiumtimesng.com/news/892538-group-urges-fg-to-scale-up-clean-cooking-to-achieve-climate-targets.html" rel="noopener noreferrer"&gt;original report&lt;/a&gt; lists the environment ministry, the National Council on Climate Change, and the power ministry as co-signers. This isn't just a press release. Why the kitchen, of all places?&lt;/p&gt;

&lt;h2&gt;
  
  
  How a kitchen becomes a climate problem
&lt;/h2&gt;

&lt;p&gt;The answer is in the numbers. About 95% of Nigerian households cook with polluting fuels like firewood, kerosene, or charcoal, while only around 5% use clean fuels like electricity or LPG, according to &lt;a href="https://www.researchgate.net/publication/359605825_Clean_cooking_energy_transition_in_Nigeria_Policy_Implications_for_Developing_countries" rel="noopener noreferrer"&gt;one study&lt;/a&gt;. Zoom out to all of Sub-Saharan Africa and the IEA counts four out of five people still cooking over open fires (&lt;a href="https://www.iea.org/reports/sdg7-data-and-projections/access-to-clean-cooking" rel="noopener noreferrer"&gt;IEA clean cooking data&lt;/a&gt;). This isn't some backwater exception. It's the daily reality for the vast majority of a continent.&lt;/p&gt;

&lt;p&gt;That creates three overlapping problems. Cutting firewood keeps shrinking forests. The soot and methane released during burning are short-lived climate pollutants that add directly to warming. And the people breathing that smoke every day in their own homes pay for it with their health. The IEA estimates household air pollution causes about 3.7 million premature deaths worldwide each year, 815,000 of them in Africa, with 60% of that toll falling on women and children (&lt;a href="https://www.iea.org/reports/a-vision-for-clean-cooking-access-for-all/executive-summary" rel="noopener noreferrer"&gt;IEA vision for clean cooking access&lt;/a&gt;). The people lighting the fire and the people getting sick from it are the same people, which is why an AGNES official's claim that "this issue touches productivity, education, health, and economic opportunity" doesn't read as exaggeration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Everyone knows the problem. So why hasn't it changed?
&lt;/h2&gt;

&lt;p&gt;None of this is new. The Nigerian government has run improved-stove distribution programs and LPG conversion campaigns for years, so why do 95% of households still cook the old way? Pull the thread and it's not a technology problem. It's a money and habit problem. LPG stoves cost too much upfront, and the gas supply chain barely reaches past city limits. LPG ownership in rural households sits below 10%, versus more than half in urban ones. On top of that, myths that gas is dangerous or that it changes the taste of food still circulate, so even where the infrastructure exists, a psychological barrier remains (&lt;a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC5923683/" rel="noopener noreferrer"&gt;analysis of LPG adoption in Nigeria&lt;/a&gt;). Getting a stove into a kitchen for good takes finance, distribution, and trust moving together. Handing out stoves alone was never going to be fast enough.&lt;/p&gt;

&lt;p&gt;That's why it makes sense that this latest push also names electric cooking and carbon-market climate finance as tools. The IEA estimates universal clean cooking access across Africa by 2040 would cost about $2 billion a year (&lt;a href="https://www.iea.org/reports/universal-access-to-clean-cooking-in-africa/executive-summary" rel="noopener noreferrer"&gt;IEA Africa report&lt;/a&gt;), a figure that lines up with the $2.2 billion in pledges that came out of the first Clean Cooking Summit in 2024. The number looks large on its own, but if swapping wood for gas alone can save hundreds of thousands of lives and a meaningful amount of forest every year, it's not an outsized bill.&lt;/p&gt;

&lt;h2&gt;
  
  
  The weight of changing a single kitchen
&lt;/h2&gt;

&lt;p&gt;I want to state my own view plainly here. Clean cooking usually gets treated as a footnote on the climate agenda, a symbolic line item near the bottom of the list, and that ordering is wrong. Retrofitting millions of household kitchens saves lives faster and more directly than building a handful of power plants ever could. We tend to picture climate action as sweeping policy and international negotiation, which may be exactly why it feels strange to imagine the solution starting in the most private room in the house.&lt;/p&gt;

&lt;p&gt;Early in my own time living alone, I got by on a portable butane burner for a few months, and even that brief, minor discomfort gave me some sense of the weight of cooking over wood smoke every single day. Writing in this lifestyle-and-practical-info space keeps reminding me how much a single small habit can change someone's quality of life, and this story is one more example of that. The next time I revisit this topic, I'll be looking past the summit pledge numbers for the follow-up data: how many stoves actually ended up in how many homes.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>lpg</category>
    </item>
    <item>
      <title>95% of Nigerian households still cook over wood. Here's why the kitchen became a climate policy fight</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Tue, 14 Jul 2026 17:41:03 +0000</pubDate>
      <link>https://dev.to/jalnanco/95-of-nigerian-households-still-cook-over-wood-heres-why-the-kitchen-became-a-climate-policy-31e</link>
      <guid>https://dev.to/jalnanco/95-of-nigerian-households-still-cook-over-wood-heres-why-the-kitchen-became-a-climate-policy-31e</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fix2jg91w8gtdxyclo3m5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fix2jg91w8gtdxyclo3m5.png" alt="Illustration of a wood-burning stove and a gas stove side by side in an African kitchen" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When people hear "climate targets," they picture power plants, cars, and factory smokestacks, not kitchens. But in Nigeria right now, the kitchen has landed at the center of climate policy. The civil society coalition AGNES (African Group of Negotiators Experts Support) recently urged the federal government to scale up clean cooking policy, and &lt;a href="https://www.premiumtimesng.com/news/892538-group-urges-fg-to-scale-up-clean-cooking-to-achieve-climate-targets.html" rel="noopener noreferrer"&gt;the original report&lt;/a&gt; shows the Ministry of Environment, the National Council on Climate Change (NCCC), and the Ministry of Power all signed on. This is well beyond a symbolic statement. So why the kitchen, of all places?&lt;/p&gt;

&lt;h2&gt;
  
  
  How a kitchen becomes a climate problem
&lt;/h2&gt;

&lt;p&gt;The answer is in the numbers. Roughly 95% of Nigerian households cook with polluting fuels: firewood, kerosene, charcoal. Only about 5% use clean fuels like electricity or LPG, according to &lt;a href="https://www.researchgate.net/publication/359605825_Clean_cooking_energy_transition_in_Nigeria_Policy_Implications_for_Developing_countries" rel="noopener noreferrer"&gt;a policy review&lt;/a&gt;. Zoom out to sub-Saharan Africa as a whole, and the IEA counts four out of every five people still cooking over open fires (&lt;a href="https://www.iea.org/reports/sdg7-data-and-projections/access-to-clean-cooking" rel="noopener noreferrer"&gt;IEA clean cooking data&lt;/a&gt;). This isn't some exceptional scene from a handful of remote villages. It's the daily reality for the overwhelming majority of the continent's population.&lt;/p&gt;

&lt;p&gt;From there, the damage splits into three branches. Cutting firewood continuously shrinks forests. The soot and methane released during combustion are short-lived climate pollutants that amplify the greenhouse effect. And at the same time, the people breathing in that acrid smoke every day inside their own homes are getting sick. The IEA estimates roughly 3.7 million premature deaths worldwide each year from household air pollution, 815,000 of them in Africa alone, with 60% of that toll falling on women and children (&lt;a href="https://www.iea.org/reports/a-vision-for-clean-cooking-access-for-all/executive-summary" rel="noopener noreferrer"&gt;IEA's vision for clean cooking access&lt;/a&gt;). The person lighting the fire and the person getting sick from it are the same person. So when an AGNES representative says "this issue touches productivity, education, health, and economic opportunity," it doesn't read as an exaggeration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why nothing has changed, even though everyone knows
&lt;/h2&gt;

&lt;p&gt;This problem isn't new, though. Nigeria's government has run improved-cookstove and LPG-conversion campaigns for years, so why does 95% of the country still cook the old way? Dig into the cause, and it isn't a technology problem. It's money and habit. The upfront cost of an LPG stove is a real barrier, and the gas supply network barely extends past city limits. Rural households own LPG stoves at under 10%, while urban households cross 50%. On top of that, myths that gas is dangerous or that it changes the taste of food are still widespread, so even where the infrastructure exists, a psychological barrier remains (&lt;a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC5923683/" rel="noopener noreferrer"&gt;analysis of LPG adoption in Nigeria&lt;/a&gt;). Finance, distribution, and trust all have to move together before a stove earns a permanent spot in the kitchen. Handing out free stoves alone was never going to move fast enough.&lt;/p&gt;

&lt;p&gt;That's why this new push, naming electric cooking and carbon-market climate finance in the same breath, is aimed at the right target. The IEA estimates that reaching universal clean cooking access across Africa by 2040 would take roughly $2 billion a year (&lt;a href="https://www.iea.org/reports/universal-access-to-clean-cooking-in-africa/executive-summary" rel="noopener noreferrer"&gt;IEA's Africa report&lt;/a&gt;), and the $2.2 billion pledged at the first Clean Cooking Summit in 2024 lines up with that math. The number looks large in isolation, but if simply switching from wood to gas can save hundreds of thousands of lives and a meaningful stretch of forest every year, it's not an outsized bill.&lt;/p&gt;

&lt;h2&gt;
  
  
  The weight of changing a single kitchen
&lt;/h2&gt;

&lt;p&gt;I want to state my own read on this plainly. Clean cooking usually gets filed at the bottom of the climate-action list, treated as a symbolic line item, and that ordering is backwards. Retrofitting millions of households' kitchens saves lives faster and more directly than building a few more power plants. We tend to encounter climate action as a story about sweeping policy and international negotiations, so it feels almost strange to consider that the most private room in a house could be where the solution starts.&lt;/p&gt;

&lt;p&gt;Early in my own independent living, I got by for a few months on a portable butane burner. Even that brief stretch of smell and inconvenience gave me some sense of the weight of cooking inside wood smoke every single day. Every time I write in this everyday-life category, I'm reminded how much a single small habit can change quality of life, and this story sits on that same line. Next time this topic comes back around, I'll be looking past the summit pledge numbers to find out how many stoves actually made it into real households.&lt;/p&gt;

</description>
      <category>lpg</category>
    </item>
    <item>
      <title>The Fish That Gave Up Its Eyes and Rewired Its Brain</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Tue, 14 Jul 2026 03:59:56 +0000</pubDate>
      <link>https://dev.to/jalnanco/the-fish-that-gave-up-its-eyes-and-rewired-its-brain-k5l</link>
      <guid>https://dev.to/jalnanco/the-fish-that-gave-up-its-eyes-and-rewired-its-brain-k5l</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F55r0o2bwdxvcp0p99kss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F55r0o2bwdxvcp0p99kss.png" alt="A digital illustration of an eyeless, translucent cavefish swimming under a shaft of light filtering through the darkness of a cave" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I write blog posts before dawn, I drop my screen brightness to its lowest setting and kill the room lights. At first it was just to stop my eyes from stinging, but after a few nights the typos dropped off and the sentences seemed to hang together better. All I did was lean less on my eyes and more on the feel of my fingers and the rhythm in my head, and even that small shift felt like something inside was getting rearranged. So a study I read recently stuck with me: an animal that has lived without light for tens of thousands of years can have its whole brain rebuilt. It is about the blind Mexican cavefish, Astyanax mexicanus.&lt;/p&gt;

&lt;h2&gt;
  
  
  Same fish, so why do half of them have no eyes
&lt;/h2&gt;

&lt;p&gt;The Mexican tetra started out as an ordinary sighted freshwater fish living in the rivers and streams above ground. Some populations washed into the limestone caves of eastern Mexico, got stranded there, and over generations in the dark their eyes shrank or vanished entirely. The strange part is that the surface form and the cave form are not separate species. They are the same one. You can breed them in a lab and they share most of their genome. Yet one reads the world with its eyes and the other actively flees from light. That makes this fish a living control group, evidence that evolution can rebuild an entire sensory system without needing eons or a full species split.&lt;/p&gt;

&lt;p&gt;Erik Duboué's team at Florida Atlantic University &lt;a href="https://nautil.us/this-blind-cave-dwelling-fish-may-be-the-key-to-understanding-brain-evolution-1282427/" rel="noopener noreferrer"&gt;published a study in Science Advances&lt;/a&gt; that pushed on exactly this point with a behavior experiment. They dropped surface fish and cavefish into a chamber that flipped between light and dark every five minutes and tracked how they moved. The surface fish went hyperactive in the dark. The cavefish did the reverse, thrashing around when the light came on. A fish with no eyes reacting to light sounds backwards. It is obviously not seeing and dodging. Its whole body has learned to read light as a cue to flee.&lt;/p&gt;

&lt;h2&gt;
  
  
  The brain does not build new circuits, it reuses the old ones
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4g8qmpxs5cw603xqfhd3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4g8qmpxs5cw603xqfhd3.png" alt="Flow diagram: after vision is lost, darkness-response neurons are repurposed into light-response circuits, and the saved energy is redirected to taste and lateral-line senses" width="797" height="207"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The real payoff was not the behavior but the brain circuit driving it. When the team looked at neural activity, they found that in a region called the caudal posterior tuberculum, the very neurons that fired in response to darkness in surface fish had flipped to fire in response to light in cavefish. No new bundle of nerves got built. The switch on the existing wiring simply got reversed. That is why the finding matters. It explains how evolution could invert an entire sensory response inside a window that is, biologically speaking, short: instead of building from scratch, it reworked what was already there. Rewiring a house goes a lot faster than framing a new one.&lt;/p&gt;

&lt;p&gt;A natural doubt creeps in here. Isn't this just a side effect of the eyes degenerating? The team answered that by crossing surface fish with cavefish and watching the light response show up scrambled in the hybrids. The reaction did not fire at random. It is genetically determined and inherited, which means natural selection picked this trait out. So why would avoiding light get selected for? The cave mouth, where light seeps in, is exactly where predators are likely to gather. The most plausible read is that fish that shied away from light stayed clear of that danger zone and lived. Whether natural selection alone can account for eye loss this fast, repeated independently across separate cave populations, is still &lt;a href="https://news.sbs.co.kr/news/endPage.do?news_id=N1007563449" rel="noopener noreferrer"&gt;debated&lt;/a&gt; among biologists. Some argue the slow accumulation of neutral mutations cannot fit the timeline, so this one small fish keeps dragging a much larger evolutionary argument around with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A lost sense does not disappear, it relocates
&lt;/h2&gt;

&lt;p&gt;For giving up sight, the cavefish got something back. Studies have shown its &lt;a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC11036076/" rel="noopener noreferrer"&gt;lateral line is far more developed than the surface fish's, and taste cells have multiplied across its head&lt;/a&gt;. The lateral line senses tiny vibrations and currents in the water, and the cavefish uses it to map walls, food, and other fish in total darkness. The brain did not leave the visual territory sitting empty. It reassigned that processing capacity to touch and taste. Lose one sense and the whole brain does not wither. It reorganizes around whichever senses are left, and this fish shows that with its own body.&lt;/p&gt;

&lt;p&gt;That is also why researchers studying the human brain keep an eye on this one. Vertebrates share a lot of their basic neural wiring, so a fish whose brain reorganizes after sensory loss sits on the same axis as a blind person's brain expanding the regions that handle hearing and touch, or a stroke patient's recovery where other regions take over the job of the damaged area. When one sense gets blocked, the brain does not throw up its hands. It funnels its resources into whatever channels remain. The principle looks much the same whether you are a fish or a person.&lt;/p&gt;

&lt;p&gt;After reading the article, my habit of writing in the dark before dawn felt a little different. A few weeks of it will not rewire my neurons, but the sensation itself, that deliberately dialing down one channel makes the others scramble to fill the gap, runs in the same direction as this fish's story. Next time the writing stalls, turning the screen darker instead of brighter seems like an experiment with nothing to lose.&lt;/p&gt;

&lt;p&gt;Thanks for reading. Yaho&lt;/p&gt;

</description>
      <category>astyanax</category>
    </item>
    <item>
      <title>Why Rainbows Appear, and Why They're Always Arched</title>
      <dc:creator>장지호</dc:creator>
      <pubDate>Mon, 13 Jul 2026 18:22:02 +0000</pubDate>
      <link>https://dev.to/jalnanco/why-rainbows-appear-and-why-theyre-always-arched-2cn8</link>
      <guid>https://dev.to/jalnanco/why-rainbows-appear-and-why-theyre-always-arched-2cn8</guid>
      <description>&lt;p&gt;After a heavy summer shower, the air turns unusually clear. The smell of rain rises off the wet asphalt, the clouds break, and sunlight slants down. Look up at the right moment and a rainbow hangs on one side of the sky. Stare at it for a few seconds and the question comes on its own. Where do these bands of color come from?&lt;/p&gt;

&lt;p&gt;Rainbows don't show up on demand. The best window is that short stretch before the rain fully stops, when drops are still falling on one side of the sky while the sun is already out on the other. Bigger drops split the colors more strongly, which is why a rainbow right after a downpour looks far more vivid than one in a drizzle. With some luck, you'll also spot a second, fainter bow outside the first.&lt;/p&gt;

&lt;h2&gt;
  
  
  A rainbow is sunlight split apart by water droplets
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdimdpy8ltnf1ivp4pqu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdimdpy8ltnf1ivp4pqu4.png" alt="A rainbow hanging in a moist sky after a rain shower has passed" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sunlight looks white, but it carries many colors at once. Normally they travel mixed together, so we just see brightness. They only become visible as separate bands when something sends each color down a slightly different path. That something is water droplets floating in the air. Right after a shower, the sky holds countless tiny droplets. Sunlight bends as it enters each one, reflects off the inside, and comes back out, and along the way the colors spread apart. Nothing solid is hanging in the sky. A rainbow is just that split light, gathered by your eyes from one particular direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Every droplet works like a tiny prism
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcslv9wczmyfgbbsjxnwo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcslv9wczmyfgbbsjxnwo.png" alt="Diagram showing sunlight refracting, reflecting, and dispersing into rainbow colors inside a water droplet" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When light passes from air into water, or from water back into air, its path bends at the boundary. That bending is called refraction. The catch is that each color bends by a slightly different amount. Reds bend less, blues and violets bend more. So when sunlight enters a droplet, it bends once going in, bounces off the back wall, and bends again coming out, and the colors fan out like a spread of cards. A glass prism does the same thing when it throws a colored band across a table. Every droplet in the sky is a miniature prism, and the rainbow you see is the combined work of a huge number of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  That's why the sun has to be behind you
&lt;/h2&gt;

&lt;p&gt;You may have heard that you need the sun at your back to see a rainbow. The reason is simple: the light that enters a droplet reflects off the inside and comes back toward you. Sunlight travels from behind you into the droplets, turns around inside them, and returns to your eyes. So a rainbow always appears directly opposite the sun, in the part of the sky your shadow points to. That's also why morning rainbows hang in the western sky and late-afternoon rainbows in the east. Face the sun and you won't see one, no matter how much water is in the air.&lt;/p&gt;

&lt;h2&gt;
  
  
  The arc exists because color only gathers at one angle
&lt;/h2&gt;

&lt;p&gt;The light coming back out of the droplets doesn't scatter in every direction. It concentrates most strongly at about 42 degrees away from the point directly opposite the sun. Red gathers slightly toward the outside of that angle, violet slightly toward the inside. Connect every point that sits at 42 degrees and you get a circle. The rainbow curves because only the droplets at that exact angle can send color to your eyes. The ground blocks the lower half, so you usually get a semicircle at most. The lower the sun sits, the taller and rounder the arc looks. If the sun climbs higher than 42 degrees above the horizon, the whole arc sinks below it. That's the reason midday rainbows are so rare. From a mountaintop or an airplane window, with nothing in the way, a rainbow can appear as a complete circle.&lt;/p&gt;

&lt;h2&gt;
  
  
  A double rainbow means the light bounced twice
&lt;/h2&gt;

&lt;p&gt;Sometimes a fainter rainbow appears outside the bright one. That outer bow forms when light reflects twice inside the droplets. The extra reflection pushes the exit angle out to about 51 degrees and flips the color order, so the inner bow is red on the outside while the outer bow is red on the inside. Each reflection costs some light, so the second bow is always dimmer. Between the two bows sits a strip of sky that is noticeably darker, called Alexander's dark band after the Greek philosopher who first described it about 1,800 years ago. Droplets can't send light into the gap between those two angles, so it's a genuine shadow.&lt;/p&gt;

&lt;p&gt;Knowing how it all works doesn't make a rainbow any less strange. A rainbow is built around the position of your own eyes, so the person standing next to you is seeing light from a different set of droplets. Under the same sky, each of us is watching our own private rainbow. Maybe that's why we keep looking up at it.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
