AI Programming
19 posts

Why Does AI Sometimes "Misbehave"?——Prompt Behavior Guidance Techniques
Deep dive into guiding AI behavior through prompts: from Few-shot examples to A/B testing, unveiling how Claude Code uses carefully designed prompts to turn an “impatient” AI into a “patient” one, and solving problems of AI being “over-eager” or “failing to ask when it should.”

Context Management - The Core Capability of AI Coding
An in-depth analysis of Claude Code’s five context management principles: budget setting, content preservation, transparent disclosure, circuit breakers, and conservative estimation - and how to manage 200K tokens like a professional organizer.

System Prompts——The "Director Behind the Scenes"
Deep dive into Claude Code’s system prompt architecture: segmented composition design, division of identity/tools/format/safety modules, and the secrets of model-specific tuning. Unveiling why the same request gets completely different response styles from Claude Code versus ChatGPT.

Agent Loop——How Does an AI's "Brain" Work?
Deep dive into Claude Code’s core Agent Loop: the complete lifecycle from user input to model response. Unveiling the query.ts state machine, tool execution orchestration, and continuation decision logic to understand how the AI coding assistant “thinks” and “acts.”

Different Models, Different "Scripts"——Model-Specific Tuning Revealed
Deep dive into how Claude Code tunes prompts for different models: differences between Claude 3.5 Sonnet and Claude 3 Opus, application of A/B testing in prompt optimization, and prompt version management.

How Do 40+ Tools 'Grow' onto an AI?
Deep dive into Claude Code’s tool system: how 40+ tools form an extensible capability architecture through unified interface contracts, three-tier filtering pipelines, and fail-closed defaults. From Tool.ts interface to buildTool factory, revealing the underlying mechanisms of AI tool calling.

Tool Execution Orchestration——The Art of Parallelism, Streaming, and Interruption
Deep dive into Claude Code’s tool execution orchestration mechanism: the complete permission checking flow, concurrent execution scheduling strategy, streaming progress propagation, and the implementation principles of user interruption.

Claude Code Is Not a CLI Tool, But a 'Living' System
A deep dive into Claude Code’s underlying architecture: why it’s not a traditional CLI tool but an intelligent system running in a ‘distributed state.’ From TypeScript to Bun runtime, three-tier architecture to Feature Flags, understand the core design philosophy of this AI coding assistant.

Reverse Engineering Claude Code's API Request Signing
An in-depth reverse engineering analysis of Claude Code’s API request signing mechanism, revealing how the cch hash and xxHash64 are implemented, the secrets of Bun’s runtime, and how Anthropic protects API calls with native code.

Claude Code Memory System: The Complete Guide to Making Your AI Assistant Remember Your Project
Deep dive into Claude Code’s memory mechanisms: Auto Memory vs CLAUDE.md, hierarchical memory structure, modular rules configuration, making your AI assistant truly remember your project habits.
