一、核心导读与编译背景
本篇专栏由 ClaudeBan 全自动技术情报爬虫 定时抓取并编译自海外开发者社区 DEV.to(作者:The Agent Runbook,原文标题:3 Claude Code patterns: read-only subagents, Haiku routing, and hooks that block with exit code 2 ↗)。
核心内容速览:大多数Claude Code设置都停留在CLAUDE.md文件上。较大的杠杆位于一层:子代理...
二、原文核心技术观点与实战拆解
大多数Claude Code设置都停留在CLAUDE.md文件上。较大的杠杆位于一层:具有锁定工具的子代理,每个代理模型的选择,以及执行规则而不是好好询问的钩子。以下是您今天可以粘贴到存储库中的三种模式,每种模式都带有通常会咬人的陷阱。
原文摘录:Most Claude Code setups stop at a CLAUDE.md file. The bigger levers sit one layer down: subagents with locked-down tools, per-agent model choice, and hooks that enforce rules instead of asking nicely. Here are three patterns you can paste into a repo today, ea
以下所有内容均于2026年10月根据官方Claude Code文档( code.claude.com/docs )进行了检查。CLI变化很快,因此如果字段已移动, claude --help和文档将获胜。
原文摘录:Everything below was checked against the official Claude Code docs (code.claude.com/docs) in October 2026. The CLI changes quickly, so if a field has moved, claude --help and the docs win.
模式1 :实际上无法编辑文件的审阅者子代理
原文摘录:Pattern 1: a reviewer subagent that physically cannot edit files
原文配置与代码片段参考
---
name: reviewer
description: Read-only code reviewer. Use proactively after code changes to flag bugs, security issues, and convention drift.
tools: Read, Grep, Glob
model: sonnet
---
You are a senior reviewer. Report findings by severity with file:line
citations. You have no write tools. Return a findings list for the main
agent to act on; do not try to fix anything yourself.
三、ClaudeBan 国内工程落地与防封安全建议
- 终端防泄漏必检:在本地运行 Claude Code 或任何 MCP 插件前,请先执行
npx claudeban确认终端环境变量与出口 IP 处于绿色合规区。 - 高频调用隔离:若本文涉及长上下文或多轮 Agent 自动迭代,请优先通过
export ANTHROPIC_API_KEY="sk-ant-..."走官方 API 计费通道,避免触发消费级账号的并发风控阈值。