Installs into .claude/skills of the current project.
Are you the author of Hooks Session End?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/monoes-hooks-session-end)
---
name: hooks-session-end
description: End the current session and persist state for later restoration.
type: flow
---
# hooks session-end
End the current session and persist state for later restoration.
## Usage
```bash
npx monomind hooks session-end [options]
```
## Options
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| `--save-state` | `-s` | boolean | `true` | Save session state for restoration |
| `--format` | — | string | — | Output format: `json` |
## Examples
```bash
# End and save session (default)
npx monomind hooks session-end
# End without saving state
npx monomind hooks session-end --save-state false
# JSON output
npx monomind hooks session-end --format json
```
## Output
Session summary including:
- Session ID
- Tasks executed, agents spawned, patterns learned, trajectories recorded
- Pending insights and memory entries
- Whether the session state was saved, and which store took it
## Restore Later
```bash
# Restore most recent session
npx monomind hooks session-restore
# Restore specific session
npx monomind hooks session-restore -i session-12345
```
## Claude Code Integration
Typically wired to run at conversation end:
```json
{
"hooks": {
"Stop": [{
"hooks": [{
"type": "command",
"command": "npx monomind hooks session-end"
}]
}]
}
}
```
## MCP Tool
```javascript
mcp__monomind__hooks_session-end({
saveState: true,
timestamp: Date.now()
})
```
## See Also
- `hooks session-restore` — restore a previous session
- `hooks pre-task` / `hooks post-task` — task tracking within a session