Check and fix CLAUDE.md alignment with codebase
/plugin marketplace add akaszubski/autonomous-dev/plugin install autonomous-dev@autonomous-devOptional - skip argument to check current alignmentpython .claude/hooks/validate_claude_alignment.py
Check and fix drift between documented standards (CLAUDE.md) and actual implementation.
CLAUDE.md defines development standards. If it drifts from reality (outdated version numbers, wrong agent counts, missing commands), new developers follow incorrect practices.
This command:
# Check current alignment
/align-claude
# Or just run the validation script directly
python .claude/hooks/validate_claude_alignment.py
~/.claude/ should be reasonableplugins/autonomous-dev/agents/plugins/autonomous-dev/commands/❌ Example 1: Agent Count Drift
CLAUDE.md says: "Agents (7 specialists)"
Reality: 16 agents exist
Fix: Update to "### Agents (16 specialists)"
❌ Example 2: Outdated Version
CLAUDE.md Last Updated: 2025-10-19
PROJECT.md Last Updated: 2025-10-27
Fix: Update CLAUDE.md date to 2025-10-27
❌ Example 3: Missing Command
CLAUDE.md mentions: /auto-implement
Reality: Command file doesn't exist
Fix: Check if command was renamed or removed
# In CLAUDE.md, change:
# **Last Updated**: 2025-10-19
# To:
# **Last Updated**: 2025-10-27
# Change: ### Agents (7 specialists)
# To: ### Agents (16 specialists)
# Change: Done! All commands work: /test, /format, /commit, etc.
# To: Done! All commands work: /auto-implement, /align-project, /setup, /test, /status, /health-check, /sync-dev, /uninstall
# Old (outdated):
# ### Skills (6 core competencies)
# Located: `plugins/autonomous-dev/skills/`
# - python-standards: ...
# New (correct):
# ### Skills (0 - Removed)
# Per Anthropic anti-pattern guidance (v2.5+), skills were removed.
# Guidance now lives directly in agent prompts and global CLAUDE.md files.
This is also enforced by a pre-commit hook:
git commit -m "feature: add something"
# ↓
# Pre-commit hook runs validate_claude_alignment.py
# ↓
# If drift detected, warning shown:
# ⚠️ CLAUDE.md Alignment: Agent count mismatch...
# ↓
# Commit still proceeds, but you see the warning
# (You should fix it next commit or /clear)
# 1. See what's drifted
/align-claude
# Output shows specific issues
# 2. Update CLAUDE.md based on output
vim CLAUDE.md
# Fix version dates, counts, descriptions
# 3. Verify the fix
/align-claude
# Should show: ✅ CLAUDE.md Alignment: No issues found
# 4. Commit the alignment fix
git add CLAUDE.md
git commit -m "docs: update CLAUDE.md alignment"
Scenario: New Developer
New dev: "What commands are available?"
Reads CLAUDE.md: "/test, /format, /commit work great"
But: Those commands were archived in v3.1.0
With alignment checking:
→ CLAUDE.md always matches reality
→ Docs are never stale
→ Developers follow current practices
Validation is tested in:
plugins/autonomous-dev/tests/test_claude_alignment.py
Tests cover:
# Try directly:
python .claude/hooks/validate_claude_alignment.py
# If that fails, check path:
ls .claude/hooks/
Check what changed recently:
# See git diff
git diff plugins/autonomous-dev/agents/
# See git log
git log plugins/autonomous-dev/ | head -20
Maybe the codebase changed but CLAUDE.md wasn't updated.
That's intentional! It ensures CLAUDE.md stays in sync. If you see a warning:
To temporarily skip (NOT recommended):
git commit --no-verify
# But then manually run validation later
python .claude/hooks/validate_claude_alignment.py
Purpose: Prevent documentation drift, keep CLAUDE.md accurate, help new developers follow current best practices.
Frequency: Check whenever CLAUDE.md might be stale (after major updates, weekly cleanup).
Maintenance: Pre-commit hook validates automatically; you just need to fix warnings when they appear.