For agents, on top of README.md, which they read first.

Notes for agents

Run just daemon after any change here. It copies the release binary to plugin/bin/jevhooks with install; the next session replaces the running daemon because the identity (device, inode, size, mtime) changed. To do it by hand, plugin/bin/jevhooks stop and start a session, or op-env-run -- plugin/bin/jevhooks serve.

Check memory before a release build. It uses several gigabytes: free -m first.

The MCP server must not wait for the daemon. mcp::serve spawns client::ensure and serves at once; awaiting it would hold the session's tool list on a key fetch measured at 3 to 15 seconds.

client::spawn is the one place a daemon is started. Keep it detached (process_group(0), stdin and stdout null, stderr to daemon.log) and keep the key out of its arguments.

A config file that cannot be used must never disable a gate. serve falls back to Config::default() and reports the error in status; keep deny_unknown_fields so a misspelt key is an error rather than silently ignored.

SIGPIPE is reset only for the printing commands. print in main.rs restores the default so | head ends quietly; the daemon itself must survive a peer closing its socket.