來源較早收集於 3h

Claude Code 的 Python 完整重製

PostLinkedIn
🤖閱讀原文: Reddit r/MachineLearning
#agentic-loop#local-models#reverse-engineeringclaw-code-agentclaude-codeqwen3-coder-30bollamavllm

💡開源 Python Claude Code 代理支援本地 LLM – 完全可修改!(24字元)

⚡ 30 秒速覽

有什麼變化

Claude Code 架構的純 Python 重建

為什麼重要

讓 Python 開發者能免費本地運行可擴展的 Claude 式編碼代理,避開專有堆疊並促進社群貢獻。

下一步行動

Clone https://github.com/HarnessLab/claw-code-agent 並用 Ollama 測試 Qwen3-Coder-30B。

誰應關注:Developers & AI Engineers

關鍵要點

  • Claude Code 架構的純 Python 重建
  • 本地模型支援:vLLM、Ollama、LiteLLM
  • 工具包含檔案操作、glob、grep、shell
  • 分級權限與斜線指令
  • GitHub 儲存庫開放 PR 與 issue

🧠 深度解析

本篇為 AI 生成分析,非原文內容。

🔑 增強重點摘要

  • HarnessLab's implementation utilizes a modular 'Tool-Use' architecture that decouples the agent's reasoning engine from the execution environment, allowing for hot-swapping of inference backends without modifying the core agent logic.
  • The project specifically addresses the 'context window bottleneck' found in original Claude Code by implementing a custom sliding-window memory management system that optimizes token usage for long-running coding sessions.
  • Initial community benchmarks indicate that while Qwen3-Coder-30B-A3B-Instruct is the recommended model, the agent's performance is highly sensitive to system prompt engineering, with HarnessLab providing a specialized 'system-prompt-optimizer' utility to tune local model behavior.
📊 競品分析▸ Show
FeatureClaw Code AgentClaude Code (Official)OpenDevin (OpenHands)
Model SupportLocal (vLLM/Ollama/LiteLLM)Anthropic API OnlyAgnostic (Local/Cloud)
ArchitecturePython ReimplementationProprietary/ClosedModular/Extensible
PricingFree (Open Source)Usage-based (Anthropic)Free (Open Source)
BenchmarksHigh (Model Dependent)State-of-the-artVariable

🛠️ 技術深入

  • Inference Abstraction: Uses LiteLLM as a unified interface layer, enabling the agent to interact with any OpenAI-compatible API endpoint.
  • Execution Sandbox: Implements a restricted shell environment using Python's subprocess with strict timeout and permission controls to mitigate arbitrary code execution risks.
  • State Persistence: Employs a local SQLite database to store session history, tool call logs, and file state, allowing for seamless resumption of interrupted coding tasks.
  • Tooling Interface: Utilizes a JSON-schema-based tool definition system that maps natural language requests to specific Python functions (e.g., read_file, write_file, run_command).

🔮 前景展望基於引用來源的 AI 分析

Local-first coding agents will achieve parity with cloud-based agents in complex refactoring tasks by Q4 2026.
The rapid optimization of local models like Qwen3-Coder and the modularity of projects like Claw Code Agent are closing the reasoning gap previously held by proprietary cloud models.
Enterprise adoption of open-source coding agents will increase due to data privacy requirements.
Companies are increasingly prioritizing local execution environments to ensure proprietary source code never leaves their internal infrastructure.

時間線

2026-03
HarnessLab initiates reverse-engineering of Claude Code architecture.
2026-04
Public release of Claw Code Agent on GitHub.
📰

AI 週報

閱讀本週精選 AI 大事摘要 →

👉相關動態

AI 策展新聞聚合。所有內容版權歸原始發布者所有。
原始來源: Reddit r/MachineLearning

這是摘要,不是原文。去看原站,或訂閱每週簡報。

每週電子報

每週一封,可隨時退訂。