@teambrain/hooks
v0.3.0
Published
TeamBrain capture adapters: agent tool events → redacted, metadata-only session records
Maintainers
Readme
@teambrain/hooks
Thin capture adapters: agent tool events → TeamBrain session records.
Turns Claude Code hook payloads (and Cursor MCP-side inference) into metadata-only session events, redacts them on-device, and fire-and-forgets them to the local daemon.
- Privacy contract in code: a
tool_useevent carries only{kind, path?, exit_code?}— content fields (old_string,new_string, command output, prompts) are structurally dropped, then every surviving string is run through@teambrain/redactbefore anything touches disk. - Never blocks a session: handlers run in well under 20ms p95 (enforced by benchmark test) and exit 0 unconditionally; if the daemon is down, events drop silently.
- Claude Code: SessionStart (context inject), PostToolUse, Stop /
SessionEnd. Cursor: rules-directive + MCP-side session inference
(Cursor has no native lifecycle hooks; edit/command telemetry is
unavailable and reported as degraded by
tb doctor).
npm install @teambrain/hooksPart of TeamBrain — tb install
claude-code|cursor from
@teambrain/cli wires these
up; you rarely use this package directly.
Apache-2.0
