Sync issues
Common problems when running aligntrue sync and how to fix them.
Config not found
Error:
✖ Configuration file not found: .aligntrue/config.yaml
Run 'aligntrue init' to set up your project first.Cause: Haven’t run aligntrue init yet, or config file was deleted.
Fix:
# Initialize the project
aligntrue initIf you deleted config by accident, recreate it and include at least one rule file:
# .aligntrue/config.yaml
mode: solo
exporters:
- cursor
- agents
sources:
- type: local
path: .aligntrue/rules/# .aligntrue/rules/global.md
## defaults
- Keep project rules consistentSource file not found
Error:
✖ Source file not found: .aligntrue/rules
Check 'sources' in .aligntrue/config.yaml
Hint: Create `.aligntrue/rules/*.md` or update source pathCause: Rules file doesn’t exist or path is wrong in config.
Fix:
1. Create missing rules file:
mkdir -p .aligntrue
# Create a minimal rule file (must be .md with headings)
cat > .aligntrue/rules/global.md <<'EOF'
## defaults
- Keep project rules consistent
EOF2. Fix path in config:
# .aligntrue/config.yaml
sources:
- type: local
path: .aligntrue/rules/ # Directory of .md rule files3. Verify file exists:
ls -la .aligntrue/rulesAlign sections missing after sync
Symptoms:
- Added align appears in
aligntrue syncoutput, butAGENTS.mdand.cursor/rules/*.mdcfiles never show the new sections. - Running
aligntrue syncrepeatedly keeps overwriting align content with older exports.
Cause: Aligns must be authored in .aligntrue/rules/*.md with ## headings. Agent exports (AGENTS.md, .cursor/rules/*.mdc) are read-only; editing them or omitting the source file leaves nothing to re-export.
Fix:
- Ensure the align file lives in
.aligntrue/rules/*.mdand the directory is listed undersourcesin.aligntrue/config.yaml. - Use
##or deeper headings; level-1 (#) is treated as the document title and is ignored for sections. - Re-run
aligntrue sync— exports are regenerated from the source rules and will include the align sections.
Still not seeing the sections? Run aligntrue sync --verbose to confirm the align was merged and check the file listed under “Sources merged”.
Lockfile drift (team mode)
Error (drift command):
aligntrue drift --gates
# ✖ Lockfile drift detected
# Expected: a3b2c1d4...
# Actual: e5f6a7b8...
#
# Exit code: 1Cause: Rules changed since lockfile was last generated.
Note: aligntrue sync automatically updates the lockfile. Use aligntrue drift --gates in CI to enforce lockfile validation.
Fix:
1. Intentional changes - regenerate lockfile:
# Sync regenerates the lockfile automatically
aligntrue sync
# Commit the updated lockfile
git add .aligntrue/lock.json
git commit -m "chore: update lockfile"2. Unintentional changes - review diff:
# Check what changed
git diff .aligntrue/rules
# Revert unwanted changes
git checkout .aligntrue/rules
# Sync again
aligntrue sync3. Team workflow - pull latest:
# Get latest lockfile from team
git pull
# Sync to your agents
aligntrue syncChange lockfile mode:
# .aligntrue/config.yaml
lockfile:
mode: soft # Warn but continue (default in team mode)
# mode: strict # Block on mismatch (recommended for CI)
# mode: off # Disable validation (solo mode)Exporter failures
Error:
✖ Exporter 'cursor' failed: Invalid configuration
Output path must be a string, got undefinedCause: Exporter configuration missing or invalid.
Fix:
1. Check exporter is enabled:
# .aligntrue/config.yaml
exporters:
- cursor # Make sure it's listed2. Validate IR schema:
# Check rules are valid
aligntrue md lint3. Check exporter manifest:
# List available exporters
aligntrue exporters list
# Verify cursor is in the list4. Reset to defaults:
# .aligntrue/config.yaml - minimal working config
mode: solo
exporters:
- cursor
- agents
sources:
- type: local
path: .aligntrue/rulesAgents not reading rules
Symptoms: Cursor ignores .mdc updates, Copilot/Claude responses look generic, or MCP actions cannot find AlignTrue rules.
Fix:
aligntrue status— confirm the exporter shows✓ detected, the edit sources match the file you are editing, and the config path is correct.aligntrue doctor— verify it reports the expected files (e.g.,.cursor/rules/*.mdc,AGENTS.md,.vscode/mcp.json) as present.- Open the file the exporter wrote and confirm your latest rules are there. If not, re-run
aligntrue sync. - Restart the agent or IDE so it reloads the file. Most IDE agents cache
AGENTS.mdor MCP configs until restart.
See the agent verification guide for agent-specific screenshots and command references.
Why aren’t my new files syncing?
Symptom: You added new rule files (e.g., testing.md, security.md) to .aligntrue/rules/ but they’re not showing up in sync.
Causes:
- Files not in
.aligntrue/rules/directory (most common) - Files have no content or sections
Fix:
-
Verify file is in the rules directory:
ls -la .aligntrue/rules/Rules must be stored in
.aligntrue/rules/with.mdextension. This is the single source of truth. -
Verify file has content:
# File must have markdown headings (## or ###) cat .aligntrue/rules/testing.mdIf the file is empty or has no headings, AlignTrue won’t detect sections.
Missing sections after sync
Symptom: After syncing, some sections from your files are missing in the output.
Causes:
- Duplicate sections (first-wins precedence applied)
- Files not detected as edited
- Parse errors in markdown
Fix:
-
Check for conflicts:
aligntrue sync --verboseLook for warning messages about duplicate sections.
-
Review drift log:
cat .aligntrue/.drift-log.jsonShows which files were detected and their status.
-
Check file modification times:
ls -la AGENTS.md .cursor/rules/*.mdcOnly files modified since last sync are processed.
-
Force a full re-import:
# Remove drift log to reset rm .aligntrue/.drift-log.json # Run sync aligntrue sync
Duplicate sections in output
Symptom: The same section appears multiple times in exported files.
Causes:
- Same section in multiple source files
- Different headings that look similar
Fix:
-
Identify duplicates:
# Check duplicate headings in source rules rg "^## " .aligntrue/rules | sort | awk -F: '{print $3}' | sort | uniq -c | grep -v "^ *1 " || true -
Remove duplicates from source files:
nano .aligntrue/rules/global.md # Remove or rename duplicate sections nano .aligntrue/rules/*.md -
Sync again:
aligntrue sync
AlignTrue’s behavior: When the same section appears in multiple files, first-wins precedence is applied (local rules always first, then external sources in order).
Sync shows no changes but files are different
Symptom: You edited files but aligntrue sync says “no changes detected.”
Causes:
- File not in
.aligntrue/rules/directory - File modification time not updated
- Editing read-only exports (agent files)
Fix:
-
Check if you edited the source file:
ls -la .aligntrue/rules/Edit files in
.aligntrue/rules/, not agent files like.cursor/rules/*.mdcorAGENTS.md. -
Verify agent files are read-only exports:
# Agent files have read-only warnings head -20 .cursor/rules/testing.mdc head -20 AGENTS.mdIf you see
<!-- WARNING: READ-ONLY FILE, edit.aligntrue/rules/instead. -
Touch file to update mtime if needed:
touch .aligntrue/rules/global.md aligntrue sync
Formatting issues in exported files
Symptom: Exported files have missing newlines or malformed markdown.
Example:
---### HeadingInstead of:
---
### HeadingCause: Source files have formatting issues.
Fix:
-
Check source files for issues:
# Look for horizontal rules without spacing in sources rg "^---[^-]" .aligntrue/rules -
Fix manually or let AlignTrue normalize:
# AlignTrue automatically fixes common issues during export aligntrue syncThe exporter now includes automatic formatting normalization.
Drift log shows pending files that don’t exist
Symptom: .aligntrue/.drift-log.json references files you’ve deleted.
Fix:
-
Clear drift log:
rm .aligntrue/.drift-log.json -
Or edit manually:
nano .aligntrue/.drift-log.json # Remove entries for deleted files -
Run sync to rebuild:
aligntrue sync
Getting help
If you’re still stuck:
-
Run with verbose output:
aligntrue sync --verbose -
Check debug logs:
DEBUG_SYNC=true aligntrue sync -
Review backup:
aligntrue backup list -
File an issue:
- Repository: https://github.com/AlignTrue/aligntrue
- Include verbose output and configuration