2.2 KiB
2.2 KiB
name, description, homepage, metadata
| name | description | homepage | metadata | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| session-memory | Save session context to memory when /new command is issued | https://docs.clawd.bot/internal-hooks#session-memory |
|
Session Memory Hook
Automatically saves session context to your workspace memory when you issue the /new command.
What It Does
When you run /new to start a fresh session:
- Finds the previous session - Uses the pre-reset session entry to locate the correct transcript
- Extracts conversation - Reads the last 15 lines of conversation from the session
- Generates descriptive slug - Uses LLM to create a meaningful filename slug based on conversation content
- Saves to memory - Creates a new file at
<workspace>/memory/YYYY-MM-DD-slug.md - Sends confirmation - Notifies you with the file path
Output Format
Memory files are created with the following format:
# Session: 2026-01-16 14:30:00 UTC
- **Session Key**: agent:main:main
- **Session ID**: abc123def456
- **Source**: telegram
Filename Examples
The LLM generates descriptive slugs based on your conversation:
2026-01-16-vendor-pitch.md- Discussion about vendor evaluation2026-01-16-api-design.md- API architecture planning2026-01-16-bug-fix.md- Debugging session2026-01-16-1430.md- Fallback timestamp if slug generation fails
Requirements
- Config:
workspace.dirmust be set (automatically configured during onboarding)
The hook uses your configured LLM provider to generate slugs, so it works with any provider (Anthropic, OpenAI, etc.).
Configuration
No additional configuration required. The hook automatically:
- Uses your workspace directory (
~/clawdby default) - Uses your configured LLM for slug generation
- Falls back to timestamp slugs if LLM is unavailable
Disabling
To disable this hook:
clawdbot hooks internal disable session-memory
Or remove it from your config:
{
"hooks": {
"internal": {
"entries": {
"session-memory": { "enabled": false }
}
}
}
}