A0003 agent-session-files¶
Rule: No agent transcripts or per-person agent files are committed.
| Code | A0003 (stable, never reused) |
| Id | agent-session-files |
| Category | hygiene |
| Source | spirit_level |
| Fix | by hand |
| Needs | git installed |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | off | |
| small-workspace | off | |
| medium | off | |
| big | off | |
| ai | deny |
transcripts and per-person agent files hold private context and secrets |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Parameters¶
| Name | Type | Default | Meaning |
|---|---|---|---|
patterns |
list of strings | ["**/.claude/settings.local.json", "**/CLAUDE.local.md", "**/.claude/projects/**", "**/.claude/todos/**", "**/.claude/**/*.jsonl", "**/*transcript*", "**/.aider.chat.history.md", "**/.aider.input.history", "**/.specstory/**"] |
globs of tracked files that are session files |
Why¶
Agent transcripts and histories hold the whole session: private context, pasted secrets, paths of the author's machine. Per-person files (.claude/settings.local.json, CLAUDE.local.md) are meant to stay local. Neither belongs in the repo.
The rule lists the tracked files that match one of patterns.
How to fix¶
git rm --cached the file, add the pattern to .gitignore, and check the history for secrets.
Configure¶
[lints.agent-session-files]
level = "deny"
patterns = ["**/.claude/settings.local.json", "**/CLAUDE.local.md", "**/.claude/projects/**", "**/.claude/todos/**", "**/.claude/**/*.jsonl", "**/*transcript*", "**/.aider.chat.history.md", "**/.aider.input.history", "**/.specstory/**"]
reason = "why this project wants it at this level"
Allow one finding in the code with // spirit-level: allow(agent-session-files) <reason> (waivers); the code works there too, as in [lints.A0003].