Nexus Hooks - Agent hooks system for automated memory extraction
This crate provides a four-layer extraction system for capturing agent session context with 95-100% reliability:
- Native Hooks (98-100%): Claude Skills, pi-mono, oh-my-pi, pi-skills
- Session Monitor (95%): Process monitoring via sysinfo
- Inactivity Detector (90%): Configurable timeout detection
- Persistent Buffer (99%): Crash recovery from buffer
Supported Agents
Native Lifecycle (dedicated hook implementation + skill installation)
- Claude Code: Skills-based (SKILL.md format) — session start, end, checkpoint, error, compact
- Droid (Factory CLI): settings-based (
~/.factory/settings.json) — SessionStart, SessionEnd, PostToolUse, PreCompact, Stop - pi-mono: Skills-based (TypeScript/Bun) — session end, checkpoint, compact
- oh-my-pi: Skills-based (TypeScript/Bun + Rust N-API) — session end, checkpoint, error, compact
- pi-skills: Cross-compatible skills — session end, checkpoint, compact
Monitor Only (process detection, no native hooks)
- Gemini: Process monitoring only (function calling not yet wired)
- Qwen: Process monitoring only (hooks subagent not yet wired)
Wrapper Lifecycle (generic CLI wrapper, atexit + process detection)
- CLI Agents: Amp, OpenCode, Codex, Hermes (shared CLIHook implementation)
Example
use ;
async