pub struct ClaudeHooks;Expand description
Claude Code integration hooks
Implementations§
Source§impl ClaudeHooks
impl ClaudeHooks
Sourcepub fn on_message_start(
engine: &MemoryEngineV3,
role: &str,
content: &str,
_context_tokens: u32,
)
pub fn on_message_start( engine: &MemoryEngineV3, role: &str, content: &str, _context_tokens: u32, )
Hook called at the START of every Claude Code message
Sourcepub fn on_tool_start(_engine: &MemoryEngineV3, _tool_name: &str, _input: &Value)
pub fn on_tool_start(_engine: &MemoryEngineV3, _tool_name: &str, _input: &Value)
Hook called BEFORE every tool execution
Sourcepub fn on_tool_complete(
engine: &MemoryEngineV3,
tool_name: &str,
input: Value,
output: Value,
duration_ms: u64,
success: bool,
)
pub fn on_tool_complete( engine: &MemoryEngineV3, tool_name: &str, input: Value, output: Value, duration_ms: u64, success: bool, )
Hook called AFTER every tool execution
Sourcepub fn on_context_pressure(
engine: &MemoryEngineV3,
current_tokens: u32,
max_tokens: u32,
)
pub fn on_context_pressure( engine: &MemoryEngineV3, current_tokens: u32, max_tokens: u32, )
Hook called when Claude Code detects context pressure
Sourcepub fn on_pre_compaction(
engine: &MemoryEngineV3,
context_tokens_before: u32,
summary: &str,
active_files: Vec<String>,
pending_tasks: Vec<String>,
working_context: &str,
)
pub fn on_pre_compaction( engine: &MemoryEngineV3, context_tokens_before: u32, summary: &str, active_files: Vec<String>, pending_tasks: Vec<String>, working_context: &str, )
Hook called BEFORE compaction happens THIS IS THE CRITICAL MOMENT — capture everything before it’s lost
Sourcepub fn on_post_compaction(_engine: &MemoryEngineV3, _context_tokens_after: u32)
pub fn on_post_compaction(_engine: &MemoryEngineV3, _context_tokens_after: u32)
Hook called AFTER compaction completes
Sourcepub fn on_session_end(engine: &MemoryEngineV3, summary: &str)
pub fn on_session_end(engine: &MemoryEngineV3, summary: &str)
Hook called at SESSION END
Sourcepub fn on_session_start(engine: &MemoryEngineV3) -> SessionResumeResult
pub fn on_session_start(engine: &MemoryEngineV3) -> SessionResumeResult
Hook called at SESSION START (resume)
Auto Trait Implementations§
impl Freeze for ClaudeHooks
impl RefUnwindSafe for ClaudeHooks
impl Send for ClaudeHooks
impl Sync for ClaudeHooks
impl Unpin for ClaudeHooks
impl UnsafeUnpin for ClaudeHooks
impl UnwindSafe for ClaudeHooks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more