The diff-first loop
Every fix moves through the same three stages, in this order, always:- Scan —
charter doctormarks each finding with afixableindicator when a deterministic remediation exists. Findings without a fixer (secrets, dangerous hook configurations) are flagged but never offered as automated fixes. - Preview —
charter fix --dry-runprints the unified diff for every proposed change and writes nothing. It exits with the same code the apply step would, so it slots into review scripts. - Apply —
charter fixcopies each original file to.charter/backups/<ts>/before writing, then applies the diff.

charter fix --dry-run — unified diff before applying
Fixable rules
These fixers are safe to automate because the correct output is fully determined by the rule specification. There is no ambiguity and no judgment call required. That is why these four — and only these four — have automated fixers in v1.
Why secrets are never auto-fixed
The same logic applies to dangerous hook configurations (AE-CC-001). Rules that flag unrestricted shell execution or broad glob allowlists in agent configs require a human to evaluate the intent behind the configuration and decide on a safer alternative. Charter cannot know whether the hook is a legitimate use case that needs a narrow permission or an oversight that should be removed entirely. These are deliberate boundaries, not gaps to fill in a future release.
Backup mechanism
Before every write, Charter copies the original file to.charter/backups/<ts>/<relative-path>, where <ts> is a compact UTC timestamp such as 20260601T143022Z. If the fixer modifies .github/workflows/ci.yml, the original is preserved at:
charter fix invocation. Charter never deletes backup directories and never truncates existing ones — they accumulate until you remove them, so the AE-CTX-004 fixer adds .charter/ to .gitignore to keep them local.
If a fixer produces an unexpected result, the original is always recoverable from the most recent backup directory.
MCP catalog-aware pin bumps
TheAE-MCP-001 fixer has special logic for the three distinct cases it may encounter:
- Advisory-affected version → bumps to the
fixedInversion recorded in the catalog advisory. Charter will not bump to a version that is itself subject to a known advisory. - Unpinned or behind catalog stable → bumps to the catalog’s
stableVersionfor that package. - Deprecated or archived package → NOT auto-fixed. The package requires migration to a successor, which is a manual step. Charter provides the successor package name in the finding detail.
Next steps
Use charter fix Safely
The full recipe: dry-run, review, apply, re-scan, and recover.
charter fix
Every flag the fix command accepts.
Scoring and Caps
How a successful fix moves the score.
MCP Safety Model
Why the AE-MCP-001 fixer bumps to catalog versions, not the latest release.