<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Claude Code on ByF (BaiFan) · Daily Deep Think</title><link>https://blog.baifan.site/en/tags/claude-code/</link><description>Recent content in Claude Code on ByF (BaiFan) · Daily Deep Think</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>blog@baifan.site (ByF (BaiFan))</managingEditor><webMaster>blog@baifan.site (ByF (BaiFan))</webMaster><copyright>CC BY-NC 4.0</copyright><lastBuildDate>Tue, 29 Sep 2026 00:40:00 +0800</lastBuildDate><atom:link href="https://blog.baifan.site/en/tags/claude-code/index.xml" rel="self" type="application/rss+xml"/><item><title>The Future of AI Coding Tools: From Copilot to Autonomous Agent</title><link>https://blog.baifan.site/en/ai-coding-tools-future-copilot-to-autonomous-agent/</link><pubDate>Mon, 06 Jul 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/ai-coding-tools-future-copilot-to-autonomous-agent/</guid><description>&lt;!-- more --&gt;&#10;&lt;p&gt;Twelve articles, from the Think-Act-Observe loop all the way down into the 500,000-line engineering abyss. Now, standing at the end of the series and looking back over the whole evolutionary path, a bigger question surfaces:&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;What will AI coding tools ultimately evolve into?&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;A better Copilot? A more powerful IDE plugin? Or something new that we haven&amp;rsquo;t named yet?&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Three Evolutionary Paths&#10; &lt;div id="three-evolutionary-paths" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#three-evolutionary-paths" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;Looking back at the development of AI coding tools, you can see three clear stages of evolution:&lt;/p&gt;</description></item><item><title>3,000 vs 500K Lines: The Architectural Abyss From Toy to Product</title><link>https://blog.baifan.site/en/claude-code-3000-vs-500k-lines/</link><pubDate>Thu, 02 Jul 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-3000-vs-500k-lines/</guid><description>&lt;!-- more --&gt;&#10;&lt;p&gt;The &lt;a href="https://github.com/saoudrizwan/claude-code-from-scratch" target="_blank" rel="noreferrer"&gt;claude-code-from-scratch&lt;/a&gt; project implements a &amp;ldquo;mini Claude Code&amp;rdquo; in roughly 3,000 lines of TypeScript. It has the Think-Act-Observe loop, a tool system, a system prompt, permission control, memory, Skills, multi-agent, MCP — every core concept we tore down over the previous ten posts.&lt;/p&gt;&#10;&lt;p&gt;And the official Claude Code source? Roughly 500K lines of TypeScript/TSX.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;That&amp;rsquo;s a 100x+ gap between 3,000 lines and 500K.&lt;/strong&gt; What&amp;rsquo;s in it?&lt;/p&gt;&#10;&lt;p&gt;The gap isn&amp;rsquo;t &amp;ldquo;number of features&amp;rdquo;. from-scratch already covers every core concept. The gap is &lt;strong&gt;the road each concept travels from &amp;ldquo;it runs&amp;rdquo; to &amp;ldquo;it&amp;rsquo;s usable&amp;rdquo;&lt;/strong&gt; — that road is called productionization.&lt;/p&gt;</description></item><item><title>The Discrete State Machine of Plan Mode: Decision Tree Pruning, Backtracking Costs, and Diminishing Returns</title><link>https://blog.baifan.site/en/claude-code-plan-mode/</link><pubDate>Tue, 16 Jun 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-plan-mode/</guid><description>&lt;p&gt;Autoregressive large language models operating in unconstrained environments suffer from an inherent tendency toward myopic mutation and runaway divergence. Claude Code&amp;rsquo;s Plan Mode attaches an external discrete Finite State Machine (FSM) that projects the action space onto a strictly side-effect-free subset, using an interactive human barrier to prune catastrophic physical backtracking branches from the decision tree.&lt;/p&gt;&#10;&lt;!-- more --&gt;&#10;&lt;p&gt;In disciplined software engineering, experienced developers instinctively value structural planning: mapping dependency graphs, deriving type signatures, and scoping blast radiuses before modifying a single line of code. Large language models possess no such innate restraint. Shaped by reinforcement learning to generate immediate answers, an agent granted unrestrained write permissions will instinctively mutate files without global context, precipitating an architectural cascade across complex repositories.&lt;/p&gt;</description></item><item><title>The MCP Protocol: USB-C for AI Tool Interconnection</title><link>https://blog.baifan.site/en/claude-code-mcp-protocol/</link><pubDate>Fri, 12 Jun 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-mcp-protocol/</guid><description>&lt;!-- more --&gt;&#10;&lt;p&gt;Before MCP, every AI tool integration was a &lt;strong&gt;custom build&lt;/strong&gt;. Want ChatGPT to reach a database? Write a plugin. Want Claude to call the GitHub API? Write a Function Calling definition. Want Copilot to access your internal systems? Write a Custom Tool.&lt;/p&gt;&#10;&lt;p&gt;Every time, the same thing: define an interface, write adapter code, handle auth, manage errors. The wheel, reinvented countless times.&lt;/p&gt;&#10;&lt;p&gt;The problem MCP (Model Context Protocol) solves is simple: &lt;strong&gt;give AI agents a standard protocol for connecting tools.&lt;/strong&gt; Just as USB-C gave electronic devices a universal connector, MCP gives AI agents a universal tool interface.&lt;/p&gt;</description></item><item><title>Multi-Agent Architecture: The Art of Fork-Join Collaboration</title><link>https://blog.baifan.site/en/claude-code-multi-agent-architecture/</link><pubDate>Tue, 09 Jun 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-multi-agent-architecture/</guid><description>&lt;!-- more --&gt;&#10;&lt;p&gt;There&amp;rsquo;s a counterintuitive phenomenon: take the same model, split it into multiple independent instances, and have them collaborate — the result is often better than a single instance.&lt;/p&gt;&#10;&lt;p&gt;Not more compute (three instances burn more total tokens than one), not more capability (every instance is the same model). The gain comes from &lt;strong&gt;role separation&lt;/strong&gt; — when each agent attends to only one facet of the problem, it works with more focus and more depth than a &amp;ldquo;do-everything agent&amp;rdquo;.&lt;/p&gt;</description></item><item><title>The Nature of Skills: Reusable Encapsulated Expertise</title><link>https://blog.baifan.site/en/claude-code-skills-system/</link><pubDate>Fri, 05 Jun 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-skills-system/</guid><description>&lt;!-- more --&gt;&#10;&lt;p&gt;If you&amp;rsquo;ve used Claude Code, you may have noticed the &lt;code&gt;/skills&lt;/code&gt; command listing installed &amp;ldquo;skills&amp;rdquo;. Writing standards, architecture design methods, TDD workflows, code review strategies — it sounds like a plugin marketplace.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Skills are not plugins.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;That&amp;rsquo;s the first and most important thing to understand about the Skill system. A plugin is code — it extends what the program can do. A Skill is a prompt — it extends what the model knows.&lt;/p&gt;</description></item><item><title>AI Memory Systems: Four Memory Types and Semantic Recall</title><link>https://blog.baifan.site/en/claude-code-memory-system/</link><pubDate>Tue, 02 Jun 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-memory-system/</guid><description>&lt;!-- more --&gt;&#10;&lt;p&gt;Last time we covered context compaction — solving &amp;ldquo;how much the current session can remember&amp;rdquo;. But a coding assistant needs another kind of memory: &lt;strong&gt;long-term memory across sessions.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;You close Claude Code and reopen it tomorrow. What should it know?&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;You prefer TypeScript over JavaScript&lt;/li&gt;&#10;&lt;li&gt;You said last time &amp;ldquo;don&amp;rsquo;t use the underscore library&amp;rdquo;&lt;/li&gt;&#10;&lt;li&gt;This project uses Vitest, not Jest&lt;/li&gt;&#10;&lt;li&gt;You once corrected one of its misunderstandings&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Context compaction can&amp;rsquo;t handle these. The session ends, the history clears, tomorrow is a fresh window. If the AI needs you to re-explain everything each time, it isn&amp;rsquo;t an assistant — it&amp;rsquo;s a burden.&lt;/p&gt;</description></item><item><title>The Physical Cost of Context Compression: KV Cache Pressure, Attention Decay, and Lossy Summarization</title><link>https://blog.baifan.site/en/claude-code-context-compression/</link><pubDate>Sat, 23 May 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-context-compression/</guid><description>&lt;p&gt;Large language models possess no biological memory at the hardware tier; they operate entirely on Key-Value Caches that scale linearly in GPU High-Bandwidth Memory (HBM) alongside attention weight distributions that mathematically dilute as sequence length grows. The notion of long-horizon conversations presented by Claude Code is, at its engineering core, an eviction and compaction pipeline operating within the tight margins of memory capacity and numerical precision, trading away information entropy and prefix caching efficiency.&lt;/p&gt;</description></item><item><title>Permissions and Real Security Boundaries: Sandboxes, System Calls, and Approval Escape</title><link>https://blog.baifan.site/en/claude-code-permissions-security/</link><pubDate>Wed, 20 May 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-permissions-security/</guid><description>&lt;p&gt;Any AI agent permission system running in userspace that relies on model self-discipline and application-level regex filtering does not constitute an enforceable security boundary from the perspective of the operating system kernel. Claude Code&amp;rsquo;s 5-level permission model and interactive approval workflow operate as flow-control protocols to mitigate developer mistakes, lacking sandbox containment against adversarial attacks.&lt;/p&gt;&#10;&lt;!-- more --&gt;&#10;&lt;p&gt;Granting an AI coding assistant filesystem write access and terminal execution rights under the belief that confirmation prompts preserve a safety perimeter is a fundamental category error. Confusing interactive human approval with privileged access control collapses into a cosmetic barrier when confronted with supply-chain poisonings, indirect prompt injections, and shell parser differentials.&lt;/p&gt;</description></item><item><title>System Prompt Engineering: Decisions Behind 800 Lines</title><link>https://blog.baifan.site/en/claude-code-system-prompt-engineering/</link><pubDate>Sat, 16 May 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-system-prompt-engineering/</guid><description>&lt;!-- more --&gt;&#10;&lt;p&gt;If you think a system prompt is just &amp;ldquo;giving the AI a persona&amp;rdquo;, Claude Code&amp;rsquo;s system prompt will upend that notion.&lt;/p&gt;&#10;&lt;p&gt;It isn&amp;rsquo;t a few sentences. It&amp;rsquo;s a &lt;strong&gt;thousand-line template engine&lt;/strong&gt; made of multiple layers, each responsible for something different: identity definition, behavioral constraints, tool documentation, project context, memory injection, skill loading. Some layers are static (identical every time); others are dynamic (injected in real time based on the project, the session, user preferences).&lt;/p&gt;</description></item><item><title>Tools Are Capability: AI Agent Tool System Design Philosophy</title><link>https://blog.baifan.site/en/claude-code-tool-system-design/</link><pubDate>Tue, 12 May 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-tool-system-design/</guid><description>&lt;!-- more --&gt;&#10;&lt;p&gt;Last time we talked about the Think-Act-Observe loop — the skeleton of an AI coding assistant. A skeleton can&amp;rsquo;t work on its own; it needs muscle. In Claude Code, that muscle is &lt;strong&gt;tools&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;Without tools, the loop loses the Act between Think and Observe and degenerates into plain Q&amp;amp;A. With tools, the model can touch the real world: read your code, change your configs, run your tests.&lt;/p&gt;</description></item><item><title>The Soul of an AI Coding Assistant: The Think-Act-Observe Loop</title><link>https://blog.baifan.site/en/claude-code-think-act-observe-loop/</link><pubDate>Thu, 07 May 2026 09:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/claude-code-think-act-observe-loop/</guid><description>&lt;!-- more --&gt;&#10;&lt;p&gt;If you dig through the Claude Code source, you will discover a counterintuitive fact:&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The core of the entire program is a while loop.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Not a complex state machine, not an elaborate pipeline, not distributed coordination — just a plain &lt;code&gt;while&lt;/code&gt; loop that does three things over and over: let the model think, let the model act, feed the results back.&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;span class="lnt"&gt;6&#10;&lt;/span&gt;&lt;span class="lnt"&gt;7&#10;&lt;/span&gt;&lt;span class="lnt"&gt;8&#10;&lt;/span&gt;&lt;span class="lnt"&gt;9&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;while (user hasn&amp;#39;t quit) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; thinking = callLLM(conversation history + tool definitions)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; if (thinking.wants to call a tool) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; result = executeTool(thinking.toolCall)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; conversationHistory.push(result)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; } else {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; output(thinking.reply)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;That&amp;rsquo;s it? The entire secret of an AI coding assistant lives in this loop?&lt;/p&gt;</description></item><item><title>What Trellis Does, and Whether It Fixes AI Coding Standards</title><link>https://blog.baifan.site/en/trellis-ai-coding-framework-guide/</link><pubDate>Thu, 30 Apr 2026 14:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/trellis-ai-coding-framework-guide/</guid><description>&lt;p&gt;The most annoying thing about coding with AI isn&amp;rsquo;t that it writes bugs — it&amp;rsquo;s that it writes them differently every time. Same requirement, three conversations, three implementations. The standards live in your head; the AI doesn&amp;rsquo;t know them.&lt;/p&gt;&#10;&lt;!-- more --&gt;&#10;&lt;p&gt;Trellis tries to solve this. It&amp;rsquo;s not yet another AI coding assistant — it&amp;rsquo;s a framework for injecting project standards into AI: the AI reads your standards before writing code, gets checked automatically after writing, and once the check is done, anything newly learned gets distilled back into the standards. The more you use it, the better the AI knows your project.&lt;/p&gt;</description></item><item><title>The Engineering Reality of Multi-Agent Collaboration: Triggers, Topologies, and Deterministic Merging</title><link>https://blog.baifan.site/en/multi-agent-collaboration-engineering/</link><pubDate>Tue, 03 Mar 2026 14:00:00 +0800</pubDate><author>blog@baifan.site (ByF (BaiFan))</author><guid>https://blog.baifan.site/en/multi-agent-collaboration-engineering/</guid><description>&lt;p&gt;Packing multiple probabilistically sampled large language model instances into a single codebase or production pipeline is, fundamentally, constructing a distributed system over an unreliable network using stochastic state machines. The axiomatic foundations of classical distributed computing—deterministic state transitions, reproducible failure modes, Byzantine fault tolerance, and atomic commits—collapse almost entirely when applied to modern generative models.&lt;/p&gt;&#10;&lt;!-- more --&gt;&#10;&lt;p&gt;Tech social media abounds with utopian product demos: one agent searches documentation, another implements business logic, a third writes unit tests, and a fourth conducts code review, while an orchestrator agent glides over the process like an infallible engineering manager. Yet anyone who has pushed such topologies into a 500,000-line monolithic repository or a high-concurrency production environment knows the reality: the system rapidly degenerates into distributed chaos. Unsynchronized modifications cause silent overwrites and split-brain states; non-deterministic rollouts cause cognitive divergence; token consumption explodes in a positive-feedback avalanche; and parent and child processes lock each other in cognitive livelocks.&lt;/p&gt;</description></item></channel></rss>