9ff8e915b8
User-agnostic, shareable AI-assisted development workflow distilled from 26+ real projects. Includes 9 composable rules, 4 project templates, pre-push secret scanning hook, 3 methodology guides, and customization docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.6 KiB
2.6 KiB
Session Discipline
Rules for maintaining continuity and quality across AI coding sessions.
Session Start
- Read CLAUDE.md first. It has the project state, architecture, and conventions.
- Check the latest session handoff in
.claude/sessions/for continuity from the previous session. - One focused task per session. Don't drift across unrelated domains. If scope grows, organize it — don't chase it.
During Work
- Persist decisions to files, not conversation. If it's only in chat history, it won't survive compaction or a fresh session.
- Don't verify context eagerly. Only verify when about to ACT on data. Documentation drifts — trust it for reading, verify before executing.
- When the user cancels your action, ask what they did. Don't save stale context from a cancelled operation.
- Credentials are in CLAUDE.md or .env files. Don't ask the user for passwords that are already documented.
- When creating new scripts, tools, or changing how things work, update CLAUDE.md immediately so future sessions know about it.
Commit Discipline
- Push to your remote after meaningful changes. Don't let work accumulate locally.
- Commit frequently — after every completed function, bug fix, or test addition. Not in batches.
Session End
-
Before closing a session, summarize what was learned and ask the user:
- "Should anything from this session be saved to memory?"
- "Did you cancel any of my actions and fix it yourself?" (if yes, note what they did)
- "Is any context from this session wrong or stale?"
-
Write a session summary to
.claude/sessions/YYYY-MM-DD-HHMM.mdwith:- Main task and outcome
- Key decisions and why
- What changed (files, commits)
- What's left to do
Handoff Documents
When a session ends with unfinished work, create .claude/sessions/handoff-YYYYMMDD[-topic].md:
# Session Handoff — YYYY-MM-DD
## What Was Done
[Completed work, commits, key outcomes]
## Current State
[Branch, working tree, CI status, what's deployed/tagged]
## Next Steps (ordered)
[Exactly what the next session should do, with file paths and line numbers]
The handoff is the start message for the next session. Include only what the next session needs to be productive immediately — not a full history.
When to create a handoff:
- Context is running low and work remains
- Switching to a completely different task domain
- Before a planned fresh session
- User requests a continuation message
When NOT to create a handoff:
- Work is complete (commit messages suffice)
- Remaining work is trivially discoverable from git status