Skip to main content

ClaudeHooks

Struct ClaudeHooks 

Source
pub struct ClaudeHooks;
Expand description

Claude Code integration hooks

Implementations§

Source§

impl ClaudeHooks

Source

pub fn on_message_start( engine: &MemoryEngineV3, role: &str, content: &str, _context_tokens: u32, )

Hook called at the START of every Claude Code message

Source

pub fn on_tool_start(_engine: &MemoryEngineV3, _tool_name: &str, _input: &Value)

Hook called BEFORE every tool execution

Source

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

Source

pub fn on_context_pressure( engine: &MemoryEngineV3, current_tokens: u32, max_tokens: u32, )

Hook called when Claude Code detects context pressure

Source

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

Source

pub fn on_post_compaction(_engine: &MemoryEngineV3, _context_tokens_after: u32)

Hook called AFTER compaction completes

Source

pub fn on_session_end(engine: &MemoryEngineV3, summary: &str)

Hook called at SESSION END

Source

pub fn on_session_start(engine: &MemoryEngineV3) -> SessionResumeResult

Hook called at SESSION START (resume)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.