A skill for modularizing and managing AGENTS.md / CLAUDE.md separately.
Place the actual file on the AGENTS.md side, andCLAUDE.md は AGENTS.md set it as a symbolic link toAGENTS.md is a standard filename commonly used by multiple AI tools).
Basic Principles
- AGENTS.md / CLAUDE.md is recommended to be 50 lines or fewer (the official recommendation is 200 lines or fewer). Modularize details into
rules/or skills and split them up. - In CLAUDE.md, write only paths and purpose references.
Structure of CLAUDE.md
Include the following sections as needed.
- Title / Overview (1-2 lines)
- Directory structure (if there are subdirectories)
- Rules (reference links)
- Other settings specific to that directory
Description Format
Directory Structure Section
## ディレクトリ構成
- `ディレクトリ名/` — 責務の説明。どういう時に使うか
Example:
- `docs/` — 外部参考資料。ガイドライン参照や資料確認時に使う
- `rules/` — 投稿パターン・記事ルール・日々のルーティン
- `posts/` — 投稿の下書き・記録(日付フォルダで管理)
A single file uses the same format:
- `ME.md` — 代表者・会社プロフィール。自己紹介が必要な時に参照する
Rules section
## ルール
- `rules/ファイル名.md` — そのルールの目的
Example:
- `rules/post_patterns.md` — 投稿パターン集・禁止表現・作成ルール
- `rules/writing_rules.md` — 文章の書き方ルール
Workflow
Creating a New CLAUDE.md
- Describe the responsibility of that directory in 1-2 lines.
- If there are subdirectories, add a "Directory Structure" section.
- If there is rules/, add a "Rules" section.
- 50 lines or fewer is recommended. If it exceeds that, consider modularizing.
When Adding a Rule
- Write detailed rules in
rules/ファイル名.md. - In the "Rules" section of CLAUDE.md,
ファイルパス— Purpose: Add one line of - Do not write details directly in CLAUDE.md.
Handling When the Line Count Is Exceeded
- Move the detailed explanation to
rules/. - Leave only reference links in CLAUDE.md.
- Consolidate duplicate descriptions.
When a New Rule File or Directory Is Created
- In the CLAUDE.md of that directory,
パス— Add one line of description. - Check whether it also needs to be reflected in the root AGENTS.md, and add it if necessary.
- New top-level directory → add to "Directory Structure" in AGENTS.md
- Subdirectory or rule file → add to the CLAUDE.md of the corresponding directory
Reference Materials
- https://code.claude.com/docs/en/memory — Claude Code official documentation (recommended 200 lines or fewer, split at
@pathimport,.claude/rules/) - https://addyosmani.com/blog/agents-md/ — hierarchical architecture, split at
rules/, minimal description recommended - https://www.humanlayer.dev/blog/writing-a-good-claude-md — recommended fewer than 300 lines, modularization via file references
- https://nyosegawa.com/posts/harness-engineering-best-practices-2026/ — recommended 50 lines or fewer, module splitting, explanation of reduction criteria
Notes
- Do not write detailed rules or procedures directly in CLAUDE.md.
- 「
パス— Always follow the format of "Description" - The root AGENTS.md must clearly state: "Before working, always read the CLAUDE.md and rules/ in the corresponding directory"
- After creating a new file or directory, always update the corresponding CLAUDE.md / AGENTS.md