惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
G
Google Developers Blog
H
Help Net Security
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
D
Docker
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
博客园 - 司徒正美
Last Week in AI
Last Week in AI
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence

V2EX

我用 AI 写代码,但终端管理反而成了累赘——于是我做了 codux [调研] 各位在公司都用什么 ide 和 agent 写代码? 老运维 share 一个运维平台 看到有公司考核 token 指标,很好奇大家上个月的 AI 账单是多少 GLM-Coding 调用持续报错: z.ai 的 Lite 套餐几乎无法使用,官方 Pro/Max 是否稳定? 现在还有什么渠道可以稳定安全地使用 Claude 吗? 上海漕河泾内推,本组有 2 个 hc,一个后端,一个前端,预算都是 20k 左右,不打卡,氛围好 如果 V2EX 上有一组不永久保存聊天记录(比如只保存 7 天或者 24 小时)的聊天室,那么会开启哪些有用或者有趣的可能? gemini cli 貌似挂了,一直返回 403 第一次在自媒体上赚到钱 收集了最近在使用的低价 GPT, Gemini,邮箱等 AI 会员的小店合集 讨论个大实话:现在企业还在说 AI 编程提效 20%, 30%的,真的太落后,没用懂 AI。因为包括很多前沿公司,已经狂奔到提效 200%-500%的情况 [招聘][远程][币安] 前端/后端/QA/iOS/Android 至少 3 年以上经验 目前有大量 HC 欢迎投递 Chatgpt Pro 用量用不完的可以开这些设置 面试的时候好像遇到钓鱼了,给各位避个坑 cursor 年续费 22 号到期, 自动续费是否还是老的计次套餐呢 被两件破事毁掉的一下午,琐碎的内耗消磨人的精力 使用 Planet 存储 Codex 的会话或者重要信息 如果业务部门领导不要你开发功能,而是要求你教会它用 claude code 开发功能,你会怎么做? 分享一个 MacOS 接绿联 CM818 USB 转 DP 转接器使用感受 我的 HR 朋友 10 年老 Java ,非全大专,大家帮忙看看简历 开源了一个 AI 口语练习工具,音素级发音评分,完全免费可自部署 V2EX 上有哪些你觉得很有趣、印象深刻的妹纸? 字节为啥不出个国内版 Vercel? 有在大马的朋友吗? 问个运营商问题 你们在有领导的公司大群发过的最大胆的消息是什么 公司裁员,目前没有工作。想试试摆摊,做一个移动鲜啤打酒车 我的硬盘 Memblaze Pblaze 5 Linux 下不识别,给 Linux 内核提交了补丁, AI 说有望被合并 只有我一个人觉得 codex 不好用?
I built Claude Code-lite, a small local-first coding agen...
goozi · 2026-04-01 · via V2EX

Today, I came across the leaked Claude Code CLI source package.

My first reaction was that it was probably just another joke. After checking it, it turned out to be real. I downloaded the package and spent some time reading through it.

The obvious part is the legal and ethical boundary: leaked source should not be republished. That part is not ambiguous.

But after reading it, I also felt there were a lot of runtime ideas worth studying:

  • how a coding agent CLI can support TUI, REPL, and headless modes
  • how query loop and tool loop are organized
  • how tool calling is modeled
  • how session and transcript are persisted
  • how permission checks are treated as runtime behavior instead of UI-only prompts
  • how provider abstraction is done
  • how resume/export/cleanup make the CLI usable over time

So instead of republishing anything, I built a small project from scratch based on what I learned from those runtime patterns:

Claude Code-lite
GitHub: https://github.com/goozi/claude-code-lite

What it is

This is not a Claude Code clone.
It is not an open-source replacement.
And it is definitely not a repackaged version of leaked code.

The project is positioned as:

a small, hackable, local-first coding agent CLI runtime for learning and extension

The goal is to keep the codebase small enough to read and modify, while still being structurally useful for people building their own coding agents.

What it currently includes

Current version supports:

  • TUI, REPL, and headless chat entry points
  • OpenAI-compatible and Anthropic providers
  • streaming output
  • tool loop
  • transcript and session index
  • resume / inspect / export / cleanup flows
  • permission confirmation and session-scoped allow rules
  • packaging as a standalone executable, without requiring Node.js on the target machine

So this is already beyond a toy skeleton. It is a minimal usable agent CLI.

Why I made it

A lot of agent projects fall into one of two buckets:

  • too small to teach anything beyond “LLM + tools”
  • too large and productized to be easy to study

I wanted something in the middle:

  • small enough to understand
  • structured enough to learn from
  • practical enough to extend into your own runtime

If you are working on:

  • coding agents
  • local-first agent runtimes
  • tool calling architecture
  • session/transcript systems
  • terminal-first AI workflows

then this repo might be useful as a reference point.

What I think is interesting technically

The parts I care most about in this repo are not UI polish. They are runtime boundaries:

  • query() and turn lifecycle
  • tool protocol design
  • permission engine
  • provider abstraction
  • session/transcript management
  • multi-entry CLI structure

That is also why I wrote extra docs around architecture and core interfaces, instead of only shipping code.

What it is not trying to do

At least for now, I am explicitly not trying to build:

  • a full Claude Code clone
  • a feature-complete autonomous agent product
  • a marketplace/plugin ecosystem
  • a huge abstraction-heavy framework

I would rather keep it readable than prematurely complete.

Planned next steps

Likely next areas:

  • stronger architecture docs
  • unified error model
  • tool result budgeting
  • minimal MCP support
  • minimal subagent implementation
  • focused tests for provider adapters and session metadata

Repo

GitHub:
https://github.com/goozi/claude-code-lite

If you are building something similar, I would be interested in feedback on the runtime structure, especially around provider abstraction, permissions, and session lifecycle.