charter fix --rule AE-CTX-004
Why this rule
Agent session files checked into git expose local machine state and session history to the repo’s commit record. They also inflate the tracked file set every agent scans on each task, adding irrelevant noise to the agent’s view of the codebase.What triggers it
Charter checks whether.gitignore excludes the following agent session artifact patterns:
| Pattern | What it covers |
|---|---|
.charter/ | Charter local run state and session cache |
*.charter-session | Charter session files |
.claude/local/ | Claude Code local settings and session data |
.cursor/cache/ | Cursor IDE agent cache |
.gitignore entry alone does not remove a file that was previously committed.
Team-owned config files such as
.cursor/rules, .claude/settings.json, and hk.pkl should stay committed. AE-CTX-004 targets local cache and session state, not shared configuration.Examples
- Failing
- Passing
.gitignore (missing entries)
How to fix
Preview the changes
Run
charter fix --rule AE-CTX-004 --dry-run to see which .gitignore entries will be added.Score impact
Medium severity: −4 to the base score. No hard cap.Related rules
- AE-CTX-001 — context file must exist and be within budget