AnvilCode — AI skill for Claude Code
:AnvilCode是面向开发者的本地 AI Agent 平台,提供守护进程 + 终端 TUI 客户端架构,实现多 Agent 协作、工具调用和 LLM 流式处理.
How to install AnvilCode
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open czydyq/AnvilCode and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What AnvilCode does
:AnvilCode是面向开发者的本地 AI Agent 平台,提供守护进程 + 终端 TUI 客户端架构,实现多 Agent 协作、工具调用和 LLM 流式处理。用户通过终端与守护进程交互,Agent 可循环调用 Claude API、执行工具,并将事件实时推送至前端渲染。项目从零开发至 支持 Skills、MCP 协议和多客户端同时连接同一 session。
Alternatives in AI
- Deepreasoning — A high-performance LLM inference API and Chat UI that integrates DeepSeek R1's CoT reasoning traces with Anthr 5.4k ★
- Rb Setup — First-time setup 1.3k ★
- Tokentap — Intercept LLM API traffic and visualize token usage in a real-time terminal dashboard 763 ★
README
AnvilCode
**本地 AI Agent 运行时** —— 把「用户目标 → Agent Loop → 模型推理 → 工具调用 → 结果回填 → 事件展示 → 会话续航」整条链路做成一个可运行、可观测、可干预的工程实现。
不是"调大模型 API 的脚本",也不是单进程 demo。`anvil-core` 是常驻守护进程,CLI 和 TUI 是它的客户端,三者通过类型化 JSON-RPC 协议通信。
**设计和动机的完整论证见 [DESIGN.md](DESIGN.md)** —— 为什么做(动机与失效模式)、业界方案对比、每条设计决策解决什么问题、以及用实验逐条取证的闭环核对。
anvil / anvil-tui ──JSON-RPC 2.0 over NDJSON──▶ anvil-core (daemon)
│ │
└──────────── event.subscribe ◀────────────────────┘
为什么拆双进程
单进程 demo 能跑通 Agent Loop,但后面每个能力都会被架构卡住。一开始就把边界立住,换来的是:
- 客户端崩溃不带崩任务 —— 守护进程继续跑,重连后
replay_from_run能补齐历史事件 - 多前端复用同一套通道 —— CLI、TUI、未来的 Web 复用同一个 Core
- 协议边界强制契约化 —— IPC 是进程边界,字段漂移是分布式系统里最贵的一类 bug
- 执行过程可订阅 —— token 流、工具调用、权限审批都走同一条事件流
分层架构
flowchart TB
subgraph L1["入口层"]
A1["用户目标
goal / chat / slash"]
A2["anvil CLI
run / chat / trace"]
A3["anvil-tui
终端实时交互"]
end
subgraph L2["协议层"]
B1["JSON-RPC 2.0
命令 / 响应 / 通知"]
B2["NDJSON over TCP
逐行帧传输"]
B3["event.subscribe
topic / scope 订阅"]
end
subgraph L3["运行时核心层"]
C1["anvil-core daemon
常驻执行体"]
C2["SocketServer
连接与消息分发"]
C3["CoreApp
命令路由入口"]
C4["SessionManager
session / run 生命周期"]
C5["AgentRunner
组装上下文 / 模型 / 工具"]
end
subgraph L4["Agent 能力层"]
D1["AgentLoop
think → tool_use → observe"]
D2["LLM Provider
stream / retry / prompt cache"]
D3["ToolRegistry
工具注册 / 发现 / 路由"]
D4["内建工具
read / write / list / bash"]
D5["任务工具
task_create / update / list"]
end
subgraph L5["治理与记忆层"]
E1["Pydantic 校验
工具参数边界"]
E2["PermissionManager
allow / deny / always"]
E3["thread.jsonl
完整消息回放"]
E4["notes.md
Agent 自留事实"]
E5["context / compact
上下文水位与压缩"]
end
subgraph L6["扩展生态层"]
F1["Skills
slash / prompt / 工具白名单"]
Related Skills
Pi Extensions
Nick Nisi's pi extensions — a pnpm monorepo of independently installable pi packages (@nicknisi/pi-). TUI poli
Pi Rs
AI agent toolkit rewritten in Rust: unified LLM API, agent runtime, TUI, coding agent CLI, Slack bot, web UI,
Pi Mono 1
AI agent toolkit: coding agent CLI, unified LLM API, TUI & web UI libraries, Slack bot, vLLM pods
AutoSearch
new Self-evolving deep research plugin for Claude Code -- 32 dedicated search channels (arXiv, GitHub, Reddit,
Google Jules Skill
Control Google Jules sessions via REST API and CLI, enabling session management, status checks, instructions,
Deterministic Agent Control Protocol
Governance gateway for AI agents — bounded, auditable, session-aware control with MCP proxy, shell proxy & HTT
Related Agents
Protocol Parity
Cross-references the lockstep surfaces a protocol must touch (TUI ScreenId, admin route, live broker/session w
Forge Visual Verifier
Perceptual gate for spec [visual] acceptance criteria. Drives Playwright MCP (navigate + take_screenshot + eva
LLM MCP
Engineer of redbar's AI surface — the MCP server, the handoff that hands the gap to the agent to write the tes