# engram hook

Source: https://usecns.dev/engram-cli-hook/

[Start here](https://usecns.dev/manual-engram/)
[CLI commands](https://usecns.dev/commands-engram/)
[Configuration & integration](https://usecns.dev/engram-topics/)

`engram hook HARNESS EVENT [--ote PATH] [--db PATH] [--context TEXT] [--session ID]`. Harness defaults to `claude` when absent; event defaults to `session-start`. Valid harnesses: `claude`, `claude-code` (alias), `codex`, `gemini`, `pi`. Invalid harness returns 1. `--context` affects session-start rendering; `--session` identifies session-end cleanup, otherwise stdin `session_id` is used. Other tool/session fields come from stdin JSON, not extra CLI options. End stdin after the payload. Unknown event names perform no event action and can return 0.

Implemented event paths below are positional choices, not separately parsed option sets. Each accepts the harness aliases above and shared options just described.

See [CLI conventions](https://usecns.dev/engram-cli-usage/) for shared configuration and exit behavior, or [browse all commands](https://usecns.dev/commands-engram/).