Summary
Request to add a session_start hook to complement the existing session_completed hook, enabling actions to be triggered when a new session begins.
Use Case
I'm using a Continuous Learning MCP Server that stores user preferences and learned patterns across sessions. Currently:
- ✅
session_completed hook exists - can save state when session ends
- ❌
session_start hook missing - cannot auto-load state when session begins
This means the MCP can save memories, but there's no way to automatically read them at the start of a new session. Users must manually trigger the read operation.
Proposed Solution
Add session_start to the experimental hooks:
// Current (from opencode-sdk-go/config.go)
type ConfigExperimentalHook struct {
FileEdited map[string][]ConfigExperimentalHookFileEdited `json:"file_edited"`
SessionCompleted []ConfigExperimentalHookSessionCompleted `json:"session_completed"`
}
// Proposed
type ConfigExperimentalHook struct {
FileEdited map[string][]ConfigExperimentalHookFileEdited `json:"file_edited"`
SessionCompleted []ConfigExperimentalHookSessionCompleted `json:"session_completed"`
SessionStart []ConfigExperimentalHookSessionStart `json:"session_start"` // NEW
}
Example Configuration
{
"experimental": {
"hooks": {
"session_start": [
{
"command": ["node", "scripts/load-context.js"]
}
]
}
}
}
Reference
Claude Code supports SessionStart hooks which enables this workflow. See: everything-claude-code hooks.json
Impact
This would enable:
- Auto-loading user preferences/context at session start
- Persistent memory across sessions
- Better integration with learning/memory MCP servers
- Parity with Claude Code's hook capabilities
Thank you for considering this feature!
Summary
Request to add a
session_starthook to complement the existingsession_completedhook, enabling actions to be triggered when a new session begins.Use Case
I'm using a Continuous Learning MCP Server that stores user preferences and learned patterns across sessions. Currently:
session_completedhook exists - can save state when session endssession_starthook missing - cannot auto-load state when session beginsThis means the MCP can save memories, but there's no way to automatically read them at the start of a new session. Users must manually trigger the read operation.
Proposed Solution
Add
session_startto the experimental hooks:Example Configuration
{ "experimental": { "hooks": { "session_start": [ { "command": ["node", "scripts/load-context.js"] } ] } } }Reference
Claude Code supports
SessionStarthooks which enables this workflow. See: everything-claude-code hooks.jsonImpact
This would enable:
Thank you for considering this feature!