A structured markdown syntax for iterating on documents with Claude AI
Configure Claude to automatically check for iteration markers before committing changes.
⚠️ Important: Claude may occasionally skip these checks, especially during complex tasks or long conversations. If markers slip through, you can always clean them up in a follow-up commit. Consider combining this with Git Hooks or CI/CD checks as a backup.
Add this to your project’s .claude.md file:
## ⛔ MANDATORY: Pre-Commit Marker Check
**Before ANY commit, you MUST:**
1. Scan ALL staged files for iteration markers (`%% %%`, `•%%> <%%•`, `==(TOKEN)==`)
2. If markers found, STOP and report:
- "Found X markers in Y files. Clean up before commit? (yes/no)"
3. If user says "yes", follow cleanup process from skill
4. If user says "no", proceed with commit (markers will be committed)
5. NEVER commit without checking first
**This is NOT optional. Skipping this check is a failure.**
Iteration markers are meant for the drafting process - they shouldn’t end up in committed files (unless intentionally). The pre-commit check catches:
%% comments %% and •%%>responses <%%• left in documents•%%> NOTE: <%%• context that was helpful during editing==highlights(TOKEN)== that weren’t cleaned upUser: “commit the docs”
Claude (correct):
Scanning for iteration markers...
Found 3 markers in 2 files:
- docs/api.md: 2 comments
- docs/setup.md: 1 highlight
Clean up before commit? (yes/no)
User: “yes”
Claude: Follows cleanup process, then commits clean files.
Claude (wrong):
Committed docs with message "Update documentation"
This is wrong because markers weren’t checked first.
This pre-commit check works alongside the Document Iteration Skill:
The skill’s cleanup commands (%%!CLEANUP!%%, “cleanup this file”) are for intentional cleanup during editing. The pre-commit check catches anything missed.