↓ Skip to main content

Posts

2026

AI Memory Systems: Four Memory Types and Semantic Recall
Deep Thoughts · 2026-06-02 · 8 分钟

AI Memory Systems: Four Memory Types and Semantic Recall

Last time we covered context compaction — solving “how much the current session can remember”. But a coding assistant needs another kind of memory: long-term memory across sessions. You close Claude Code and reopen it tomorrow. What should it know? You prefer TypeScript over JavaScript You said last time “don’t use the underscore library” This project uses Vitest, not Jest You once corrected one of its misunderstandings Context compaction can’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’t an assistant — it’s a burden.

1560 字 阅读 ➔
The Physical Cost of Context Compression: KV Cache Pressure, Attention Decay, and Lossy Summarization
Deep Thoughts · 2026-05-23 · 9 分钟

The Physical Cost of Context Compression: KV Cache Pressure, Attention Decay, and Lossy Summarization

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.

1718 字 阅读 ➔
Permissions and Real Security Boundaries: Sandboxes, System Calls, and Approval Escape
Deep Thoughts · 2026-05-20 · 9 分钟

Permissions and Real Security Boundaries: Sandboxes, System Calls, and Approval Escape

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’s 5-level permission model and interactive approval workflow operate as flow-control protocols to mitigate developer mistakes, lacking sandbox containment against adversarial attacks. 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.

1736 字 阅读 ➔
System Prompt Engineering: Decisions Behind 800 Lines
Deep Thoughts · 2026-05-16 · 9 分钟

System Prompt Engineering: Decisions Behind 800 Lines

If you think a system prompt is just “giving the AI a persona”, Claude Code’s system prompt will upend that notion. It isn’t a few sentences. It’s a thousand-line template engine 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).

1760 字 阅读 ➔
Tools Are Capability: AI Agent Tool System Design Philosophy
Deep Thoughts · 2026-05-12 · 8 分钟

Tools Are Capability: AI Agent Tool System Design Philosophy

Last time we talked about the Think-Act-Observe loop — the skeleton of an AI coding assistant. A skeleton can’t work on its own; it needs muscle. In Claude Code, that muscle is tools. Without tools, the loop loses the Act between Think and Observe and degenerates into plain Q&A. With tools, the model can touch the real world: read your code, change your configs, run your tests.

1624 字 阅读 ➔
The Soul of an AI Coding Assistant: The Think-Act-Observe Loop
Deep Thoughts · 2026-05-07 · 8 分钟

The Soul of an AI Coding Assistant: The Think-Act-Observe Loop

If you dig through the Claude Code source, you will discover a counterintuitive fact: The core of the entire program is a while loop. Not a complex state machine, not an elaborate pipeline, not distributed coordination — just a plain while loop that does three things over and over: let the model think, let the model act, feed the results back. 1 2 3 4 5 6 7 8 9 while (user hasn't quit) { thinking = callLLM(conversation history + tool definitions) if (thinking.wants to call a tool) { result = executeTool(thinking.toolCall) conversationHistory.push(result) } else { output(thinking.reply) } } That’s it? The entire secret of an AI coding assistant lives in this loop?

1645 字 阅读 ➔
What Trellis Does, and Whether It Fixes AI Coding Standards
Engineering Practice · 2026-04-30 · 13 分钟

What Trellis Does, and Whether It Fixes AI Coding Standards

The most annoying thing about coding with AI isn’t that it writes bugs — it’s that it writes them differently every time. Same requirement, three conversations, three implementations. The standards live in your head; the AI doesn’t know them. Trellis tries to solve this. It’s not yet another AI coding assistant — it’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.

2613 字 阅读 ➔
Dissecting a PPT Agent: From Research to SVG Output
Engineering Practice · 2026-04-28 · 10 分钟

Dissecting a PPT Agent: From Research to SVG Output

Conclusion first: this is not another “type a topic → force it into a template → output garbage” AI PPT tool. It runs a complete expert workflow — requirement research, material retrieval, outline planning, layout planning, visual design — where every step allows manual fine-tuning, or the whole thing can run automatically end to end. In terms of output, pages generated with Gemini 3 Flash already reach commercial delivery quality.

1936 字 阅读 ➔
All the Tmux You'll Ever Use: Sessions, Panes, Detach
Engineering Practice · 2026-04-21 · 4 分钟

All the Tmux You'll Ever Use: Sessions, Panes, Detach

You SSH into a server to run a long task, the network drops, and the task is gone. Tmux exists to solve exactly this — it decouples the terminal session from the window, so the process keeps running after you close the terminal. Tmux's three layers: a Session contains Windows, a Window contains Panes The Core Problem It Solves # An ordinary terminal window is bound to its processes. Close the window and the processes die. Same story when SSH drops.

794 字 阅读 ➔
AI API Suffixes: What They Mean and Why They Exist
Engineering Practice · 2026-04-14 · 10 分钟

AI API Suffixes: What They Mean and Why They Exist

We often see URLs like these: 1 2 3 /v1/chat/completions /v1/messages /v1/responses These suffixes are not decoration — they define a complete request and response data structure. Pick the wrong one and your code either errors out or silently loses data. This article starts at /v1/completions and works its way to /v1/responses, explaining what each suffix stands for, why it was designed that way, and where the common pitfalls are.

1969 字 阅读 ➔