Feature Request: Conversation Start Hook
Summary
Add a new hook type that fires when a Claude Code conversation begins, similar to existing PreToolUse/PostToolUse hooks.
Problem
Currently, Claude Code only provides hooks for tool usage events:
PreToolUse- Before tool executionPostToolUse- After tool completionNotification- For system notificationsStop- When Claude wants to stop
There's no hook for conversation initialization, which prevents automatic context loading at conversation start.
Use Case: Memory System Integration
Modern AI assistants benefit from persistent memory across conversations. With MCP servers like orion-memory providing mem0 integration, conversations should automatically load relevant context from previous sessions.
Currently, memory retrieval is manual - the assistant must remember to search for relevant memories. A conversation start hook would enable automatic memory loading based on:
- Recent conversation topics
- Project context from working directory
- User preferences and patterns
- Relevant technical context
This creates a seamless experience where each conversation begins with appropriate historical context already loaded.
Proposed Solution
Add a new hook type: ConversationStart that fires when:
- A new conversation begins
- An existing conversation is resumed via
--resume
Suggested Implementation
# Hook configuration example
{
"PreConversationStart": {
"command": "/path/to/memory-loader.sh",
"args": ["${conversation_id}", "${working_directory}"]
}
}
This would complete the conversation lifecycle hook coverage: Start → Tool Use → Stop.
5 Comments
Thanks for submitting this idea. Can you explain the use case of
ConversationStartfor--resume, since--resumealready loads the existing context?very sorry, the report was a bit problematic, should have checked output better
i don't need it for --resume
my only use case is to get it to call a memory mcp server to get information whenever it reacts to a new message from me. edited the request
Would be great if the data of this event also had the original user message.
There a few things it can be used for:
This is now implemented in v1.0.55 as UserPromptSubmit. The original user prompt is available in the hook input.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.