Feature Request: Conversation Start Hook

Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
Activity 5 comments · opened Jul 6, 2025 · closed Jul 18, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator) responded on this thread — see the highlighted reply below.

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 execution
  • PostToolUse - After tool completion
  • Notification - For system notifications
  • Stop - 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:

  1. A new conversation begins
  2. 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.

View original on GitHub ↗

5 Comments

dicksontsai collaborator · 1 year ago

Thanks for submitting this idea. Can you explain the use case of ConversationStart for --resume, since --resume already loads the existing context?

teren-papercutlabs · 1 year ago

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

  1. When Claude Code... starts doing things. I am not sure of the terminology for this one, i'm not talking about the session as a whole, i'm talking about each time it reacts to user input.
mrieck · 1 year ago

Would be great if the data of this event also had the original user message.

There a few things it can be used for:

  1. Ops use case of firing off other processes or tasks related to the request (like preparing memory for tool use, or researching task with another agent to make sure CC doesn't go off the rails)
  1. Monitoring spawning/lifecycle of sub-agents
  1. Claude Code monitoring apps that want to know which terminals are working so while automating tasks in a queue it doesn't try to send input to a busy terminal (my use case)
dicksontsai collaborator · 1 year ago

This is now implemented in v1.0.55 as UserPromptSubmit. The original user prompt is available in the hook input.

github-actions[bot] · 1 year ago

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.