session-end
From ruvnet
Cleanup and persist session state before ending work.
Install
/session-endFacts
- Repository
- ruvnet/ruflo
- Status
- Actively maintained
- Last commit
- Source file
- .claude/commands/hooks/session-end.md
Source preview
The instructions Claude Code reads when this command runs.
# hook session-end
Cleanup and persist session state before ending work.
## Usage
```bash
npx claude-flow hook session-end [options]
```
## Options
- `--session-id, -s <id>` - Session identifier to end
- `--save-state` - Save current session state (default: true)
- `--export-metrics` - Export session metrics
- `--generate-summary` - Create session summary
- `--cleanup-temp` - Remove temporary files
## Examples
### Basic session end
```bash
npx claude-flow hook session-end --session-id "dev-session-2024"
```
### With full export
```bash
npx claude-flow hook session-end -s "feature-auth" --export-metrics --generate-summary
```
### Quick close
```bash
npx claude-flow hook session-end -s "quick-fix" --save-state false --cleanup-temp
```
### Complete persistence
```bash
npx claude-flow hook session-end -s "major-refactor" --save-state --export-metrics --generate-summary
```
## Features
### State Persistence
- Saves current context
- Stores open files
- Preserves task progress
- Maintains decisions
### Metric Export
- Session duration
- Commands executed
- Files modified
- Tokens consumed
- Performance data
### Summary Generation
- Work accomplished
- Key decisions made
- Problems solved
- Next steps identified
### Cleanup Operations
- Removes temp files
- Clears caches
- Frees resources
- Optimizes storage
## Integration
This hook is automatically called by View full source on GitHub →Other slash commands
feature-development
★ 229,918Workflow command scaffold for feature-development in everything-claude-code.
affaan-mupdated 15d agoMITdatabase-migration
★ 229,918Workflow command scaffold for database-migration in everything-claude-code.
affaan-mupdated 15d agoMITadd-language-rules
★ 229,918Workflow command scaffold for add-language-rules in everything-claude-code.
affaan-mupdated 15d agoMITcommit-push-pr
★ 137,934Commit, push, and open a PR
anthropicsupdated 14d agodedupe
★ 137,934Find duplicate GitHub issues
anthropicsupdated 14d agotriage-issue
★ 137,934Triage GitHub issues by analyzing and applying labels
anthropicsupdated 14d ago