<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://blog.brainsandbox.com/en/feed.xml" rel="self" type="application/atom+xml" /><link href="https://blog.brainsandbox.com/en/" rel="alternate" type="text/html" hreflang="zh-CN" /><updated>2026-04-06T09:50:32+00:00</updated><id>https://blog.brainsandbox.com/feed.xml</id><title type="html">Brain Sandbox</title><subtitle>一个关于技术与生活的思考实验场</subtitle><author><name>Woody Wang</name></author><entry xml:lang="en"><title type="html">Testing Four macOS Terminals for AI Coding: Which One Is the Best Companion for Claude Code?</title><link href="https://blog.brainsandbox.com/en/tech-sharing/2026/04/06/macos-terminal-for-ai-coding-agents.html" rel="alternate" type="text/html" title="Testing Four macOS Terminals for AI Coding: Which One Is the Best Companion for Claude Code?" /><published>2026-04-06T08:00:00+00:00</published><updated>2026-04-06T08:00:00+00:00</updated><id>https://blog.brainsandbox.com/tech-sharing/2026/04/06/macos-terminal-for-ai-coding-agents-en</id><content type="html" xml:base="https://blog.brainsandbox.com/tech-sharing/2026/04/06/macos-terminal-for-ai-coding-agents.html"><![CDATA[<p>If you’re like me and your daily development workflow already depends on AI coding agents like Claude Code and Codex, you’ve probably wondered: <strong>does the terminal itself affect the AI experience?</strong></p>

<p>I used iTerm2 for years, then switched to Ghostty last year after hearing it played nicer with AI tools. I’ve also been using Warp for certain scenarios. Recently I had some time to put all of them side by side for a proper comparison — and I dragged the built-in Terminal.app along for the ride.</p>

<h2 id="tldr-theres-no-perfect-answer">TL;DR: There’s No Perfect Answer</h2>

<p>Let me just say it upfront: <strong>no single terminal is the “optimal choice” for AI coding.</strong> Each has its strengths and pain points, and the best pick depends on your habits and specific use case. Here’s a rough positioning of the four:</p>

<pre><code class="language-mermaid">graph LR
    subgraph Traditional Terminal
        A["Terminal.app&lt;br/&gt;Lightweight · Zero Config · Limited Features"]
        B["iTerm2&lt;br/&gt;Feature Rich · Scrollback · Mature Ecosystem"]
    end
    subgraph Next-Gen Terminal
        C["Ghostty&lt;br/&gt;GPU Rendering · Performance First · Still Maturing"]
        D["Warp&lt;br/&gt;AI Native · Built-in Assistant · Multi-Model"]
    end
    A ---&gt;|"Upgrade"| B
    B ---&gt;|"Performance Focus"| C
    B ---&gt;|"AI Integration Focus"| D
    style A fill:#e0e0e0,color:#666
    style B fill:#4CAF50,color:#fff
    style C fill:#2196F3,color:#fff
    style D fill:#FF9800,color:#fff
</code></pre>

<h2 id="terminalapp-it-works-but-dont-push-it">Terminal.app: It Works, But Don’t Push It</h2>

<p>macOS’s built-in Terminal.app is like the Notes app on your phone — technically capable of everything, but not something you’d use for serious work.</p>

<p>The biggest dealbreaker is <strong>no Shift+Enter support</strong>. When running Claude Code, multi-line input is essential, but Terminal.app can’t distinguish Shift+Enter from Enter due to underlying <a href="https://blog.fsck.com/releases/2026/02/26/terminal-keyboard-protocol/">VT terminal protocol limitations</a> (a gap that dates back to 1978). You can work around it with Option+Enter, but that requires manual keyboard configuration. On top of that, there are no desktop notifications, emoji rendering has character overlap issues, and TUI rendering is rough. The official Claude Code <a href="https://docs.anthropic.com/en/docs/claude-code/terminal-setup">terminal setup guide</a> also acknowledges these limitations.</p>

<p><strong>Bottom line: Fine for occasional use. Not recommended as your daily driver for AI agents.</strong></p>

<h2 id="iterm2-the-veterans-edge">iTerm2: The Veteran’s Edge</h2>

<p>iTerm2 is the terminal I’ve used the longest, and I’ll admit there’s some sentimental attachment. For AI coding specifically, it has one killer feature that nobody else offers: <strong>alternate screen scrollback</strong>.</p>

<p>Here’s what that means. Claude Code takes over the entire terminal screen when it runs (alternate screen mode). Most terminals don’t let you scroll back through history in this mode. But iTerm2 has a “Save lines to scrollback in alternate screen mode” option. Enable it, and you can scroll up through previous AI output at any time. When a long conversation produces hundreds of lines of code changes, this feature is a lifesaver.</p>

<p>That said, I have to be honest — <strong>I did experience terminal lag and scroll flickering when running Claude Code on iTerm2 before.</strong> Especially when the AI was dumping large blocks of output, there would be noticeable delays. I’m not sure whether iTerm2 fixed this or Claude Code optimized on their end, but going back to test it now, things are noticeably better than before.</p>

<p>iTerm2 also has a <strong>split panes</strong> advantage. One of my go-to workflows is running Claude Code on the left generating code while Codex reviews on the right. iTerm2’s split panes combined with tmux work beautifully. If you want to try this kind of <a href="https://iterm2.com/documentation-tmux-integration.html">parallel workflow</a>, iTerm2’s tmux integration is currently the best in class.</p>

<p><strong>Best for: Users who prefer traditional terminal workflows, need robust scrollback, and do multi-window parallel development.</strong></p>

<h2 id="ghostty-performance-beast-still-being-polished">Ghostty: Performance Beast, Still Being Polished</h2>

<p>I switched to Ghostty after hearing it was better adapted for AI tools. After several months of use, here’s the honest take: <strong>the performance advantage isn’t particularly noticeable in day-to-day use.</strong> Ghostty’s official claim is <a href="https://ghostty.org/docs/about">2ms key-to-screen latency</a> (vs. ~12ms for iTerm2), but human eyes simply can’t tell the difference.</p>

<p>What actually sold me on Ghostty is that the <strong>lag and scroll flickering I experienced on iTerm2 never occurred on Ghostty.</strong> Whether that’s because Ghostty’s GPU rendering (Metal-based) is genuinely more robust, or because I happened to benefit from Claude Code’s own optimizations, the experience does feel smoother.</p>

<p>But there’s one issue I have to flag: <strong>when doing SSH remote development, if the session disconnects and reconnects, the terminal enters a broken state</strong> — mouse clicks produce garbage characters, and you have to run <code class="language-plaintext highlighter-rouge">reset</code> to recover. This is pretty annoying when running AI agents on remote machines for extended periods.</p>

<p>Also worth noting: Ghostty had a <a href="https://github.com/ghostty-org/ghostty/issues/10289">severe memory leak issue</a> reported previously — opening multiple Claude Code windows could cause memory usage to balloon past 70GB. The good news is this was fixed in <a href="https://ghostty.org/docs/install/release-notes/1-3-0">v1.3</a>, so if you’re on an older version, update immediately.</p>

<p>Ghostty also has some known compatibility quirks, such as <a href="https://github.com/anthropics/claude-code/issues/32087">Ctrl+A/E readline shortcuts</a> not working in Claude Code (because Ghostty uses the Kitty keyboard protocol), and the <a href="https://github.com/anthropics/claude-code/issues/18480">numpad Enter key</a> producing strange characters. But these are the kind of things you learn to work around after encountering them once.</p>

<p><strong>Best for: Users who want smooth rendering, can’t stand terminal lag, and don’t mind the occasional rough edge.</strong></p>

<h2 id="warp-ai-native-but-a-bit-awkward-for-ai-agents">Warp: AI-Native, But a Bit Awkward for AI Agents</h2>

<p>Warp is the most distinctive of the four — it’s not a traditional terminal with AI bolted on; it was <strong>designed from the ground up with AI as a first-class priority.</strong> The built-in AI assistant is genuinely useful, especially when you can’t remember command flags. Just describe what you want in natural language — way faster than digging through man pages.</p>

<p>But one thing that puzzles me: <strong>the transition between Warp’s own AI agent mode and normal command mode isn’t particularly smooth.</strong> When you’re in the middle of an AI conversation in Warp and want to switch back to normal terminal operation, or vice versa, there’s always a brief moment of confusion — who exactly am I talking to right now?</p>

<p>Running Claude Code in Warp also has compatibility issues. Warp’s block-based UI and Claude Code’s TUI occasionally conflict: community members have reported that long, high-load sessions cause <a href="https://github.com/warpdotdev/Warp/issues/8805">Warp to completely freeze</a>, and some have even hit <a href="https://github.com/warpdotdev/Warp/issues/8756">Rust-level crashes</a>. On the positive side, Warp offers an <a href="https://github.com/warpdotdev/claude-code-warp">official Claude Code integration package</a>, showing they’re actively working on these problems.</p>

<p><strong>Best for: Users who frequently need AI help recalling command syntax and want an “out-of-the-box” AI experience. Not ideal for heavy, sustained Claude Code usage.</strong></p>

<h2 id="comparison-at-a-glance">Comparison at a Glance</h2>

<table>
  <thead>
    <tr>
      <th>Dimension</th>
      <th>Terminal.app</th>
      <th>iTerm2</th>
      <th>Ghostty</th>
      <th>Warp</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Shift+Enter</td>
      <td>Not supported</td>
      <td>Native support</td>
      <td>Native support</td>
      <td><a href="https://github.com/warpdotdev/Warp/issues/6401">Requires config</a></td>
    </tr>
    <tr>
      <td>Desktop Notifications</td>
      <td>Not supported</td>
      <td>Manual setup needed</td>
      <td>Native support</td>
      <td>Supported</td>
    </tr>
    <tr>
      <td>Emoji Rendering</td>
      <td>Overlap issues</td>
      <td>Excellent</td>
      <td>Best (Unicode 17)</td>
      <td>Good</td>
    </tr>
    <tr>
      <td>Long AI Session Stability</td>
      <td>Fair</td>
      <td>Occasional lag</td>
      <td>Stable</td>
      <td><a href="https://github.com/warpdotdev/Warp/issues/8805">Occasional freezes</a></td>
    </tr>
    <tr>
      <td>Built-in AI</td>
      <td>None</td>
      <td><a href="https://iterm2.com/ai-plugin.html">Optional plugin</a></td>
      <td>None</td>
      <td>Rich (Oz multi-model)</td>
    </tr>
    <tr>
      <td>Scrollback in Alt Screen</td>
      <td>Not supported</td>
      <td>Supported (unique advantage)</td>
      <td>Not supported</td>
      <td>Per-block viewing</td>
    </tr>
    <tr>
      <td>Open Source</td>
      <td>No</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>No (login required)</td>
    </tr>
  </tbody>
</table>

<h2 id="my-setup">My Setup</h2>

<p>Right now I’m running <strong>Ghostty as my primary terminal, with Warp as a secondary.</strong> Daily Claude Code and Codex sessions go through Ghostty — stable and fast. When I occasionally need AI help with complex system commands, I switch to Warp where the built-in AI assistant is more convenient.</p>

<p>But that’s just my workflow. If you value being able to scroll back through AI output history, iTerm2 might suit you better. If you just want to install a terminal and start working without any configuration, Warp’s out-of-the-box experience is genuinely the best.</p>

<p>Terminals are like the editor wars — <strong>the one that feels right is the right one.</strong> Picking a terminal that makes communication between you and your AI agent as smooth as possible matters more than obsessing over benchmarks. If you’ve had a different experience or found a better combination, I’d love to hear about it in the comments.</p>

<blockquote>
  <p>This article is based on the latest versions of each terminal as of April 2026. Terminal apps update frequently, and some issues mentioned may already be fixed in newer releases. If you’re also tuning your AI coding workflow, you might want to check out my earlier post <a href="/en/tech-sharing/ai-programming/2025/09/05/ai-programming-workflow.html">From One Week to Half a Day: A Deep Dive into AI Programming Workflows</a>.</p>
</blockquote>]]></content><author><name>Woody Wang</name></author><category term="tech-sharing" /><category term="Terminal" /><category term="Claude Code" /><category term="Codex" /><category term="Ghostty" /><category term="iTerm2" /><category term="Warp" /><category term="AI Coding" /><category term="Dev Tools" /><summary type="html"><![CDATA[From the perspective of a long-time iTerm2 user, I compare Terminal.app, iTerm2, Ghostty, and Warp — testing how each performs with AI coding agents like Claude Code and Codex in real-world use.]]></summary></entry><entry xml:lang="en"><title type="html">Went to Volunteer at a Nursing Home, Ended Up Making Two Friends</title><link href="https://blog.brainsandbox.com/en/life/2026/04/04/volunteering-at-sree-narayana-mission.html" rel="alternate" type="text/html" title="Went to Volunteer at a Nursing Home, Ended Up Making Two Friends" /><published>2026-04-04T14:00:00+00:00</published><updated>2026-04-04T14:00:00+00:00</updated><id>https://blog.brainsandbox.com/life/2026/04/04/volunteering-at-sree-narayana-mission-en</id><content type="html" xml:base="https://blog.brainsandbox.com/life/2026/04/04/volunteering-at-sree-narayana-mission.html"><![CDATA[<p>Yesterday I went to Sree Narayana Mission, a nursing home in Yishun, to volunteer. Calling it “volunteering” feels a bit generous, though — I spent most of the morning sitting off to the side doing AWS exam practice questions. I barely did any actual volunteering.</p>

<h2 id="twenty-volunteers-for-five-residents">Twenty Volunteers for Five Residents</h2>

<p>Some background first. A friend had mentioned this place to me before — it’s right near Yishun MRT, about a four-to-five minute walk. He said it’s mostly just chatting with the elderly, playing small games, that sort of thing. Sounded good, so I signed up for a Saturday session.</p>

<p>When I got there, reality hit: over twenty volunteers had shown up. There were only five or six elderly residents.</p>

<p>I stood at the entrance for a moment, thinking the ratio was absurd. The space itself wasn’t large — just three long tables. One had UNO going, another had Jenga, and the third had… how do I describe it… magnetic fishing. You know, the kids’ toy where little plastic fish open and close their mouths and you try to catch them with a tiny magnetic rod. I watched for a while and honestly felt a bit awkward — not because of the residents, but because the game itself was mind-numbingly boring. The elderly didn’t seem particularly into it either, but there was a ring of volunteers around them clapping and cheering. The whole scene was a bit surreal.</p>

<p>(Side note: I later learned that the game supplies are the same every time. They just rotate through the same handful of activities.)</p>

<h2 id="the-people-in-the-hallway">The People in the Hallway</h2>

<p>With nothing to do in the activity room, I stepped outside for a walk around.</p>

<p>That changed my mood. In the hallways, quite a few elderly residents sat quietly — mostly Chinese residents, not talking. Some were on IV drips, with caregivers wheeling the stands past them. Many of the caregivers were Indian, and the residents spoke Hokkien or Mandarin while the caregivers spoke English or Tamil. Basically everyone was in their own world, minimal interaction. One elderly person smiled at me. I didn’t know what to say, so I smiled back and kept walking.</p>

<p>In any case, that walk around the hallways hit harder than watching people fish for plastic fish.</p>

<h2 id="meeting-two-people">Meeting Two People</h2>

<p>The morning passed like that. After lunch, the elderly had mostly gone back to their rooms, and the twenty-odd volunteers were left standing around with nothing to do.</p>

<p>That’s when I noticed the two guys next to me were also just standing there. We started chatting and discovered they were first-timers too. Both worked in commodities trading — one in iron ore, the other in agricultural futures. The kind of people I’d never cross paths with in my normal life.</p>

<p>Once we got going, we couldn’t stop. From about 1 PM to past 4 PM, we talked about everything: our industries, families, the various pitfalls of getting kids into school in Singapore, PR applications — that last topic alone was an endless rabbit hole, with everyone having a pile of stories. It’s funny, really. Everyone’s anxieties are basically the same — immigration status, children’s education, career development — just replayed in different industries.</p>

<p>When we left, we exchanged WhatsApp and WeChat contacts. The plan is to coordinate before the next session instead of each signing up separately and bumping into each other by chance.</p>

<h2 id="everyones-here-to-log-hours">Everyone’s Here to Log Hours</h2>

<p>Let’s address the elephant in the room. Most people who volunteer here have more or less the same motivation — apparently community service hours can help boost your PR application score, and a single day here counts as seven hours. Great ROI. That’s how you end up with twenty-plus volunteers competing to play Jenga with five elderly residents.</p>

<p>I had the same consideration. No point pretending otherwise. But the way I see it, even if everyone’s here to log hours, people did show up. The elderly did have company today, awkward as the experience might have been.</p>

<p>The real value of this kind of volunteering might not be what you do for the residents, but the people you meet who you’d never encounter otherwise. Everyone shows up for roughly the same reason, and somehow, genuine conversations happen.</p>

<p>I’ll probably go again. We’ve already made plans, after all.</p>]]></content><author><name>Woody Wang</name></author><category term="life" /><category term="Singapore" /><category term="Volunteering" /><category term="PR" /><category term="Life" /><summary type="html"><![CDATA[A day volunteering at Sree Narayana Mission nursing home in Yishun, Singapore — where over twenty volunteers showed up for five elderly residents, I spent most of the time studying for my AWS exam, and unexpectedly met two people I really clicked with.]]></summary></entry><entry xml:lang="en"><title type="html">x402 Protocol Core Flow Explained: A Step-by-Step Guide for Developers</title><link href="https://blog.brainsandbox.com/en/tech/blockchain/2025/10/31/x402-protocol-guide.html" rel="alternate" type="text/html" title="x402 Protocol Core Flow Explained: A Step-by-Step Guide for Developers" /><published>2025-10-31T00:00:00+00:00</published><updated>2025-10-31T00:00:00+00:00</updated><id>https://blog.brainsandbox.com/tech/blockchain/2025/10/31/x402-protocol-guide-en</id><content type="html" xml:base="https://blog.brainsandbox.com/tech/blockchain/2025/10/31/x402-protocol-guide.html"><![CDATA[<h2 id="1-introduction-why-x402-matters">1. Introduction: Why x402 Matters</h2>

<p>On today’s internet, making payments — especially micropayments or automated payments driven by AI agents — is riddled with friction. Traditional payment methods are expensive, slow to settle, and burdened with complex flows that require account registration, credit card binding, and manual authorization. This has become a massive obstacle to the growth of the AI-driven automated economy.</p>

<p>x402 was created to solve these pain points. You might think x402 sounds like the most boring technology you’ll ever encounter, but the possibilities it unlocks are where things get truly exciting. It cleverly revives the long-reserved, nearly forgotten <code class="language-plaintext highlighter-rouge">402 Payment Required</code> status code from the 1997 HTTP/1.1 specification. This isn’t an entirely new idea — industry pioneers like Marc Andreessen and Brian Armstrong have tried to build native payments into the internet’s foundation layer — but only now have the enabling technologies (like stablecoins) and the demand (like AI agents) truly matured. At its core, x402 is “an open standard for internet native payments.” It aims to make money flow as seamlessly, instantly, and cheaply as data does. This guide breaks down x402’s core payment flow step by step, giving you a clear and solid technical understanding.</p>

<p>Before diving into the specific steps, let’s meet the four key participants in the x402 ecosystem.</p>

<h2 id="2-core-concepts-the-four-key-roles">2. Core Concepts: The Four Key Roles</h2>

<p>A complete x402 payment interaction involves four core entities working together, each playing an indispensable role.</p>

<p><strong>Client</strong>: An entity wanting to pay for a resource — for example, an AI agent or a web application.</p>

<p><strong>Resource Server</strong>: An HTTP server that provides protected resources (such as APIs, web content, or files) and requires payment before granting access.</p>

<p><strong>Facilitator Server</strong>: A third-party service that helps resource servers verify and settle on-chain payments, dramatically simplifying server-side integration by eliminating the need to interact directly with blockchain nodes or wallets.</p>

<p><strong>Blockchain</strong>: The ultimate trust ledger, responsible for recording and confirming payment transactions, ensuring immutability and finality.</p>

<p>Now that we know the cast, let’s walk through a complete request lifecycle and see how these roles interact step by step to complete a payment.</p>

<h2 id="3-the-core-payment-flow-a-complete-x402-interaction-12-steps">3. The Core Payment Flow: A Complete x402 Interaction (12 Steps)</h2>

<p>The entire payment flow is carefully designed as a series of standard HTTP interactions, ensuring universality and ease of integration. Notably, if the client has already cached the resource’s payment requirements, steps 1 and 2 are optional, which can further improve efficiency.</p>

<p>Here is the full 12-step breakdown:</p>

<ol>
  <li><strong>Client → Resource Server: Initial Request</strong> The client (e.g., an AI agent) sends a standard HTTP GET request to the resource server’s protected endpoint (e.g., /api), hoping to retrieve a resource.</li>
  <li><strong>Resource Server → Client: 402 Payment Required Response</strong> The resource server detects that the request contains no valid payment information and rejects it. It returns a <code class="language-plaintext highlighter-rouge">402 Payment Required</code> status code with a JSON body detailing the accepted payment methods, amounts, and receiving addresses.</li>
  <li><strong>Client: Creates Payment Payload</strong> The client parses the server’s payment requirements, selects a payment method it supports, and constructs a payment payload containing signed authorization and other details.</li>
  <li><strong>Client → Resource Server: Retry with Payment</strong> The client sends another request to the same resource endpoint. This time, it includes the payment payload from the previous step via a custom <code class="language-plaintext highlighter-rouge">X-PAYMENT</code> HTTP header.</li>
  <li><strong>Resource Server → Facilitator: Request Payment Verification</strong> The resource server doesn’t handle complex on-chain verification itself. It forwards the client’s payment payload along with its own payment requirements to the facilitator server’s <code class="language-plaintext highlighter-rouge">/verify</code> endpoint.</li>
  <li><strong>Facilitator → Resource Server: Verification Result</strong> The facilitator server performs cryptographic verification of the payment payload based on the specified scheme and network, then returns the result (valid or invalid) to the resource server.</li>
  <li><strong>Resource Server: Processes the Valid Request</strong> If verification passes, the resource server begins executing the core work for the request (e.g., querying a database, generating a report). If verification fails, it returns a 402 error and the flow terminates.</li>
  <li><strong>Resource Server → Facilitator: Request Payment Settlement</strong> After preparing the final response data, the resource server sends a request to the facilitator server’s <code class="language-plaintext highlighter-rouge">/settle</code> endpoint, asking it to actually settle the verified payment on the blockchain.</li>
  <li><strong>Facilitator → Blockchain: Submit Transaction</strong> The facilitator server broadcasts the payment transaction to the appropriate blockchain network (e.g., submitting a USDC transfer to a smart contract).</li>
  <li><strong>Blockchain: Confirms the Transaction</strong> The blockchain network processes the transaction and, once confirmed, records it on-chain, completing the final transfer of funds.</li>
  <li><strong>Facilitator → Resource Server: Settlement Confirmation</strong> The facilitator server waits for blockchain confirmation. Once complete, it returns a success response to the resource server containing the transaction hash (txHash) and other details.</li>
  <li><strong>Resource Server → Client: Returns the Resource</strong> Upon receiving the settlement confirmation, the resource server returns a <code class="language-plaintext highlighter-rouge">200 OK</code> response to the client. The response body contains the originally requested resource, while the <code class="language-plaintext highlighter-rouge">X-PAYMENT-RESPONSE</code> header carries settlement details (such as the transaction hash), closing the payment loop.</li>
</ol>

<p>Now that you understand the complete interaction flow, let’s take a closer look at the key data structures passed during these steps — the payment requirements and the payment payload.</p>

<h2 id="4-key-data-structures">4. Key Data Structures</h2>

<p>Information exchange in the x402 protocol relies on two core JSON data structures.</p>

<h3 id="1-the-402-response-body-payment-required-response">1. The 402 Response Body: Payment Required Response</h3>

<p>When the server returns a 402 status code, the response body contains a JSON object that tells the client how to pay.</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"x402Version"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
  </span><span class="nl">"accepts"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="p">{</span><span class="w">
      </span><span class="nl">"scheme"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"network"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"maxAmountRequired"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"resource"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"mimeType"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"outputSchema"</span><span class="p">:</span><span class="w"> </span><span class="p">{},</span><span class="w">
      </span><span class="nl">"payTo"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"maxTimeoutSeconds"</span><span class="p">:</span><span class="w"> </span><span class="mi">60</span><span class="p">,</span><span class="w">
      </span><span class="nl">"asset"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"extra"</span><span class="p">:</span><span class="w"> </span><span class="p">{}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">],</span><span class="w">
  </span><span class="nl">"error"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>The table below explains the most important fields:</p>

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>accepts</td>
      <td>A list of payment requirements. The server can accept payment across multiple chains or tokens simultaneously, and the client can choose one.</td>
    </tr>
    <tr>
      <td>maxAmountRequired</td>
      <td>The maximum amount required to access the resource, expressed in the asset’s atomic units. This is the most critical piece of information for the client when constructing its payment payload.</td>
    </tr>
    <tr>
      <td>payTo</td>
      <td>The wallet address that will receive the payment. This is where the resource provider ultimately receives their funds.</td>
    </tr>
    <tr>
      <td>asset</td>
      <td>The contract address of the payment asset. For example, on EVM chains this is typically the contract address of an ERC20 token like USDC.</td>
    </tr>
  </tbody>
</table>

<h3 id="2-the-x-payment-request-header-payment-payload">2. The X-PAYMENT Request Header: Payment Payload</h3>

<p>The X-PAYMENT custom HTTP header carries the payment information. Its value is the Payment Payload JSON object, which has been encoded into a Base64 string.</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"x402Version"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
  </span><span class="nl">"scheme"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"network"</span><span class="p">:</span><span class="w"> </span><span class="s2">"string"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"payload"</span><span class="p">:</span><span class="w"> </span><span class="s2">"&lt;scheme dependent&gt;"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<ul>
  <li><strong>scheme</strong>: Defines the payment logic, which is what makes x402 so flexible. For example, the <code class="language-plaintext highlighter-rouge">exact</code> scheme is used for one-time, exact-amount payments (like paying $0.25 to read a news article), while a theoretical <code class="language-plaintext highlighter-rouge">upto</code> scheme could support dynamic, usage-based pricing (like paying based on the number of tokens an LLM generates).</li>
  <li><strong>network</strong>: Specifies which blockchain the payment will be executed on. The combination of scheme and network together determines the specific implementation for payment verification and settlement.</li>
</ul>

<p>With these technical details covered, let’s look at what x402 actually means for developers and the future of internet applications.</p>

<h2 id="5-what-this-means-for-developers-core-advantages-unlocked-by-x402">5. What This Means for Developers: Core Advantages Unlocked by x402</h2>

<p>x402 isn’t just a technical specification — it gives developers powerful capabilities for building next-generation internet applications, especially AI applications.</p>

<ul>
  <li><strong>Dramatically Simplified Integration</strong> Developers can add payment functionality to their services with minimal effort. In the simplest case, a single line of middleware configuration is all it takes to start accepting digital dollar payments. This is possible because the protocol abstracts away complex blockchain interactions — issues like gas fees and RPC node management are all handled by the facilitator server.</li>
  <li><strong>Enabling AI Agents and Micropayments</strong> Traditional payment systems, with their high fixed fees and friction, make sub-dollar microtransactions virtually impossible. With its low cost and instant settlement, x402 makes it practical for AI agents to autonomously pay for API calls (e.g., a few cents per request) or for users to pay per article. This unlocks entirely new business models, letting us move beyond rigid subscription plans toward truly granular, pay-per-use content and API consumption.</li>
  <li><strong>An Open and Neutral Standard</strong> x402 is an open protocol, agnostic to chains and tokens, with no dependency on any single centralized provider. Developers can freely choose the blockchain and assets that best fit their business, avoiding platform lock-in and ensuring long-term flexibility and security.</li>
</ul>

<h2 id="6-summary-and-next-steps">6. Summary and Next Steps</h2>

<p>x402 is an open protocol built on top of HTTP, purpose-designed for AI and machine-native payments. By reviving the long-dormant 402 status code, it creates a unified, frictionless value layer for the internet. This isn’t just a technical upgrade — it’s about the shape of the future internet economy. According to A16Z, by 2030, agentic commerce could create a payment market worth up to $30 trillion. x402 is the infrastructure being built to meet that future.</p>

<p>Through this guide, you’ve gained a solid understanding of x402’s core interaction flow and key concepts. Now is the perfect time to start building. We encourage you to visit the official resources, explore sample code and deeper technical specifications, and begin your journey into internet-native payments.</p>

<ul>
  <li>Official documentation and whitepaper: <a href="https://x402.org">x402.org</a></li>
  <li>Open-source code and specification: <a href="https://github.com/coinbase/x402">GitHub - coinbase/x402</a></li>
</ul>]]></content><author><name>Woody Wang</name></author><category term="tech" /><category term="blockchain" /><category term="ai" /><category term="x402" /><summary type="html"><![CDATA[A detailed walkthrough of the x402 protocol's 12-step payment flow, four key roles, and core data structures — helping developers understand the HTTP 402-based internet-native payment standard.]]></summary></entry><entry xml:lang="en"><title type="html">Tempted by 128GB RAM: The AMD AI Max+ 395 as a New Contender for Local LLM Inference</title><link href="https://blog.brainsandbox.com/en/hardware/2025/09/20/amd-ai-max-395-mini-pc-experience.html" rel="alternate" type="text/html" title="Tempted by 128GB RAM: The AMD AI Max+ 395 as a New Contender for Local LLM Inference" /><published>2025-09-20T07:39:00+00:00</published><updated>2025-09-20T07:39:00+00:00</updated><id>https://blog.brainsandbox.com/hardware/2025/09/20/amd-ai-max-395-mini-pc-experience-en</id><content type="html" xml:base="https://blog.brainsandbox.com/hardware/2025/09/20/amd-ai-max-395-mini-pc-experience.html"><![CDATA[<p>A few days ago, while scrolling through Twitter, I stumbled upon someone sharing AMD’s new AI Max+ 395 chip. Apparently it supports up to 128GB of memory, and several mini PC manufacturers have already shipped products based on it. As someone who regularly tinkers with local LLM inference, this immediately caught my attention. With today’s large language models routinely requiring tens or even hundreds of gigabytes, memory has always been the painful bottleneck.</p>

<h2 id="a-first-taste-of-unified-memory-architecture-on-pc">A First Taste of Unified Memory Architecture on PC</h2>

<p>When you hear “unified memory architecture,” Apple’s M-series chips probably come to mind first. Since the M1, Apple has been touting the advantages of having the CPU and GPU share a single memory pool — no more shuttling data back and forth. Having used an M1 MacBook myself, I can confirm the smoothness and battery life gains are real.</p>

<p>What I didn’t expect was AMD pulling the same move with the AI Max+ 395. This chip packs 16 Zen 5 CPU cores, 40 RDNA 3.5 GPU compute units, and a 50 TOPS XDNA 2 NPU. But the real showstopper? It supports up to 128GB of quad-channel LPDDR5X-8000 memory, with a whopping 96GB available as VRAM.</p>

<p>This reminds me of my days running an AMD R3900 desktop. AMD’s multi-core performance has always been solid, but back then you still needed a discrete GPU. And AMD’s high-performance APU lineup was always pretty conservative — mostly entry-level stuff. It looks like they’ve finally figured out the high-end APU game.</p>

<h2 id="the-golden-age-of-mini-pcs">The Golden Age of Mini PCs</h2>

<p>I went on a shopping spree (window shopping, at least) and found several manufacturers already shipping AI Max+ 395-based mini PCs. Here are the standouts:</p>

<h3 id="gmktec-evo-x2">GMKtec EVO-X2</h3>
<ul>
  <li>Price: Around ¥14,999 (~$2,050 USD)</li>
  <li>Memory: 64GB or 128GB LPDDR5X-8000 options</li>
  <li>Storage: 1TB or 2TB PCIe 4.0 SSD</li>
  <li>Marketing claim: “World’s first Windows 11 AI+ PC capable of running 70B models” — sounds impressive</li>
</ul>

<h3 id="beelink-gtr9-pro">Beelink GTR9 Pro</h3>
<ul>
  <li>Price: Around ¥12,999 (~$1,799 USD)</li>
  <li>Memory: Maxed out at 128GB</li>
  <li>Marketing claim: Can run DeepSeek 70B locally</li>
  <li>AI performance: 126 TOPS — a compelling number</li>
</ul>

<h3 id="minisforum-ms-s1-max">Minisforum MS-S1 MAX</h3>
<ul>
  <li>TDP: Supports 160W (more headroom than competitors’ 120-140W)</li>
  <li>Form factor: 2U rackmount design with PCIe x16 expansion slot — solid expandability</li>
  <li>Connectivity: Among the first devices worldwide to support USB4 V2 (80Gbps)</li>
</ul>

<pre><code class="language-mermaid">graph TD
    A[AMD AI Max+ 395] --&gt; B[16-Core Zen 5 CPU]
    A --&gt; C[40CU RDNA 3.5 GPU]
    A --&gt; D[50 TOPS NPU]
    A --&gt; E[128GB Unified Memory]

    E --&gt; F[CPU Compute]
    E --&gt; G[GPU Rendering / AI Inference]
    E --&gt; H[NPU AI Acceleration]

    style A fill:#ff6b6b
    style E fill:#4ecdc4
</code></pre>

<h2 id="the-value-showdown-against-mac-studio">The Value Showdown Against Mac Studio</h2>

<p>When it comes to local LLM inference, Apple’s Mac Studio is the elephant in the room. The top-spec M3 Ultra version can be configured with up to 512GB of unified memory, making it a beast for running the largest models.</p>

<p>But then you look at the price, and your wallet starts weeping. A 512GB Mac Studio M3 Ultra runs over ¥70,000. Compare that to an AMD AI Max+ 395 mini PC at ¥10,000-20,000, and the price gap is staggering.</p>

<p>Let’s break it down:</p>

<p><strong>Mac Studio M3 Ultra strengths:</strong></p>
<ul>
  <li>Absurdly large memory ceiling (up to 512GB)</li>
  <li>Mature ecosystem with deep optimizations</li>
  <li>Best-in-class power efficiency (under 200W running DeepSeek R1)</li>
  <li>800GB/s memory bandwidth — blazing fast</li>
</ul>

<p><strong>AMD AI Max+ 395 strengths:</strong></p>
<ul>
  <li>Unbeatable price-to-performance ratio</li>
  <li>Better Windows ecosystem compatibility</li>
  <li>More upgrade flexibility (some models allow user-replaceable memory and storage)</li>
  <li>Crushes Intel’s offerings in AI workloads (up to 12x faster on certain models!)</li>
</ul>

<h2 id="what-the-community-is-saying">What the Community Is Saying</h2>

<p>I spent some time lurking on Reddit and V2EX to see what people actually think. The discussions tend to cluster around a few themes:</p>

<p><strong>The enthusiastic crowd:</strong></p>
<ul>
  <li>“Finally, I can run 70B models locally without selling a kidney!”</li>
  <li>“This is the first time unified memory architecture has shipped at scale on PC — AMD is killing it!”</li>
  <li>“Compared to paying for cloud API inference, local deployment is both more private and cheaper. No-brainer.”</li>
</ul>

<p><strong>The skeptics:</strong></p>
<ul>
  <li>“What’s the actual inference speed with real-world models?”</li>
  <li>“Can the thermals and power delivery really handle sustained loads?”</li>
  <li>“Will the software ecosystem keep up?”</li>
</ul>

<p>On the Level1Techs forum, one user shared their experience with the GMKtec EVO-X2, reporting that they tested various LLMs using LM Studio and Ollama and were quite satisfied with the performance.</p>

<h2 id="a-new-era-for-local-ai-inference">A New Era for Local AI Inference</h2>

<p>From a technology perspective, the AMD AI Max+ 395 is genuinely a milestone. It proves that unified memory architecture isn’t Apple’s exclusive domain — the PC ecosystem can deliver equally impressive results.</p>

<p>For those of us running local LLM inference, this is fantastic news. While it may not match the absolute peak performance or memory capacity of a maxed-out Mac Studio, the value proposition and practicality are compelling enough.</p>

<p>This is especially significant for small businesses and individual developers. Spending ¥10,000-20,000 to deploy 70B models locally was unthinkable just a short while ago. No data privacy concerns, no agonizing over API token costs, and excellent performance for long-context workloads.</p>

<h2 id="my-decision-dilemma">My Decision Dilemma</h2>

<p>The choice in front of me is genuinely difficult:</p>

<ol>
  <li><strong>AMD AI Max+ 395 Mini PC</strong>: ¥10,000-20,000, incredible value, but a lower performance ceiling</li>
  <li><strong>Mac Studio M3 Ultra 512GB</strong>: Unmatched performance, but that ¥70,000+ price tag stings</li>
</ol>

<pre><code class="language-mermaid">flowchart TD
    A[My Needs Analysis] --&gt; B{Primary Use Case?}
    B --&gt;|7B-32B Models| C[Mostly Daily Use]
    B --&gt;|70B Models| D[Occasional Testing]

    C --&gt; E{Budget Considerations}
    D --&gt; E

    E --&gt;|¥10-20K| F[AMD AI Max+ 395&lt;br/&gt;Mini PC]
    E --&gt;|¥70K+| G[Mac Studio&lt;br/&gt;M3 Ultra 512GB]

    F --&gt; H[✅ Great Value&lt;br/&gt;✅ Sufficient&lt;br/&gt;❌ Lower Performance Ceiling]
    G --&gt; I[✅ Powerful Performance&lt;br/&gt;✅ Ample Memory&lt;br/&gt;❌ Painfully Expensive]

    H --&gt; J{¥50K Price Difference}
    I --&gt; J

    J --&gt; K[Could Buy Several&lt;br/&gt;Generations of New Hardware!]
    K --&gt; L[Leaning Toward&lt;br/&gt;AMD Option]

    style F fill:#e1f5fe
    style G fill:#fff3e0
    style L fill:#e8f5e8
</code></pre>

<p>After thinking it through, my daily workload mostly involves 7B to 32B models, with 70B being an occasional experiment. The AMD option should more than cover my needs. And that ¥50,000+ I’d save? That’s enough to upgrade hardware for several generations.</p>

<p>Looking back at my experience with the Mac M1 and AMD R3900, AMD’s performance has always been rock-solid, and their power efficiency has improved considerably. If the AI Max+ 395 strikes the right balance between performance and thermals, it’ll be a no-brainer.</p>

<h2 id="final-thoughts">Final Thoughts</h2>

<p>Technology keeps surprising us. A few years ago, who would have imagined casually running models with tens of billions of parameters on a desktop? The AMD AI Max+ 395 has truly brought local AI inference to the masses.</p>

<p>It may not be the absolute performance champion, but at this point in time, it’s a godsend for anyone who values bang for their buck. The true measure of technology isn’t just pushing boundaries — it’s making the benefits of progress accessible to everyone.</p>

<p>As for my final decision? I’ll probably wait a bit longer to see real-world user feedback and how the software ecosystem develops. After all, buying hardware isn’t just about specs — the overall experience is what matters most.</p>

<hr />

<p><em>What are your thoughts on local LLM inference? Or do you have experience with AMD AI Max+ 395-based products to share? Feel free to discuss in the comments.</em></p>]]></content><author><name>Woody Wang</name></author><category term="hardware" /><category term="AMD" /><category term="Mini PC" /><category term="LLM" /><category term="Local Inference" /><category term="Hardware Review" /><summary type="html"><![CDATA[An in-depth look at the AMD AI Max+ 395 chip and three mini PCs from GMKtec, Beelink, and Minisforum. Compared against the Mac Studio M3 Ultra, I evaluate whether 128GB of unified memory makes local LLM inference finally practical.]]></summary></entry><entry xml:lang="en"><title type="html">From One Week to Half a Day: A Deep Dive into AI-Powered Programming Workflows</title><link href="https://blog.brainsandbox.com/en/tech-sharing/ai-programming/2025/09/05/ai-programming-workflow.html" rel="alternate" type="text/html" title="From One Week to Half a Day: A Deep Dive into AI-Powered Programming Workflows" /><published>2025-09-05T17:14:01+00:00</published><updated>2025-09-05T17:14:01+00:00</updated><id>https://blog.brainsandbox.com/tech-sharing/ai-programming/2025/09/05/ai-programming-workflow-en</id><content type="html" xml:base="https://blog.brainsandbox.com/tech-sharing/ai-programming/2025/09/05/ai-programming-workflow.html"><![CDATA[<p>Hey there. I’m a full-stack developer who recently achieved a 10x productivity boost while building an EVM-based transaction signing review web app (React frontend + Solidity contracts) by systematically applying AI programming techniques. In this post, I’ll share the specific technical practices that made it happen, including tool configurations, real-world case studies, and reusable workflow templates.</p>

<hr />

<h2 id="development-environment-and-tech-stack">Development Environment and Tech Stack</h2>
<ul>
  <li><strong>Core Tools</strong>:
    <ul>
      <li>VSCode + Devcontainer (Docker-isolated environment)</li>
      <li>Claude Code plugin + OpusPlan mode</li>
      <li>Testing frameworks: Jest (frontend) + Hardhat (contracts)</li>
      <li>Version control: Git with Conventional Commits</li>
    </ul>
  </li>
  <li><strong>Hardware/Software Setup</strong>:</li>
</ul>

<p>OS: macOS / Docker Engine
VSCode Extensions:</p>
<ul>
  <li>Dev Containers</li>
  <li>
    <p>Claude Code</p>
  </li>
  <li><strong>Cost-Benefit Analysis</strong>:
    <ul>
      <li>Claude Max subscription ($100/month)</li>
      <li>Project timeline reduction: feature development from 7 person-days to 0.5 person-days</li>
      <li>Error rate reduction: 60% fewer production bugs</li>
    </ul>
  </li>
</ul>

<hr />

<h3 id="1-security-isolation-devcontainer-in-practice">1. Security Isolation: Devcontainer in Practice</h3>
<p><strong>The Problem</strong>:
While executing AI-generated on-chain operations, a <code class="language-plaintext highlighter-rouge">curl | bash</code> pipeline once polluted the workspace with temporary files.</p>

<p><strong>The Solution</strong>:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="err">//</span><span class="w"> </span><span class="err">devcontainer.json</span><span class="w"> </span><span class="err">key</span><span class="w"> </span><span class="err">configuration</span><span class="w">
</span><span class="p">{</span><span class="w">
  </span><span class="nl">"image"</span><span class="p">:</span><span class="w"> </span><span class="s2">"mcr.microsoft.com/devcontainers/javascript-node:18"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"features"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="nl">"ghcr.io/devcontainers/features/docker-in-docker:1"</span><span class="p">:</span><span class="w"> </span><span class="p">{}</span><span class="w">
  </span><span class="p">},</span><span class="w">
  </span><span class="nl">"remoteUser"</span><span class="p">:</span><span class="w"> </span><span class="s2">"node"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"workspaceMount"</span><span class="p">:</span><span class="w"> </span><span class="s2">"source=${localWorkspaceFolder},target=/workspace,type=bind"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"workspaceFolder"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/workspace"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p><strong>Security Comparison</strong>:</p>

<table>
  <thead>
    <tr>
      <th>Risk Type</th>
      <th>Bare Metal</th>
      <th>Devcontainer</th>
      <th>Protection</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Filesystem deletion</td>
      <td>High</td>
      <td>Zero risk</td>
      <td>Container isolation</td>
    </tr>
    <tr>
      <td>Dependency conflicts</td>
      <td>Medium</td>
      <td>Low</td>
      <td>Encapsulated deps</td>
    </tr>
    <tr>
      <td>Malicious package install</td>
      <td>High</td>
      <td>Medium</td>
      <td>Permission control</td>
    </tr>
  </tbody>
</table>

<p><strong>Pro Tip</strong>:
Use <code class="language-plaintext highlighter-rouge">docker run --rm -it -v $(pwd):/safe_workspace</code> to create a temporary sandbox for running high-risk AI commands.</p>

<hr />

<h3 id="2-plan-mode-from-requirements-to-architecture">2. Plan Mode: From Requirements to Architecture</h3>
<p><strong>EVM Signing Feature Development Example</strong>:</p>
<ol>
  <li><strong>Requirements Input</strong>:</li>
</ol>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/model OpusPlan
Implement EVM-compatible EIP-712 signature verification:
- Frontend: React form to collect signature parameters
- Contract: Solidity verifier with batch review support
- Type safety required (TypeScript)
</code></pre></div></div>

<ol>
  <li><strong>AI-Generated Design</strong>:</li>
</ol>

<pre><code class="language-mermaid">graph LR
A[Frontend Components] --&gt; B[Signing Service Layer]
B --&gt; C[Contract Interaction Layer]
C --&gt; D[Verification Contract]
D --&gt; E[Event Logs]
</code></pre>

<ol>
  <li><strong>Manual Refinements</strong>:
    <ul>
      <li>Issue: AI didn’t account for gas optimization</li>
      <li>Improvement: Added batch verification design pattern</li>
      <li>Result: 40% reduction in gas costs</li>
    </ul>
  </li>
</ol>

<p><strong>Design Review Checklist</strong>:</p>
<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Is the layered architecture clean?</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Is error handling comprehensive?</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Are cross-component dependencies decoupled?</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Has critical path performance been evaluated?</li>
</ul>

<hr />

<h3 id="3-tdd-driven-development-smart-contract-example">3. TDD-Driven Development: Smart Contract Example</h3>
<p><strong>Requirement</strong>: Implement a deposit contract with reentrancy attack protection</p>

<p><strong>TDD Workflow</strong>:</p>

<ol>
  <li>Write test cases first:</li>
</ol>

<div class="language-typescript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// test/Reentrancy.test.ts</span>
<span class="nx">describe</span><span class="p">(</span><span class="dl">"</span><span class="s2">Secure Withdrawal</span><span class="dl">"</span><span class="p">,</span> <span class="p">()</span> <span class="o">=&gt;</span> <span class="p">{</span>
  <span class="nx">it</span><span class="p">(</span><span class="dl">"</span><span class="s2">should block reentrancy attacks</span><span class="dl">"</span><span class="p">,</span> <span class="k">async</span> <span class="p">()</span> <span class="o">=&gt;</span> <span class="p">{</span>
    <span class="kd">const</span> <span class="nx">attacker</span> <span class="o">=</span> <span class="k">await</span> <span class="nx">deployAttackerContract</span><span class="p">();</span>
    <span class="k">await</span> <span class="nx">expect</span><span class="p">(</span><span class="nx">attacker</span><span class="p">.</span><span class="nx">attack</span><span class="p">())</span>
      <span class="p">.</span><span class="nx">to</span><span class="p">.</span><span class="nx">be</span><span class="p">.</span><span class="nx">revertedWith</span><span class="p">(</span><span class="dl">"</span><span class="s2">ReentrancyGuard: reentrant call</span><span class="dl">"</span><span class="p">);</span>
  <span class="p">});</span>

  <span class="nx">it</span><span class="p">(</span><span class="dl">"</span><span class="s2">should allow normal withdrawals</span><span class="dl">"</span><span class="p">,</span> <span class="k">async</span> <span class="p">()</span> <span class="o">=&gt;</span> <span class="p">{</span>
    <span class="k">await</span> <span class="nx">contract</span><span class="p">.</span><span class="nx">withdraw</span><span class="p">(</span><span class="nx">validAmount</span><span class="p">);</span>
    <span class="nx">expect</span><span class="p">(</span><span class="k">await</span> <span class="nx">balanceOf</span><span class="p">(</span><span class="nx">user</span><span class="p">)).</span><span class="nx">to</span><span class="p">.</span><span class="nx">equal</span><span class="p">(</span><span class="nx">initBalance</span> <span class="o">-</span> <span class="nx">validAmount</span><span class="p">);</span>
  <span class="p">});</span>
<span class="p">});</span>
</code></pre></div></div>

<ol>
  <li>AI generates the contract code:</li>
</ol>

<div class="language-solidity highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// contracts/SecureWithdraw.sol
</span><span class="k">import</span> <span class="s">"@openzeppelin/contracts/security/ReentrancyGuard.sol"</span><span class="p">;</span>

<span class="k">contract</span> <span class="n">SecureWithdraw</span> <span class="k">is</span> <span class="n">ReentrancyGuard</span> <span class="p">{</span>
  <span class="k">mapping</span><span class="p">(</span><span class="kt">address</span> <span class="o">=&gt;</span> <span class="kt">uint</span><span class="p">)</span> <span class="n">balances</span><span class="p">;</span>

  <span class="k">function</span> <span class="n">withdraw</span><span class="p">(</span><span class="kt">uint</span> <span class="n">amount</span><span class="p">)</span> <span class="k">external</span> <span class="n">nonReentrant</span> <span class="p">{</span>
    <span class="c1">// Validation logic
</span>    <span class="n">balances</span><span class="p">[</span><span class="n">msg</span><span class="p">.</span><span class="n">sender</span><span class="p">]</span> <span class="o">-=</span> <span class="n">amount</span><span class="p">;</span>
    <span class="p">(</span><span class="kt">bool</span> <span class="n">success</span><span class="p">,</span> <span class="p">)</span> <span class="o">=</span> <span class="n">msg</span><span class="p">.</span><span class="n">sender</span><span class="p">.</span><span class="nb">call</span><span class="p">{</span><span class="n">value</span><span class="o">:</span> <span class="n">amount</span><span class="p">}(</span><span class="s">""</span><span class="p">);</span>
    <span class="nb">require</span><span class="p">(</span><span class="n">success</span><span class="p">);</span>
  <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>

<ol>
  <li>Key improvements:
    <ul>
      <li>Added OpenZeppelin’s ReentrancyGuard</li>
      <li>Set withdrawal limits as a safety measure</li>
      <li>Gas optimization: 23,421 to 18,759</li>
    </ul>
  </li>
</ol>

<hr />

<h3 id="4-atomic-commit-discipline">4. Atomic Commit Discipline</h3>
<p><strong>Git Workflow Optimization</strong>:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Commit convention templates</span>
feat: add EIP-712 signature verification frontend component
fix: fix signature expiration <span class="nb">time </span>validation logic
refactor: optimize contract gas consumption structure
</code></pre></div></div>

<p><strong>Commit Strategy Comparison</strong>:</p>

<table>
  <thead>
    <tr>
      <th>Metric</th>
      <th>Traditional Commits</th>
      <th>Atomic Commits</th>
      <th>Improvement</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Rollback granularity</td>
      <td>Coarse (2h+)</td>
      <td>Fine (5min)</td>
      <td>90% risk reduction</td>
    </tr>
    <tr>
      <td>Commit message value</td>
      <td>Low</td>
      <td>High</td>
      <td>Strong traceability</td>
    </tr>
    <tr>
      <td>Conflict resolution</td>
      <td>Difficult</td>
      <td>Simple</td>
      <td>3x efficiency gain</td>
    </tr>
  </tbody>
</table>

<p><strong>Real-World Example</strong>:
When fixing a signature encoding bug, I used <code class="language-plaintext highlighter-rouge">git revert 4a3b2c1</code> to precisely roll back the problematic commit, saving 2 hours of development time.</p>

<hr />

<h3 id="productivity-analysis">Productivity Analysis</h3>
<p><strong>Time Distribution Comparison</strong>:</p>

<table>
  <thead>
    <tr>
      <th>Task Type</th>
      <th>Traditional</th>
      <th>AI-Assisted</th>
      <th>Improvement</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Basic component dev</td>
      <td>3h</td>
      <td>25min</td>
      <td>86%</td>
    </tr>
    <tr>
      <td>Contract logic impl</td>
      <td>4h</td>
      <td>30min</td>
      <td>87.5%</td>
    </tr>
    <tr>
      <td>Debugging and fixes</td>
      <td>2h</td>
      <td>20min</td>
      <td>83%</td>
    </tr>
  </tbody>
</table>

<p><strong>ROI Analysis</strong>:</p>
<ul>
  <li>Claude subscription cost: $100/month</li>
  <li>Time savings value: $1,500/month (at $50/hr)</li>
  <li><strong>ROI: 1,500%</strong></li>
</ul>

<hr />

<h3 id="conclusion-a-new-paradigm-for-human-ai-collaboration">Conclusion: A New Paradigm for Human-AI Collaboration</h3>
<p>Through the systematic application of:</p>
<ol>
  <li>Security-isolated containers</li>
  <li>Design-first planning</li>
  <li>Test-driven development</li>
  <li>Atomic commit discipline</li>
</ol>

<p>AI shifts the development focus from <strong>syntax implementation</strong> to <strong>architecture design</strong>, allowing developers to concentrate on value creation:</p>
<ul>
  <li>50% deeper requirements analysis</li>
  <li>70% fewer code quality defects</li>
  <li>2x increase in innovative solution output</li>
</ul>

<p>AI-powered programming is here to stay. Mastering the right collaboration methods is what makes the difference. I hope these practices bring meaningful improvements to your development workflow.</p>]]></content><author><name>Woody Wang</name></author><category term="tech-sharing" /><category term="ai-programming" /><category term="Claude Code" /><category term="TDD" /><category term="Devcontainer" /><category term="dev-tools" /><category term="lessons-learned" /><summary type="html"><![CDATA[A full-stack developer shares hands-on experience building an EVM transaction signing review app using Claude Code + Devcontainer + TDD, with concrete methods and tool configurations that delivered a 10x productivity boost.]]></summary></entry><entry xml:lang="en"><title type="html">The AI Coding Era Is Reshuffling the Programmer’s Core Skill Deck</title><link href="https://blog.brainsandbox.com/en/tech/2025/09/05/programmer-core-skills-in-ai-era.html" rel="alternate" type="text/html" title="The AI Coding Era Is Reshuffling the Programmer’s Core Skill Deck" /><published>2025-09-05T06:30:00+00:00</published><updated>2025-09-05T06:30:00+00:00</updated><id>https://blog.brainsandbox.com/tech/2025/09/05/programmer-core-skills-in-ai-era-en</id><content type="html" xml:base="https://blog.brainsandbox.com/tech/2025/09/05/programmer-core-skills-in-ai-era.html"><![CDATA[<p>I was chatting with a few friends recently, and we all shared the same feeling: the act of writing code has fundamentally changed.</p>

<p>From GitHub Copilot to Cursor to the Claude Code I’m using now, I’ve watched AI coding tools evolve at a breakneck pace. Honestly, I was a bit resistant at first – I kept thinking these tools would make me “lazy.” But after using them for a while, I realized the issue isn’t the tools themselves. It’s about how we redefine our own value.</p>

<h2 id="micro-level-gains-macro-level-concerns">Micro-Level Gains, Macro-Level Concerns</h2>

<p>As a security engineer, I review large volumes of code every day. The most obvious change over the past couple of years? <strong>Code quality at the micro level has become much more consistent.</strong></p>

<p>I used to see all kinds of sloppy practices: variable names chosen on a whim, inconsistent indentation, exception handling skipped wherever possible. Those basic issues are far less common now – AI is genuinely good at enforcing code conventions.</p>

<p>But new problems have emerged. The most typical one is <strong>overly defensive programming</strong>. I’ve seen plenty of AI-generated code that wraps everything in try-catch blocks, catching every conceivable exception. On the surface it looks “safe,” but in reality it buries the errors that actually matter.</p>

<pre><code class="language-mermaid">graph TD
    A[AI-Generated Code] --&gt; B{Exception Handling Strategy}
    B --&gt; C[Excessive try-catch]
    B --&gt; D[Reasonable Exception Handling]
    C --&gt; E[Masks Real Errors]
    C --&gt; F[Hard to Debug]
    D --&gt; G[Errors Surface Promptly]
    D --&gt; H[Easy to Debug]

    style C fill:#ffcccc
    style E fill:#ff9999
    style F fill:#ff9999
    style D fill:#ccffcc
    style G fill:#99ff99
    style H fill:#99ff99
</code></pre>

<p>Once, while debugging a production issue, I spent most of a day before discovering that a database connection failure had been silently swallowed. The error logs looked perfectly calm, while the business logic had gone completely off the rails. That kind of “thoughtful” exception handling is a debugging nightmare.</p>

<p>What’s even more concerning is the <strong>explosion in code production speed</strong>. What used to take a week to develop can now be done in half a day. Sounds great, right? The problem is that review can’t keep up. Human cognitive bandwidth hasn’t increased just because AI arrived – yet we’re expected to digest far more code in far less time.</p>

<h2 id="new-rules-for-the-interview-game">New Rules for the Interview Game</h2>

<p>Speaking of changes, the most interesting shift is in hiring.</p>

<p>Many companies are struggling with a question: how do you prevent candidates from “cheating” with AI during remote interviews? Some require dual-camera monitoring, others have scrapped online interviews entirely. It’s exhausting for everyone involved.</p>

<p>I think the premise is wrong. <strong>Instead of trying to ban AI, just tell candidates: you can use any AI tool you want.</strong></p>

<p>Being able to use AI effectively is a skill in itself – why fight it? The key is to change what you’re evaluating. Traditional algorithm puzzles and textbook trivia are easy for AI to “crack.” But if you ask a candidate to design a system architecture on the spot, or explain why they’d handle a specific business scenario a certain way – how much can AI really help with that?</p>

<pre><code class="language-mermaid">graph LR
    A[Traditional Interview] --&gt; B[Algorithm Problems]
    A --&gt; C[Textbook Trivia]
    A --&gt; D[Handwritten Code]

    E[AI-Era Interview] --&gt; F[System Design]
    E --&gt; G[Architectural Thinking]
    E --&gt; H[Problem-Solving Ability]
    E --&gt; I[AI Collaboration Skills]

    B --&gt; J[Easily Replaced by AI]
    C --&gt; J
    D --&gt; J

    F --&gt; K[Hard to Replace with AI]
    G --&gt; K
    H --&gt; K
    I --&gt; K

    style A fill:#ffeeee
    style E fill:#eeffee
    style J fill:#ffcccc
    style K fill:#ccffcc
</code></pre>

<p>This raises the bar for interviewers too. You can’t just memorize a few algorithm problems and call yourself qualified to interview. You need to genuinely understand the business, the architecture, and engineering practices to design questions with real differentiation.</p>

<h2 id="from-code-worker-to-ai-commander">From Code Worker to AI Commander</h2>

<p>So in the midst of all this change, what are a programmer’s actual core skills?</p>

<p>My answer: <strong>shift your focus from code details to learning how to direct AI.</strong></p>

<p>Think of AI as a highly capable programming assistant you’ve hired. It’s talented, but it needs clear instructions and ongoing guidance. Your value is no longer in writing every line of code yourself – it’s in:</p>

<h3 id="1-architectural-thinking">1. Architectural Thinking</h3>

<p>The work that used to be reserved for architects now needs to be understood by every engineer. You need to decompose complex business requirements into clean modules, design sensible interfaces, and plan extensible structures. AI can implement the details, but the architectural blueprint is still yours to draw.</p>

<h3 id="2-requirements-understanding-and-translation">2. Requirements Understanding and Translation</h3>

<p>AI struggles with the subtext behind business requirements. When a client says “I need a user management feature,” what specific scenarios does that cover? What are the edge cases? What security considerations are involved? A human has to sort through all of that and translate it into something actionable.</p>

<h3 id="3-quality-control-and-risk-identification">3. Quality Control and Risk Identification</h3>

<p>As I mentioned with the exception handling example, someone needs to review AI-generated code. Where are the potential pitfalls? Could there be performance issues? Are the security boundaries clear? This kind of judgment is something AI can’t replace.</p>

<h3 id="4-engineering-practices">4. Engineering Practices</h3>

<p>How should CI/CD be designed? What’s the testing strategy? How should code be organized? How do you optimize the deployment pipeline? These core software engineering skills haven’t diminished in importance – if anything, they’ve become more critical than ever.</p>

<h2 id="ai-is-a-stepping-stone-not-a-replacement">AI Is a Stepping Stone, Not a Replacement</h2>

<p>A lot of people worry that AI will make programmers obsolete. I don’t think that concern holds up.</p>

<p>Every major technological shift in history has triggered similar fears. From assembly to high-level languages, from command lines to IDEs, from manual deployments to automated operations – every time, someone predicted the end of programmers. What actually happened? The software industry kept booming, and demand for developers kept growing.</p>

<p>AI coding tools are fundamentally a <strong>productivity upgrade</strong>. They free us from low-value repetitive work and give us the opportunity to focus on more creative, more challenging problems.</p>

<pre><code class="language-mermaid">graph TD
    A[Programmer Skill Evolution] --&gt; B[Traditional Phase]
    A --&gt; C[AI Collaboration Phase]

    B --&gt; D[Handwrite All Code]
    B --&gt; E[Focus on Syntax Details]
    B --&gt; F[Lots of Repetitive Work]

    C --&gt; G[Design System Architecture]
    C --&gt; H[Control AI Output]
    C --&gt; I[Solve Complex Problems]
    C --&gt; J[Focus on Business Value]

    subgraph "Value Hierarchy"
        K[Low Value: Repetitive Coding]
        L[High Value: Creative Thinking]
    end

    D --&gt; K
    E --&gt; K
    F --&gt; K

    G --&gt; L
    H --&gt; L
    I --&gt; L
    J --&gt; L

    style B fill:#fff2cc
    style C fill:#d4edda
    style K fill:#f8d7da
    style L fill:#d4edda
</code></pre>

<p>When you no longer need to spend hours writing CRUD code, you finally have the bandwidth to think about system design, user experience, and business value. Isn’t that an upgrade for the profession?</p>

<h2 id="implications-for-companies">Implications for Companies</h2>

<p>Organizations need to adjust their hiring and talent development strategies too:</p>

<ol>
  <li>
    <p><strong>Update interview criteria</strong>: Stop testing whether candidates can hand-write quicksort. Evaluate whether they can design a sound system architecture.</p>
  </li>
  <li>
    <p><strong>Value soft skills</strong>: Communication, requirements comprehension, and cross-team collaboration are more important than ever in the AI era.</p>
  </li>
  <li>
    <p><strong>Invest in training</strong>: Help existing employees learn how to use AI tools effectively, rather than fearing them.</p>
  </li>
  <li>
    <p><strong>Calibrate expectations</strong>: Don’t assume AI means infinite development speed. Quality assurance still takes time.</p>
  </li>
</ol>

<h2 id="final-thoughts">Final Thoughts</h2>

<p>In the AI coding era, the programmer’s value hasn’t depreciated – it’s being redefined.</p>

<p>We’re evolving from “code producers” to “software product architects,” from “feature implementers” to “problem solvers.” This transition requires proactive learning and active adaptation, but it also presents unprecedented opportunities.</p>

<p>Embrace the change. In this era, the biggest risk isn’t being replaced by AI – it’s refusing to learn how to work alongside it.</p>

<p>After all, the people who truly know how to harness AI are the ones who’ll be writing the next chapter.</p>

<hr />

<p><em>How are you using AI coding tools in your work? Got any interesting experiences or reflections? I’d love to hear from you in the comments!</em></p>]]></content><author><name>Woody Wang</name></author><category term="tech" /><category term="ai-coding" /><category term="career-development" /><category term="programming-skills" /><category term="software-engineering" /><summary type="html"><![CDATA[A security engineer's perspective on how core programming skills are shifting in the AI coding era: how architectural thinking, requirements translation, quality control, and engineering practices are redefining developer value.]]></summary></entry><entry xml:lang="en"><title type="html">Two MCP Plugins That Doubled My Claude Code Productivity: Solving Stale Docs and Single-Model Limitations</title><link href="https://blog.brainsandbox.com/en/tech/2025/09/05/claude-code-mcp-recommendations.html" rel="alternate" type="text/html" title="Two MCP Plugins That Doubled My Claude Code Productivity: Solving Stale Docs and Single-Model Limitations" /><published>2025-09-05T02:30:00+00:00</published><updated>2025-09-05T02:30:00+00:00</updated><id>https://blog.brainsandbox.com/tech/2025/09/05/claude-code-mcp-recommendations-en</id><content type="html" xml:base="https://blog.brainsandbox.com/tech/2025/09/05/claude-code-mcp-recommendations.html"><![CDATA[<p>I recently came across some discussions on Twitter about Claude Code MCP, which reminded me of two MCP plugins I’ve been using daily. As a security engineer who reviews code constantly, these tools genuinely solve real pain points in my workflow. Here’s my experience with them.</p>

<h2 id="pain-point-1-ai-generated-code-is-always-outdated">Pain Point #1: AI-Generated Code Is Always Outdated</h2>

<p>I remember writing Ethereum smart contracts with Cursor and needing the ethers library for on-chain interactions. The AI kept generating v5 syntax, but our project was on v6. The ethers library underwent massive API restructuring in v6 – method names and calling conventions were completely different.</p>

<pre><code class="language-mermaid">graph TD
    A[Need to use ethers library] --&gt; B[AI generates code]
    B --&gt; C[Uses v5 syntax]
    C --&gt; D[Runtime error]
    D --&gt; E[Manually check v6 docs]
    E --&gt; F[Tell AI the correct approach]
    F --&gt; G[Regenerate code]
    G --&gt; H{More errors?}
    H --&gt;|Yes| D
    H --&gt;|No| I[Finally works!]

    style D fill:#ffcccc
    style E fill:#fff2cc
    style I fill:#d4edda
</code></pre>

<p>Every single time, it was the same loop: AI generates code, runtime error, manually check docs, teach the AI the correct approach, regenerate. When you need to call dozens of different methods, this cycle is absolutely maddening.</p>

<p>Then I discovered <strong>Context7 MCP</strong> – a genuine lifesaver.</p>

<h3 id="context7-real-time-access-to-latest-documentation">Context7: Real-Time Access to Latest Documentation</h3>

<p>The core idea is simple but effective: fetch the latest content from official documentation in real time and inject it directly into the AI’s context. No more worrying about the AI’s “knowledge” being outdated.</p>

<pre><code class="language-mermaid">graph LR
    A[User Request] --&gt; B[Context7 MCP]
    B --&gt; C[Fetch latest official docs in real time]
    C --&gt; D[Inject into AI context]
    D --&gt; E[AI generates code based on latest docs]
    E --&gt; F[Correct on the first try!]

    subgraph "Supported Documentation Sources"
        G[OpenZeppelin]
        H[Symbiotic Protocol]
        I[ethers.js]
        J[React/Next.js]
        K[And more...]
    end

    C --&gt; G
    C --&gt; H
    C --&gt; I
    C --&gt; J
    C --&gt; K

    style F fill:#d4edda
</code></pre>

<p><strong>Installation:</strong></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>claude mcp add <span class="nt">--transport</span> http context7 https://mcp.context7.com/mcp <span class="nt">--header</span> <span class="s2">"CONTEXT7_API_KEY: YOUR_API_KEY"</span>
</code></pre></div></div>

<p><strong>Usage couldn’t be simpler:</strong> Just add “use context7” to your prompt.</p>

<p>The documentation coverage is impressive. Beyond mainstream frameworks like React and Next.js, it even covers niche Web3 domains:</p>
<ul>
  <li><strong>OpenZeppelin Contracts</strong>: Essential smart contract security library docs for DeFi projects</li>
  <li><strong>Symbiotic Protocol</strong>: A relatively new shared security protocol – I was surprised to see it supported</li>
  <li><strong>Major blockchain SDKs</strong>: Full coverage from ethers to viem</li>
</ul>

<p>Now my code compiles on the first try. The AI generates accurate code based on the latest APIs, completely eliminating version mismatches.</p>

<h2 id="pain-point-2-a-single-model-has-its-limits">Pain Point #2: A Single Model Has Its Limits</h2>

<p>During code audits, I often need to uncover potential vulnerabilities. In practice, I’ve noticed an interesting pattern:</p>
<ul>
  <li><strong>Claude Code</strong> is a “workhorse” for coding – it implements features quickly</li>
  <li><strong>GPT-5</strong> excels at deep analysis, especially in scenarios requiring logical reasoning</li>
</ul>

<p>For example, when auditing DeFi contracts:</p>
<ul>
  <li>GPT-5 can dissect economic models and discover subtle attack vectors</li>
  <li>Claude Code is great at writing test cases to verify those vulnerabilities</li>
</ul>

<p>Previously, I had to constantly switch between tools, copying and pasting – terribly inefficient.</p>

<h3 id="zen-mcp-multi-model-orchestration">Zen MCP: Multi-Model Orchestration</h3>

<p><strong>Zen MCP</strong> solves this perfectly by letting Claude call on other models’ capabilities.</p>

<pre><code class="language-mermaid">graph TD
    A[Security Code Audit Task] --&gt; B[Claude Code + Zen MCP]

    B --&gt; C[Call GPT-5 for deep analysis]
    C --&gt; D[Identify potential risk areas]

    B --&gt; E[Claude Code writes test cases]
    D --&gt; E
    E --&gt; F[Verify security vulnerabilities]

    B --&gt; G[Call Gemini to generate report]
    F --&gt; G
    G --&gt; H[Structured Audit Report]

    subgraph "Multi-Model Collaboration"
        I[GPT-5: Deep Thinking &amp; Analysis]
        J[Claude: Code Writing &amp; Execution]
        K[Gemini: Documentation &amp; Report Generation]
    end

    C -.-&gt; I
    E -.-&gt; J
    G -.-&gt; K

    style H fill:#d4edda
</code></pre>

<p>I chose to connect via <strong>OpenRouter</strong> – one configuration gives you access to multiple models: GPT-5, Gemini, various Claude versions, DeepSeek, and more. You can also configure individual platform APIs separately.</p>

<p><strong>Typical Workflow:</strong></p>
<ol>
  <li><strong>Deep analysis</strong>: Call GPT-5 to identify code risk areas</li>
  <li><strong>Vulnerability verification</strong>: Claude writes test cases based on the analysis</li>
  <li><strong>Report generation</strong>: Use Gemini to produce a structured report</li>
</ol>

<p>This division of labor lets each model play to its strengths: GPT-5 handles the “thinking,” Claude handles the “doing” – seamlessly connected.</p>

<h3 id="installation-and-configuration">Installation and Configuration</h3>

<p><strong>Option B: Instant Setup (Recommended)</strong></p>

<p>Add the following to <code class="language-plaintext highlighter-rouge">~/.claude/settings.json</code> or <code class="language-plaintext highlighter-rouge">.mcp.json</code>:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"mcpServers"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="nl">"zen"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="nl">"command"</span><span class="p">:</span><span class="w"> </span><span class="s2">"bash"</span><span class="p">,</span><span class="w">
      </span><span class="nl">"args"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"-c"</span><span class="p">,</span><span class="w"> </span><span class="s2">"for p in $(which uvx 2&gt;/dev/null) $HOME/.local/bin/uvx /opt/homebrew/bin/uvx /usr/local/bin/uvx uvx; do [ -x </span><span class="se">\"</span><span class="s2">$p</span><span class="se">\"</span><span class="s2"> ] &amp;&amp; exec </span><span class="se">\"</span><span class="s2">$p</span><span class="se">\"</span><span class="s2"> --from git+https://github.com/BeehiveInnovations/zen-mcp-server.git zen-mcp-server; done; echo 'uvx not found' &gt;&amp;2; exit 1"</span><span class="p">],</span><span class="w">
      </span><span class="nl">"env"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
        </span><span class="nl">"PATH"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:~/.local/bin"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"OPENROUTER_API_KEY"</span><span class="p">:</span><span class="w"> </span><span class="s2">"your-key-here"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DISABLED_TOOLS"</span><span class="p">:</span><span class="w"> </span><span class="s2">"analyze,refactor,testgen,secaudit,docgen,tracer"</span><span class="p">,</span><span class="w">
        </span><span class="nl">"DEFAULT_MODEL"</span><span class="p">:</span><span class="w"> </span><span class="s2">"auto"</span><span class="w">
      </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>Once configured, you can flexibly invoke various models from within Claude. It supports both OpenRouter API and individually configured platform API keys.</p>

<pre><code class="language-mermaid">graph LR
    A[Claude Code] --&gt; B[Zen MCP]
    B --&gt; C[OpenRouter API]

    subgraph "Available Models"
        D[GPT-5/o3]
        E[Gemini Pro]
        F[Claude All Versions]
        G[DeepSeek]
        H[Other Models...]
    end

    C --&gt; D
    C --&gt; E
    C --&gt; F
    C --&gt; G
    C --&gt; H

    style A fill:#e1f5fe
    style C fill:#f3e5f5
</code></pre>

<h2 id="practical-tips">Practical Tips</h2>

<h3 id="context7-tips">Context7 Tips:</h3>
<ul>
  <li><strong>API key is optional</strong>: It works without one, but having a key increases your rate limits</li>
  <li><strong>Use the topic parameter wisely</strong>: Specify the documentation scope when focusing on a particular feature</li>
  <li><strong>Retry on network issues</strong>: Failed doc fetches are usually caused by transient network hiccups</li>
</ul>

<h3 id="zen-mcp-tips">Zen MCP Tips:</h3>
<ul>
  <li><strong>Don’t overuse it</strong>: For simple tasks, just use Claude directly</li>
  <li><strong>Define clear roles</strong>: Analysis with GPT-5, coding with Claude</li>
  <li><strong>Manage costs</strong>: Choose models on OpenRouter based on task importance</li>
</ul>

<h2 id="before-and-after">Before and After</h2>

<table>
  <thead>
    <tr>
      <th>Scenario</th>
      <th>Before</th>
      <th>After</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>API doc lookup</td>
      <td>Manual search, teach AI, retry</td>
      <td>“use context7” and it just works</td>
    </tr>
    <tr>
      <td>Code auditing</td>
      <td>Switching between tools</td>
      <td>Analysis, coding, and reporting in one flow</td>
    </tr>
    <tr>
      <td>Learning new tech</td>
      <td>Risk of learning outdated patterns</td>
      <td>Real-time access to best practices</td>
    </tr>
    <tr>
      <td>Dev efficiency</td>
      <td>Constant debugging and rework</td>
      <td>Significantly less rework</td>
    </tr>
  </tbody>
</table>

<h2 id="conclusion">Conclusion</h2>

<p>These two MCPs tackle core pain points head-on:</p>
<ul>
  <li><strong>Context7</strong> permanently solves the stale documentation problem</li>
  <li><strong>Zen MCP</strong> breaks through single-model limitations</li>
</ul>

<p>For developers working with complex tech stacks, these tools are genuine productivity multipliers. No flashy gimmicks – just solid, tangible improvements to the development experience.</p>

<p>If you’re using Claude, I strongly recommend giving these two MCPs a try. You’ll wonder how you ever managed without them.</p>

<hr />

<p><strong>Resources:</strong></p>
<ul>
  <li><a href="https://github.com/upstash/context7">Context7 GitHub</a></li>
  <li><a href="https://github.com/BeehiveInnovations/zen-mcp-server">Zen MCP GitHub</a></li>
  <li><a href="https://docs.anthropic.com/en/docs/claude-code/mcp">Claude Code MCP Documentation</a></li>
</ul>]]></content><author><name>Woody Wang</name></author><category term="tech" /><category term="claude-code" /><category term="mcp" /><category term="ai-tools" /><category term="productivity" /><summary type="html"><![CDATA[Recommending Context7 and Zen MCP -- two practical MCP plugins that solve the pain points of outdated documentation and single-model limitations in AI programming, with installation guides and usage tips.]]></summary></entry><entry xml:lang="en"><title type="html">From VPN to Zero Trust: My Security Architecture Upgrade Journey</title><link href="https://blog.brainsandbox.com/en/security/tech/2025/09/05/zero-trust-vs-vpn.html" rel="alternate" type="text/html" title="From VPN to Zero Trust: My Security Architecture Upgrade Journey" /><published>2025-09-05T02:30:00+00:00</published><updated>2025-09-05T02:30:00+00:00</updated><id>https://blog.brainsandbox.com/security/tech/2025/09/05/zero-trust-vs-vpn-en</id><content type="html" xml:base="https://blog.brainsandbox.com/security/tech/2025/09/05/zero-trust-vs-vpn.html"><![CDATA[<p>When you say “enterprise network security,” VPN is the first thing most people think of. Early in my career, every time I needed to access an internal system, I had to wrestle with that love-hate VPN client first – nothing worked without it. But a recent audit of an internal app running on Supabase forced me to rethink the fundamentals: in today’s world of cloud services everywhere, can the old VPN approach still hold up?</p>

<h2 id="vpn-the-familiar-security-guard">VPN: The Familiar Security Guard</h2>

<p><img src="/assets/images/vpn-architecture.png" alt="Traditional VPN architecture is like an apartment complex gate guard: checks the card, not the person" /></p>

<p>VPN is a lot like the gate guard at an apartment complex – enter the right password and you’re inside the “secure zone,” free to roam as you please. This model worked well enough, especially when everything lived in the company’s own data center.</p>

<p>But live with it long enough and the cracks start to show. I remember being on a business trip, eagerly pulling out my iPad to push an urgent fix, only to discover I couldn’t install the company VPN on it. I stared at that tantalizing intranet link in my email, tapping furiously on a screen that wouldn’t cooperate. And the network experience was brutal: all traffic routed through the VPN server turned video calls into slideshows, with colleagues’ lip movements lagging behind their words.</p>

<p>The worst part was the security gap. Last year, a teammate’s VPN credentials got stolen. The attacker waltzed through the internal network like they had an all-access pass, helping themselves to data like it was a buffet. Classic “hard shell, soft center” – the front gate is armored steel, but the backyard fence is held together with wishes.</p>

<h2 id="zero-trust-security-through-systematic-suspicion">Zero Trust: Security Through Systematic Suspicion</h2>

<p>Zero Trust sounds fancy, but the core idea is dead simple: <strong>no matter who you are, you prove your identity every time you want access.</strong></p>

<p>My experience using Akamai EAA at Bybit was an eye-opener. No client software to install – just type an internal address into the browser, get redirected to a login page, authenticate, and you’re in. Smooth as scanning a QR code to log into a mobile app. That’s the kind of experience modern workers deserve.</p>

<pre><code class="language-mermaid">graph TB
    User[User] --&gt; Auth[Authentication]
    Auth --&gt; Policy[Access Policy]
    Policy --&gt; App1[App 1]
    Policy --&gt; App2[App 2]
    Policy --&gt; App3[App 3]

    subgraph "Zero Trust Core"
        Auth
        Policy
    end

    subgraph "Protected Apps"
        App1
        App2
        App3
    end
</code></pre>

<p>Here’s a useful analogy: traditional VPN is like an old apartment complex where getting past the front gate means you can wander anywhere. Zero Trust is like a high-security lab where you badge in and verify your identity at every single door.</p>

<h2 id="the-real-battlefield-cloud-era-security-challenges">The Real Battlefield: Cloud-Era Security Challenges</h2>

<p>The Supabase internal app I audited recently was a perfect case study. The vulnerabilities were everywhere, and when I tried to lock things down with IP whitelisting – no dice. Cloud services like this simply don’t support it. VPN was completely useless here.</p>

<p>This is the reality we’re dealing with now:</p>
<ul>
  <li>SaaS services don’t support IP whitelists</li>
  <li>Employee devices are all over the map (phones, tablets, gaming laptops – you name it)</li>
  <li>Remote work is the norm, not the exception</li>
  <li>Applications are scattered across AWS, GCP, Alibaba Cloud</li>
</ul>

<p><img src="/assets/images/cloud-security-challenges.png" alt="Cloud-native environments are like whack-a-mole: apps everywhere, devices all different" /></p>

<p>This is where Zero Trust shines. No matter which cloud your app lives in, as long as it’s behind unified authentication, access control just works. It’s like installing a smart access system on every application, with permissions granular down to the individual user.</p>

<h2 id="the-three-pillars-of-zero-trust-in-plain-english">The Three Pillars of Zero Trust (In Plain English)</h2>

<p><strong>1. Identity Verification</strong>
Think of it as a digital badge system that confirms who you are. It integrates with existing corporate AD/LDAP or modern identity providers like Azure AD.</p>

<p><strong>2. Policy Engine</strong>
Picture a security control room with live monitoring. It makes real-time decisions: “Can Zhang access the finance system from a laptop? At 3 AM? Connecting from Thailand?”</p>

<p><strong>3. Access Gateway</strong>
This is the meticulous guard who checks credentials, matches them against the roster, and logs everything for every single request. Cloudflare Zero Trust and Akamai EAA are essentially productized, out-of-the-box versions of this entire system.</p>

<h2 id="the-showdown-how-do-you-choose">The Showdown: How Do You Choose?</h2>

<table>
  <thead>
    <tr>
      <th>Comparison</th>
      <th>Traditional VPN</th>
      <th>Zero Trust</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Security model</strong></td>
      <td>Trust after entry</td>
      <td>Verify at every step</td>
    </tr>
    <tr>
      <td><strong>User experience</strong></td>
      <td>Install client + traffic detour</td>
      <td>Direct browser access, silky smooth</td>
    </tr>
    <tr>
      <td><strong>Device support</strong></td>
      <td>Picky (needs a client)</td>
      <td>Anything with a browser works</td>
    </tr>
    <tr>
      <td><strong>Admin overhead</strong></td>
      <td>Simple but rigid</td>
      <td>Steeper setup, flexible long-term</td>
    </tr>
    <tr>
      <td><strong>Best for</strong></td>
      <td>Legacy on-prem systems</td>
      <td>Cloud apps / hybrid architectures</td>
    </tr>
  </tbody>
</table>

<h2 id="the-learning-curve-lets-be-honest">The Learning Curve: Let’s Be Honest</h2>

<p>I’ll be straight with you – getting started with Zero Trust can be rough. The first time I encountered OIDC, SAML, and RBAC, I thought I was taking a certification exam. Many companies hesitate precisely because of this – VPN may be painful, but at least it’s a familiar kind of pain.</p>

<p>That said, these technologies are everywhere now, and you’ll need to learn them sooner or later. Modern solutions have increasingly friendly configuration interfaces – it’s like assembling IKEA furniture. Follow the instructions and you’ll get there; no need to apprentice with a carpenter first.</p>

<h2 id="final-thoughts">Final Thoughts</h2>

<p>Zero Trust and VPN aren’t really competitors – it’s more like a version upgrade for your security posture. VPN is perfectly fine for legacy systems, but for cloud-native and remote work scenarios, Zero Trust is clearly the stronger play.</p>

<p>The right choice depends on your specific situation. For the Supabase security challenge I faced, Zero Trust was the clear answer. There’s no silver bullet in security, but having multiple approaches in your toolkit means you can stay calm when problems arise.</p>

<p>At the end of the day, security isn’t about putting shackles on the business – it’s about helping it run faster and more reliably. Choose the right architecture, and innovation gets the solid foundation it needs to sprint.</p>]]></content><author><name>Woody Wang</name></author><category term="security" /><category term="tech" /><category term="Zero Trust" /><category term="VPN" /><category term="network security" /><category term="enterprise security" /><summary type="html"><![CDATA[Drawing from a Supabase audit and enterprise experience at Bybit, this post compares the security differences between VPN and Zero Trust architectures, sharing hands-on lessons from migrating away from traditional VPN.]]></summary></entry></feed>