Skip to content

Local-first 🧠 memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly 😴 dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.

TypeScript
1.5 KB
Raw Blame
/**
 * Hook event names allowed to carry
 * `hookSpecificOutput.additionalContext` back to the runtime.
 *
 * Default-closed: any event not listed here gets NO stdout from
 * context-injecting hooks. Claude Code validates hook output against a
 * per-event schema and rejects `additionalContext` for events that do
 * not support it - the rejection both drops the payload and echoes it
 * into the validation error, so emitting on an unsupported event is
 * strictly worse than staying silent.
 *
 * `PostCompact` is deliberately absent: current Claude Code has no
 * such hook event at all (verified against
 * https://code.claude.com/docs/en/hooks, 2026-06-02). Post-compaction
 * re-injection is served by the `SessionStart` hook with the
 * `compact` matcher instead - see `hooks/hooks.json`.
 *
 * `SubagentStop` is deliberately absent for the opposite reason: the host
 * DOES accept `additionalContext` there, and `hooks/hooks.json` registers
 * the event, but only for capture - no hook in this tree injects context
 * when a delegated sub-agent stops. Listing it would be a permission with
 * no producer behind it, and this list is a statement about what is
 * emitted, not about what would be accepted.
 */

export const CONTEXT_EVENT_NAMES = Object.freeze(["SessionStart", "UserPromptSubmit"] as const);

export type ContextEventName = (typeof CONTEXT_EVENT_NAMES)[number];

export function isContextEventName(name: string): name is ContextEventName {
  return (CONTEXT_EVENT_NAMES as ReadonlyArray<string>).includes(name);
}