FD

fareedkhan-dev/claude-code-from-scratch

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

306 stars 质量 61 趋势 19MIT

fareedkhan-dev/claude-code-from-scratch 是从 https://github.com/fareedkhan-dev/claude-code-from-scratch. 导入的特工技能候选人

概览

fareedkhan-dev/claude-code-from-scratch 是从 https://github.com/fareedkhan-dev/claude-code-from-scratch. 导入的特工技能候选人

概述(AI 翻译)

利用线束工程构建Claude代码

对Claude Code架构的全面逆向工程——从最小代理循环构建到23会话生产系统。

这个仓库是建立在 learn-claude-code 之上


截至2026年初,Claude Code在发布六个月内年均收入突破10亿美元。它之所以能达到这一步,并不是因为更好的提示词。而是因为Anthropic围绕合适的模型构建了合适的框架——流式代理循环、权限控制的工具调度系统,以及一个上下文管理层,使模型在任意长的会话中保持聚焦。这种框架是完全可复现的。这个仓库构建了它。


建筑概述


什么是安全带工程?

束缚工程是构建环绕人工智能模型的环境的学科——而非模型本身。模型负责推理和决策。束缚负责执行、约束和连接。

定义优秀线束工程的四个原则:

  • 模型是唯一的决策来源——框架从不分支模型输出,只执行模型请求的操作

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。


As of early 2026, Claude Code crossed $1 billion in annualized revenue within six months of launch. It did not get there because of better prompts. It got there because Anthropic built the right harness around the right model — a streaming agent loop, a permission-governed tool dispatch system, and a context management layer that keeps the model focused across arbitrarily long sessions. That harness is fully reproducible. This repository builds it.


Architecture Overview


What is Harness Engineering?

Harness engineering is the discipline of building the environment that surrounds an AI model — not the model itself. The model reasons and decides. The harness executes, constrains, and connects.

Four principles define good harness engineering:

  • The model is the only source of decisions — the harness never branches on model output, it only executes what the model requests
  • Tools are the only interface between the model and the world — every action goes through a typed, schema-validated tool call
  • Context is a managed resource — what the model sees at each turn is curated, compressed, and injected deliberately
  • Permissions are declarative, not procedural — what is allowed, blocked, or requires approval lives in configuration, not code

Repository Structure

claude_code_push_this/
│
├── core.py                          # Single source of truth — all tools, dispatch, permissions
│
├── 01_perception_action_loop.py     # The minimal while loop
├── s02_tool_use.py                  # Tool dispatch map pattern
├── s03_todo_write.py                # TodoWrite planning before execution
├── s04_subagent.py                  # Subagent context isolation
│
├── s05_skill_loading.py             # On-demand skill loading
├── s06_context_compact.py           # Three-layer context compression
├── s07_task_system.py               # File-based task dependency graph
│
├── s08_background_tasks.py          # Background task execution
在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add fareedkhan-dev/claude-code-from-scratch
新手?先看 mcpskill.org 教程 →