Help us improve
Share bugs, ideas, or general feedback.
From dstoic
Creates, updates, or optimizes CLAUDE.md files following Anthropic best practices for project context, coding standards, and persistent memory management.
npx claudepluginhub digital-stoic-org/agent-skills --plugin dstoicHow this skill is triggered — by the user, by Claude, or both
Slash command
/dstoic:edit-claudeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**CREATE**: New CLAUDE.md file requested
Creates and refactors CLAUDE.md files following best practices for size, structure, and content organization. Includes memory hierarchy, 3-tier documentation system, and conditional rules.
Audits and restructures CLAUDE.md files to reduce token bloat and improve Claude compliance. Targets 2,500–3,500 tokens with a hard 5,000 limit.
Provides best practices for creating, updating, and auditing CLAUDE.md files including constraints, commands, architecture overviews, and bloat reduction for projects.
Share bugs, ideas, or general feedback.
CREATE: New CLAUDE.md file requested UPDATE: Modify existing CLAUDE.md (keywords: "update", "add", "modify", "change") OPTIMIZE: Improve token efficiency (keywords: "optimize", "reduce tokens", "improve")
Audit current content:
Apply compression techniques:
Remove anti-patterns:
Validate token efficiency: Aim for maximum signal, minimum tokens
See reference.md for optimization strategies and examples.
Gather context: Ask user for project details if missing:
Organize around WHAT/WHY/HOW:
Determine organization strategy (memory hierarchy):
Main CLAUDE.md (universal, <200 tokens ideal, <500 acceptable):
CLAUDE.md in project root (shared via git).claude/rules/ (modular, 100-300 tokens each):
python.md, javascript.mdfrontend/, backend/CLAUDE.local.md (personal, auto-gitignored):
~/.claude/CLAUDE.md (cross-project personal):
@imports (lazy-loaded reference):
@README, @docs/architecture.md@~/.claude/my-prefs.mdMemory load order (later overrides earlier):
Organization decision tree:
Universal vs Path-Specific Decision:
Keep in main CLAUDE.md:
Extract to .claude/rules/:
*.py, React for *.tsx)frontend/, backend/, infra/)python.md with paths: "**/*.py", bash-scripting.md with paths: "**/*.sh"Key principle: Cohesion and semantic grouping matter more than strict token limits. A well-organized 430-token CLAUDE.md with universal sections (Git 90 + Security 50 + Planning 45 + Style 200 = 385 tokens) is better than fragmenting conceptually related content across multiple files.
H1 = Project Name (required):
# Project Name — used by /switch, /save-context, /load-context for project identification# Praxis, # NanoVC — Control Repo, # GTD-PCM Control PlaneStructure content (token-efficient):
Include sanity marker (optional but recommended):
sanity check: [random-number]
Write file with appropriate sections based on user context
See reference.md § Templates for starter examples and § Modular Rules for .claude/rules/ patterns.
Claude Code enforces hard character limits on instruction files. Content beyond these limits is silently truncated with [truncated] appended — no warning to the user.
| Limit | Value | Source |
|---|---|---|
| Per file | 4,000 chars | MAX_INSTRUCTION_FILE_CHARS |
| Total across all files | 12,000 chars | MAX_TOTAL_INSTRUCTION_CHARS |
Loading order: Files are loaded walking from filesystem root to CWD. Once total budget is exhausted: "Additional instruction content omitted after reaching the prompt budget." — deeper files (closer to CWD) are the ones that get dropped.
Implications:
~/.claude/ → praxis root → repo → subfolder) shares the 12K budgetclaude --dump-system-prompt to verify what actually loadswc -c on each file in the chain to check headroomWhen creating/updating: Always check current chain total. Warn user if any file is >3,500 chars or chain total >10,000 chars.
npm test" not "Test the code"paths: glob patternsSTOP: Before creating new CLAUDE.md, answer YES/NO for each:
If ANY answer is NO: → STOP. Explain why inappropriate. → Recommend alternatives: README.md (docs), environment variables (secrets), direct request (one-time), .claude/rules/ (detailed guidelines) → EXIT immediately.
If ALL answers are YES: → Proceed to "Creating New CLAUDE.md Files" section above.
Keep main CLAUDE.md lean (<200 tokens). Distribute content:
Modular rules (.claude/rules/ - auto-loaded):
.claude/rules/
|- code-style.md
|- security.md
|- frontend/react.md
|- backend/api.md
Imports (lazy-loaded when referenced):
@README
@docs/architecture.md
@~/.claude/my-project-prefs.md
Reference docs (external):
reference/
|- runbooks/building.md
|- standards/conventions.md
Use /memory command during session to view/edit loaded memories.
See reference.md § Content Guidelines for inclusion/exclusion rules and anti-patterns.
See reference.md § Templates, § Modular Rules, and § Import Syntax for detailed examples.