maintaining-claude-code
Maintaining Claude Code
Validate, organize, and improve Claude Code configurations.
Modes of Operation
Audit Mode
Use when: Checking config quality, validating skills work
Checklist:
- CLAUDE.md: Specific, structured, actionable
- Skills: Valid YAML, good descriptions (What + When formula)
- Commands: Clear purpose, not duplicating skills
- Hooks: Proper exit codes, reasonable timeouts
Organize Mode
Use when: .claude directory is messy, too many similar skills
Guidelines:
- Split CLAUDE.md into rules when >150 lines
- Consolidate similar skills (don't have 3 "code review" skills)
- Use subdirectories in rules/ for large projects
Advise Mode
Use when: Deciding what entity type to create
Decision tree:
- Needs to run automatically before/after actions? -> Hook
- Claude should auto-detect and use? -> Skill
- Needs isolated context for heavy work? -> Skill with
context: fork - Always-on behavioral guidance? -> CLAUDE.md
- Path-specific rules? -> .claude/rules/
Quick Reference
Entity Type Decision Matrix
| Need | Best Entity | Alternative |
|---|---|---|
| Global behavior guidelines | CLAUDE.md | Rules if >150 lines |
| Path-specific rules | .claude/rules/ | CLAUDE.md if universal |
| Auto-detected capabilities | Skills | Rules if always-on |
| Heavy isolated workflows | Skills (context: fork) | Regular skill |
| Pre/post action validation | Hooks | Nothing else does this |
| External API integration | MCP Servers | Bash calls if simple |
Skill Description Formula
<What it does>. Use when <trigger1>, <trigger2>, or <trigger3>.
Good: "Extract text and tables from PDF files. Use when working with PDFs, forms, or document extraction."
Bad: "Helps with documents"
YAML Validation
---on line 1 (required)name:max 64 charsdescription:max 1024 chars, must include triggers---before content
Common Anti-Patterns
- Vague descriptions: "Helps with stuff"
- Nested references: SKILL.md -> REF.md -> DETAILS.md
- Overloaded skills: Does 5 unrelated things
- Missing triggers: No "Use when..." clause
Validation Steps
- Check YAML syntax in all skills
- Verify descriptions include trigger phrases
- Ensure no duplicate capabilities across skills
- Confirm CLAUDE.md content won't quickly grow stale
- Check hooks have reasonable timeouts
Resources
See REFERENCE.md for detailed examples and troubleshooting.
More from trevors/dot-claude
using-jj
Advanced jj/jujutsu workflows — revsets, absorb, evolog, op restore/undo, immutable_heads bypass, divergent-change resolution, jj split, parallel jj new, conflict-after-rebase, force-push recovery. Contains non-obvious rules (e.g., always `-m` to avoid editor) that prevent broken workflows. Skip for simple commit/push/rebase.
43claude-code-web-docker
Set up and use Docker in Claude Code for Web environments. Use when Docker builds fail with bridge/iptables errors, SSL certificate errors through proxy, or when working in containerized web environments.
28git-workflow
Git version control workflows. Load when hook output shows vcs=git (not jj). Use when squashing commits, rebasing feature branches, or doing git operations in non-jj repos.
27whisper-test
Transcribe WAV audio files using OpenAI Whisper for intelligibility testing. Use when transcribing audio, testing speech output quality, running whisper, or checking if generated audio is intelligible.
27monitoring-ci
Monitor and watch GitHub Actions CI/CD pipeline runs in real time. Use when the user has pushed code and wants to watch the build, check CI status, see if tests passed, monitor a pipeline, or wait for a workflow run to complete. Also use after any `jj git push` or `git push` command. Reports pass/fail with failed job logs. Do NOT use for writing or editing CI workflow YAML files, optimizing CI config, or debugging CI configuration — only for monitoring active runs.
2cleaning-commit-history
Reorganize and clean up messy commit history on a feature branch into logical, reviewable commits. Use when cleaning up commits, preparing a branch for review, separating formatting from logic changes, fixing broken intermediate states, or squashing WIP commits.
2