Git-native session lifecycle management for software development. Use when starting/resuming coding sessions, creating checkpoints, tracking objectives and blockers, generating handoffs between sessions, or needing context preservation across work sessions. Provides intelligent onboarding for AI coding agents by loading comprehensive project context.
Git-native session management that maps branches to work sessions with objectives, blockers, and decision tracking. Use `/session-start` when beginning or resuming work to load full project context, `/checkpoint` at milestones to save progress with automatic git analysis, and `/session-end` to generate comprehensive handoffs.
/plugin marketplace add AnthemFlynn/ccmp/plugin install session-management@ccmpThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/architecture-template.mdassets/config-template.yamlassets/conventions-template.mdreferences/commands.mdreferences/config-reference.mdreferences/handoff-template.mdscripts/checkpoint.pyscripts/handoff.pyscripts/init_session.pyscripts/session.pyscripts/test_checkpoint.pyscripts/test_handoff.pyManage coding sessions with git-native workflows, intelligent context preservation, and seamless agent onboarding.
Sessions = Branches + Context
Session management enhances git workflows by:
python scripts/init_session.py
Creates .sessions/ directory with:
config.yaml - Session configuration (optional)checkpoints/ - Checkpoint storagestate.json - Current session stateImportant: All slash commands use the AskUserQuestion tool to gather inputs interactively. The Python scripts accept CLI arguments, so commands collect user choices via multiple-choice prompts, then execute scripts with those arguments.
/session-start)Rapid re-immersion for both human and AI
/session-start
What happens:
Use when:
/checkpoint)Quick save points during work
/checkpoint
What happens:
Use when:
Examples:
# Simple checkpoint
python scripts/session.py checkpoint --label "oauth-complete"
# Checkpoint with notes and git commit
python scripts/session.py checkpoint --label "feature-complete" --notes "OAuth flow tested" --commit
# With custom commit message
python scripts/session.py checkpoint --label "bugfix" --commit --message "fix: resolve auth token expiry"
/session-end)Comprehensive knowledge capture and handoff
/session-end
What happens:
Use when:
START → Load full project context with status report WORK → Track changes automatically in background CHECKPOINT → Save progress with automatic git analysis END → Generate handoff with comprehensive session summary
Track what you're trying to accomplish:
# Add objective
python scripts/session.py objectives add "Implement OAuth2 integration"
# Mark complete
python scripts/session.py objectives complete obj-1
# List all
python scripts/session.py objectives list
Record impediments:
# Add blocker
python scripts/session.py blockers add "Waiting on API keys"
# Resolve
python scripts/session.py blockers resolve blk-1
Capture architectural decisions with context:
# Record decision
python scripts/session.py decisions add "Using repository pattern for data access" \
--rationale "Separates domain logic from persistence" \
--alternatives "Active Record: Too coupled to database"
Check current state:
# Full status
python scripts/session.py status
# Just objectives
python scripts/session.py status --objectives
# History
python scripts/session.py history --count 10
When AI agents (like Claude Code) start, session management provides instant context:
# Automatically loads on agent start:
# - Project architecture pattern
# - Code conventions
# - Recent decisions
# - Current objectives
# - Active blockers
# - Git history analysis
# - File changes summary
Agent receives structured brief including:
project/
├── .session/ # Git-tracked, shared across team
│ ├── config.yaml # Configuration
│ ├── architecture.md # Architecture documentation
│ ├── conventions.md # Code conventions
│ └── decision-log.md # All decisions (auto-generated)
│
└── .git/
└── sessions/ # Local, developer-specific
└── <branch>/
├── objectives.md
├── blockers.md
└── context.json
Design principle: Shared context (architecture, conventions) is git-tracked. Personal workflow data (objectives, notes) stays local.
Edit .session/config.yaml:
session:
auto_track: true # Track file changes automatically
handoff_on_end: true # Generate handoff when ending
context:
architecture: hexagonal # Your architecture pattern
patterns: # Patterns to enforce
- repository-pattern
- dependency-injection
tracking:
watch_patterns: # Files to monitor
- "src/**/*.py"
- "tests/**/*.py"
# Morning: Resume work
python scripts/session.py resume
# During work: Checkpoint at milestones
python scripts/session.py checkpoint --label "api-complete"
# Evening: End with handoff
python scripts/session.py end
# Urgent bug comes in
python scripts/session.py switch hotfix/critical-bug
# Fix bug
python scripts/session.py checkpoint --message "Fix security issue"
python scripts/session.py end --merge-to main
# Back to feature
python scripts/session.py resume feature/main-work
# Generate comprehensive handoff
python scripts/session.py end --handoff --summary
# Next developer loads context
python scripts/session.py resume <branch>
Session checkpoints create git commits with rich metadata:
feat(auth): Implement OAuth2 provider
Completed Google OAuth flow with PKCE support.
Session-Objectives:
- [x] OAuth provider interface
- [▶] Google OAuth (this commit)
- [ ] GitHub OAuth (next)
Decisions:
- Using PKCE flow for enhanced security
Rationale: Protection against code interception
Impact:
- Added: src/auth/oauth_provider.py
- Tests: +12 unit tests
- Coverage: 79% → 84%
Session-Time: 2h 15m
# Analyze session health
python scripts/session.py analyze
# Calculate velocity
python scripts/session.py analyze --velocity
# Pattern detection
python scripts/session.py analyze --patterns
# Recent sessions with metrics
python scripts/session.py history --count 5 --metrics
# Compare sessions
python scripts/session.py compare <session-id>
# Weekly summary
python scripts/session.py report --weekly
# Project summary
python scripts/session.py report --project --format markdown
init_session.py - Initialize session management in projectsession.py - Main CLI for all session operationsanalyze_git.py - Git history analysis utilitiescommands.md - Complete command referencehandoff-template.md - Template for session handoffsconfig-reference.md - All configuration optionsconfig-template.yaml - Default configurationarchitecture-template.md - Architecture documentation templateconventions-template.md - Conventions templateFor Solo Development:
For Teams:
.session/ directory (shared context)For AI-Assisted Development:
Session not loading?
python scripts/session.py status --verbose
python scripts/session.py start --resume
Need to reinitialize?
python scripts/init_session.py --force
View current configuration:
cat .session/config.yaml
Session management automatically integrates with other CCMP plugins:
Auto-loads relevant context on session start:
python scripts/session.py start feature/auth
# → Automatically loads src/auth/claude.md
# → Shows context health warnings
# → Includes patterns and gotchas in brief
Checkpoints trigger context health checks:
python scripts/session.py checkpoint --label "api-complete"
# → Detects src/api/ changed
# → Warns if context is stale
# → Offers: "Update context? [y/N]"
Handoffs include context health:
python scripts/session.py end --handoff
# → Includes context health score
# → Lists files needing updates
# → Recommends maintenance for next session
TDD mode automatically enhances sessions:
python scripts/session.py start feature/auth --tdd
# → TDD workflow detects and activates
# → Automatic RED-GREEN-REFACTOR checkpoints
# → TDD metrics in session status
# → Test coverage tracking
Session analysis detects TDD:
python scripts/session.py analyze
# → Shows TDD cycles completed
# → Detects commits without tests
# → Reports discipline violations
Uses .ccmp/state.json for plugin coordination. See lib/ccmp_integration.py for details.
Developers: Import the integration library:
from lib.ccmp_integration import CCMPIntegration
integration = CCMPIntegration()
if integration.is_active("session-management"):
session = integration.get_state("session-management")
Session management is designed to work with:
For integration guides, see references/integrations.md.
references/commands.mdreferences/config-reference.mdreferences/handoff-template.mdreferences/integrations.mdThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.