Claude Code 会自动读取 AGENTS.md 吗?
默认只自动加载 CLAUDE.md。在仓库根目录放一个包含 @AGENTS.md 的极简 CLAUDE.md,即可让 Claude Code 每次启动自动导入 AGENTS.md。
将现有 AGENTS.md 快速适配为 Claude Code 可用的 CLAUDE.md(支持完整转换或零漂移 @AGENTS.md 指针模式),并实时校验 40,000 字符截断红线。
# CLAUDE.md Canonical engineering rules for our Python 3.12 data pipeline managed with `uv`, tested with `pytest`, and checked with `ruff` + `pyright`. ## Commands - Sync environment: `uv sync --dev` - Fast unit check: `uv run pytest tests/unit/test_ingest.py -x -q -m "not slow"` - Full test suite: `uv run pytest -q` - Lint & types: `uv run ruff check . && uv run pyright` ## Hard Boundaries - Don't invoke global `python` or `pip`. Instead prefix commands with `uv run`. Because host Python versions diverge from `pyproject.toml`. - Don't silence errors with bare `except Exception: pass`. Instead re-raise or log structured context. Because silent fallbacks hide broken ETL rows. - When editing connectors, read `docs/connectors.md` before modifying schemas. ## Continuity - Keep `.env` out of git and record passing test counts in `HANDOFF.md`.
| 文件 | 读取工具 | 推荐放什么 | 同步策略 |
|---|---|---|---|
| AGENTS.md | Codex CLI, Cursor, Copilot, Windsurf | 项目事实、构建/测试命令、包管理器约束、架构与安全边界 | 唯一真源 |
| CLAUDE.md | Claude Code | @AGENTS.md 导入 + .claude/settings.json hooks、skills、权限说明 | @AGENTS.md |
| .cursor/rules/*.mdc | Cursor Agent & Inline Edit | 带 globs: 的按目录/文件类型局部规范(UI、SQL、测试等) | 按 glob 挂载 |
| .github/copilot-instructions.md | GitHub Copilot | 指向 AGENTS.md 或同步后的精简仓库规范 | 指针 / CI 校验 |
| GEMINI.md | Gemini CLI | @AGENTS.md 导入 + Gemini 专属工具提示 | @AGENTS.md |
默认只自动加载 CLAUDE.md。在仓库根目录放一个包含 @AGENTS.md 的极简 CLAUDE.md,即可让 Claude Code 每次启动自动导入 AGENTS.md。
有。Claude Code 源码中的 MAX_MEMORY_CHARACTER_COUNT = 40000 会在超过 40,000 字符时静音截断(规则 I7)。转换器会实时显示字符数与得分。
直接复制 TypeScript、Python、Next.js、FastAPI、Rust、Go、Vue、Monorepo 高分起步模板。
查看中位数 132 行、37 个超 40K 截断案例与 58% Actions 未锁 SHA 的全量数据。
看 VS Code、Next.js、uv、Bun 等顶级开源项目的 CLAUDE.md / AGENTS.md 实测评分。