Claude Code Leaked, Learn from the Best 06

How Claude Code Prevents Attacks? Think of it as five concentric walls, each catching something the previous one missed. --- Wall 1: The Blocklist (Fastest, Dumbest) utils/permissions/dangerousPatterns.ts has a hardcoded set called DANGEROUS_BASH_PATTERNS: python, node, deno, ruby, perl, php, lua, npx bash, sh, zsh, fish, ssh eval, exec, env, xargs, sudo Before any bash tool … Continue reading Claude Code Leaked, Learn from the Best 06

Claude Code Leaked, Learn from the Best 05

How does Claude Code do compression/compaction? Every turn, you send the entire conversation history to the API. Long sessions accumulate hundreds of messages. Eventually you hit the context window limit and the API refusesyour request. Compaction is how Claude Code survives long sessions without hitting that wall. There are four distinct compaction strategies, each triggered … Continue reading Claude Code Leaked, Learn from the Best 05

Claude Code Leaked, Learn from the Best 04

Compare this claw code the original Claude Code repo. main.py is replacement of main.ts, what is missing: The original main.tsx was a full interactive terminal app — you typed prompts, saw streaming responses, used keyboard shortcuts, saw colored output. The Pythonmain.py is just a command-line tool you call once and it prints a result. The … Continue reading Claude Code Leaked, Learn from the Best 04

Claude Code Leaked, Learn from the Best 03

How does Claude Code execute codes and where it calls LLM? There are three Levels of "Sandbox" — From Weak to Strong Level 1: No Sandbox (what this codebase has) # just returns a string, never actually runs anything def execute_tool(name, payload): return f"Tool '{name}' would handle payload '{payload}'" Level 2: Soft Sandbox (basic subprocess … Continue reading Claude Code Leaked, Learn from the Best 03

Claude Code Leaked, Learn from the Best 01

Claude Code is the most powerful agent so far. Dive into its architect! First, Know Your Tools (commands.py, tools.py). You don't build the tools from scratch every time you open the toolbox — they're just sitting there, ready. In this codebase, that toolbox is a JSON file: reference_data/commands_snapshot.json ← list of ~150 commandsreference_data/tools_snapshot.json ← list … Continue reading Claude Code Leaked, Learn from the Best 01

Harness Engineering

What is harness engineering? It's about how agent systems wire tools, orchestrate tasks, and manage runtime context. Here is a repo, a clean-room reverse-engineering project that reconstructs the core patterns behind how Claude Code does harness engineering. GitHub - instructkr/claw-code: The fastest repo in history to surpass 50K stars ⭐, reaching the milestone in just … Continue reading Harness Engineering

Towards Continually Self-Improving AI by Zitong Yang Stanford Dissertation

The central idea of this paper is "A continually self-improving AI is one that, once created, can autonomously and continually improve itself better than its human creators can improve it." (P1) Continues acquiring knowledge into weights without forgetting (P2) Generates its own training signal - learning from it beats human-generated signals (P3) Can autonomously design … Continue reading Towards Continually Self-Improving AI by Zitong Yang Stanford Dissertation