Force-feed memory at the protocol level - so it works without the model remembering to call anything.
Hooks make memory work without the model remembering to act.
pmb hooks install claude-code wires all four lifecycle hooks; Codex and
MCP-only hosts get the equivalent via their own mechanisms.
Install & inspect
pmb hooks install <agent>
Wire the lifecycle hooks. Claude Code: UserPromptSubmit + PostToolUse +
SessionStart + Stop. Codex: a notify → pmb codex-notify.
pmb hooks list
Show which hooks are installed.
pmb hooks capabilities
What ambient mechanism each agent supports: hooks (Claude Code) / rollout
(Codex) / mcp-only (git observer).
pmb hooks uninstall <agent>
Remove the hooks.
Preview what hooks do
pmb auto-context "..."
Preview the per-turn memory a UserPromptSubmit hook would inject.
pmb session-restore [-m MIN]
Preview the “where you left off” digest a SessionStart hook injects after a
compaction.
pmb lesson-followcheck --dry-run
Preview deterministic follow-through scoring for surfaced lessons.
pmb auto-context "fix the pricing bug"pmb session-restore -m 180
Ambient auto-write
Ambient write fills the gap when the agent forgets to record its work. It’s
on by default, never duplicates the agent’s own record_* calls, and only
journals a turn that clears an outcome bar (tests passed, a failure fixed, a
deploy ran).
pmb autowrite [--dry-run]
Ambient auto-write for the current turn.
pmb ambient-watch <dir> [<dir>...]
Ambient auto-write for MCP-only hosts (Cursor/Zed/VS Code): poll git, auto-write
once the project goes idle. Pass several directories to run them in one process:
pmb ambient-watch app api docs --savepmb ambient-watch --all
pmb forget-auto [--minutes N]
Archive memory the ambient layer wrote itself (source=autowrite). Reversible.
pmb track-action and pmb codex-notify are hook-invoked (you don’t run them
by hand) - the PostToolUse journal and the Codex turn-complete bridge.
Repeat-prevention
When a message reads as pushback (profanity, ALL-CAPS, a repeat-word plus a
negated action), PMB records a draft lesson on the first complaint so the
rule exists when it’s needed - not after the seventh time. If a later message or
tool call strongly overlaps a known rule or past failure, the guard surfaces it
loudly, even inside an autonomous tool loop. Tune via auto_recall.* and
hooks.pretool_guard.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"PMB","description":"Local-first memory for your AI coding agent.","colors":{"primary":"#8B7FF0","light":"#B4ABF6","dark":"#8B7FF0"},"logo":{"light":"https://mintcdn.com/pmb/mr_bke8PucsYmgyO/logo/black.svg?fit=max\u0026auto=format\u0026n=mr_bke8PucsYmgyO\u0026q=85\u0026s=74f4ced3e9042bec547930d100de37cd","dark":"https://mintcdn.com/pmb/mr_bke8PucsYmgyO/logo/white.svg?fit=max\u0026auto=format\u0026n=mr_bke8PucsYmgyO\u0026q=85\u0026s=ed01398560995d21dfd3053a2a12e039","href":"https://github.com/oleksiijko/pmb"},"favicon":"https://mintcdn.com/pmb/mr_bke8PucsYmgyO/favicon.svg?fit=max\u0026auto=format\u0026n=mr_bke8PucsYmgyO\u0026q=85\u0026s=bc706a4621611232ee19223ce0a3911d","appearance":{"default":"dark"},"navbar":{"links":[{"href":"https://github.com/oleksiijko/pmb","label":"GitHub"}],"primary":{"type":"button","label":"Get started","href":"/quickstart"}},"footer":{"socials":{"github":"https://github.com/oleksiijko/pmb","linkedin":"https://www.linkedin.com/in/oleksiijko"}},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"pmb","hasAudioNarration":false,"actualSubdomain":"pmb","customDomains":["docs.pmbai.dev"],"gitSource":{"type":"github","owner":"oleksiijko","repo":"pmb","deployBranch":"main","contentDirectory":"mintlify","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6af4ec2bd439b7330d169659","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Guides","count":7},{"language":"default","tag":"Concepts","count":6},{"language":"default","tag":"CLI reference","count":6},{"language":"default","tag":"Contributing","count":3},{"language":"default","tag":"Get started","count":2},{"language":"default","tag":"MCP \u0026 agents","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"reference/cli/hooks","slug":"/reference/cli/hooks","pageMetadata":{"title":"Hooks \u0026 ambient memory","description":"Force-feed memory at the protocol level - so it works without the model remembering to call anything.","icon":"wand-magic-sparkles","href":"/reference/cli/hooks"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Force-feed memory at the protocol level - so it works without the model remembering to call anything.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,Tooltip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Tooltip)_missingMdxReference(`Tooltip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Hooks make memory work without the model remembering to act.\n`,_jsx(_components.code,{children:`pmb hooks install claude-code`}),` wires all four lifecycle hooks; Codex and\nMCP-only hosts get the equivalent via their own mechanisms.`]}),`\n`,_jsx(Heading,{level:`2`,id:`install-\u0026-inspect`,children:`Install \u0026 inspect`}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-hooks-install-\u003cagent>`,children:_jsx(_components.code,{children:`pmb hooks install \u003cagent>`})}),`\n`,_jsxs(_components.p,{children:[`Wire the lifecycle hooks. Claude Code: UserPromptSubmit + PostToolUse +\nSessionStart + Stop. Codex: a `,_jsx(_components.code,{children:`notify`}),` → `,_jsx(_components.code,{children:`pmb codex-notify`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-hooks-list`,children:_jsx(_components.code,{children:`pmb hooks list`})}),`\n`,_jsx(_components.p,{children:`Show which hooks are installed.`}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-hooks-capabilities`,children:_jsx(_components.code,{children:`pmb hooks capabilities`})}),`\n`,_jsxs(_components.p,{children:[`What ambient mechanism each agent supports: `,_jsx(_components.code,{children:`hooks`}),` (Claude Code) / `,_jsx(_components.code,{children:`rollout`}),`\n(Codex) / `,_jsx(_components.code,{children:`mcp-only`}),` (git observer).`]}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-hooks-uninstall-\u003cagent>`,children:_jsx(_components.code,{children:`pmb hooks uninstall \u003cagent>`})}),`\n`,_jsx(_components.p,{children:`Remove the hooks.`}),`\n`,_jsx(Heading,{level:`2`,id:`preview-what-hooks-do`,children:`Preview what hooks do`}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-auto-context--`,children:_jsx(_components.code,{children:`pmb auto-context \"...\"`})}),`\n`,_jsx(_components.p,{children:`Preview the per-turn memory a UserPromptSubmit hook would inject.`}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-session-restore--m-min`,children:_jsx(_components.code,{children:`pmb session-restore [-m MIN]`})}),`\n`,_jsx(_components.p,{children:`Preview the “where you left off” digest a SessionStart hook injects after a\ncompaction.`}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-lesson-followcheck-dry-run`,children:_jsx(_components.code,{children:`pmb lesson-followcheck --dry-run`})}),`\n`,_jsx(_components.p,{children:`Preview deterministic follow-through scoring for surfaced lessons.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pmb`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auto-context`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fix the pricing bug\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pmb`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` session-restore`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -m`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 180`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`ambient-auto-write`,children:`Ambient auto-write`}),`\n`,_jsxs(_components.p,{children:[`Ambient write fills the gap when the agent forgets to record its work. It’s\n`,_jsx(_components.strong,{children:`on by default`}),`, never duplicates the agent’s own `,_jsx(_components.code,{children:`record_*`}),` calls, and only\njournals a turn that clears an outcome bar (tests passed, a failure fixed, a\ndeploy ran).`]}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-autowrite--dry-run`,children:_jsx(_components.code,{children:`pmb autowrite [--dry-run]`})}),`\n`,_jsxs(_components.p,{children:[`Ambient auto-write for the current turn. `,_jsx(Tooltip,{tip:`LLM only if autowrite.synthesizer is an LLM backend; the default template needs no model`,children:`LLM optional`})]}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-ambient-watch-\u003cdir>-\u003cdir>-`,children:_jsx(_components.code,{children:`pmb ambient-watch \u003cdir> [\u003cdir>...]`})}),`\n`,_jsx(_components.p,{children:`Ambient auto-write for MCP-only hosts (Cursor/Zed/VS Code): poll git, auto-write\nonce the project goes idle. Pass several directories to run them in one process:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pmb`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ambient-watch`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` app`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` api`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` docs`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --save`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pmb`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ambient-watch`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --all`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`pmb-forget-auto--minutes-n`,children:_jsx(_components.code,{children:`pmb forget-auto [--minutes N]`})}),`\n`,_jsxs(_components.p,{children:[`Archive memory the ambient layer wrote itself (`,_jsx(_components.code,{children:`source=autowrite`}),`). Reversible.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`pmb track-action`}),` and `,_jsx(_components.code,{children:`pmb codex-notify`}),` are hook-invoked (you don’t run them\nby hand) - the PostToolUse journal and the Codex turn-complete bridge.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`repeat-prevention`,children:`Repeat-prevention`}),`\n`,_jsxs(_components.p,{children:[`When a message reads as pushback (profanity, ALL-CAPS, a repeat-word plus a\nnegated action), PMB records a `,_jsx(_components.strong,{children:`draft lesson on the first complaint`}),` so the\nrule exists when it’s needed - not after the seventh time. If a later message or\ntool call strongly overlaps a known rule or past failure, the guard surfaces it\nloudly, even inside an autonomous tool loop. Tune via `,_jsx(_components.code,{children:`auto_recall.*`}),` and\n`,_jsx(_components.code,{children:`hooks.pretool_guard`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Hooks \u0026 ambient memory","description":"Force-feed memory at the protocol level - so it works without the model remembering to call anything.","icon":"wand-magic-sparkles","href":"/reference/cli/hooks"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install \u0026 inspect","slug":"install-\u0026-inspect","depth":2,"children":[{"title":"pmb hooks install \u003cagent>","slug":"pmb-hooks-install-\u003cagent>","depth":3,"children":[]},{"title":"pmb hooks list","slug":"pmb-hooks-list","depth":3,"children":[]},{"title":"pmb hooks capabilities","slug":"pmb-hooks-capabilities","depth":3,"children":[]},{"title":"pmb hooks uninstall \u003cagent>","slug":"pmb-hooks-uninstall-\u003cagent>","depth":3,"children":[]}]},{"title":"Preview what hooks do","slug":"preview-what-hooks-do","depth":2,"children":[{"title":"pmb auto-context \"...\"","slug":"pmb-auto-context--","depth":3,"children":[]},{"title":"pmb session-restore [-m MIN]","slug":"pmb-session-restore--m-min","depth":3,"children":[]},{"title":"pmb lesson-followcheck --dry-run","slug":"pmb-lesson-followcheck-dry-run","depth":3,"children":[]}]},{"title":"Ambient auto-write","slug":"ambient-auto-write","depth":2,"children":[{"title":"pmb autowrite [--dry-run]","slug":"pmb-autowrite--dry-run","depth":3,"children":[]},{"title":"pmb ambient-watch \u003cdir> [\u003cdir>...]","slug":"pmb-ambient-watch-\u003cdir>-\u003cdir>-","depth":3,"children":[]},{"title":"pmb forget-auto [--minutes N]","slug":"pmb-forget-auto--minutes-n","depth":3,"children":[]}]},{"title":"Repeat-prevention","slug":"repeat-prevention","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"pmb","siteName":"PMB","title":"Hooks \u0026 ambient memory - PMB","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-30T00:12:44.852Z","originalFileLocation":"reference/cli/hooks.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Force-feed memory at the protocol level - so it works without the model remembering to call anything.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PMB\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Hooks \u0026amp; ambient memory - PMB\">\u003cmeta data-mint-head property=\"og:description\" content=\"Force-feed memory at the protocol level - so it works without the model remembering to call anything.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PMB\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.pmbai.dev/reference/cli/hooks\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://pmb.mintlify.site/_mintlify/api/og/v2?division=CLI+reference\u0026amp;title=Hooks+%26+ambient+memory\u0026amp;description=Force-feed+memory+at+the+protocol+level+-+so+it+works+without+the+model+remembering+to+call+anything.\u0026amp;theme=7ffdbd196ec83c7b031635aa\u0026amp;signature=f4d25322bea8b509f614ed2e84c47bba051fa15c4a0f19e3b0f7236a041b1478\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Hooks \u0026amp; ambient memory - PMB\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Force-feed memory at the protocol level - so it works without the model remembering to call anything.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://pmb.mintlify.site/_mintlify/api/og/v2?division=CLI+reference\u0026amp;title=Hooks+%26+ambient+memory\u0026amp;description=Force-feed+memory+at+the+protocol+level+-+so+it+works+without+the+model+remembering+to+call+anything.\u0026amp;theme=7ffdbd196ec83c7b031635aa\u0026amp;signature=f4d25322bea8b509f614ed2e84c47bba051fa15c4a0f19e3b0f7236a041b1478\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/pmb/w2ty8WWRQzNl_jG8/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PMB\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#8B7FF0\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.pmbai.dev/reference/cli/hooks\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/reference/cli/hooks.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.pmbai.dev/#organization\",\"name\":\"PMB\",\"url\":\"https://docs.pmbai.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/pmb/mr_bke8PucsYmgyO/logo/black.svg?fit=max\u0026auto=format\u0026n=mr_bke8PucsYmgyO\u0026q=85\u0026s=74f4ced3e9042bec547930d100de37cd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.pmbai.dev#website\",\"name\":\"PMB\",\"url\":\"https://docs.pmbai.dev\",\"publisher\":{\"@id\":\"https://docs.pmbai.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.pmbai.dev/reference/cli/hooks#webpage\",\"url\":\"https://docs.pmbai.dev/reference/cli/hooks\",\"name\":\"Hooks \u0026 ambient memory\",\"description\":\"Force-feed memory at the protocol level - so it works without the model remembering to call anything.\",\"dateModified\":\"2026-06-30T00:12:44.852Z\",\"isPartOf\":{\"@id\":\"https://docs.pmbai.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.pmbai.dev/reference/cli/hooks#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.pmbai.dev/reference/cli/hooks#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"CLI reference\",\"item\":\"https://docs.pmbai.dev/reference/cli/setup-connect\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hooks \u0026 ambient memory\",\"item\":\"https://docs.pmbai.dev/reference/cli/hooks\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.pmbai.dev/reference/cli/hooks#article\",\"headline\":\"Hooks \u0026 ambient memory\",\"name\":\"Hooks \u0026 ambient memory\",\"description\":\"Force-feed memory at the protocol level - so it works without the model remembering to call anything.\",\"url\":\"https://docs.pmbai.dev/reference/cli/hooks\",\"mainEntityOfPage\":{\"@id\":\"https://docs.pmbai.dev/reference/cli/hooks#webpage\"},\"dateModified\":\"2026-06-30T00:12:44.852Z\",\"publisher\":{\"@id\":\"https://docs.pmbai.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.pmbai.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PMB\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"PMB\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/reference/cli/hooks.md","siteName":"PMB","nav":{"global":null,"groups":[{"group":"Get started","icon":"rocket","pages":[{"title":"PMB","icon":"house","href":"/introduction"},{"title":"Quickstart","icon":"rocket","href":"/quickstart"}]},{"group":"Guides","icon":"book-open","pages":[{"title":"Connect your agent","icon":"plug","href":"/guides/connect"},{"title":"Ingest your project","icon":"file-import","href":"/guides/ingest"},{"title":"The dashboard","icon":"chart-network","href":"/guides/dashboard"},{"title":"Deleting memories","icon":"trash","href":"/guides/deleting-memories"},{"title":"Team \u0026 sync","icon":"users","href":"/guides/team"},{"title":"Ollama \u0026 offline LLM","icon":"robot","href":"/guides/ollama"},{"title":"Troubleshooting","icon":"wrench","href":"/guides/troubleshooting"}]},{"group":"Concepts","icon":"brain","pages":[{"title":"How it works","icon":"gears","href":"/concepts/how-it-works"},{"title":"Memory model","icon":"layer-group","href":"/concepts/memory-model"},{"title":"Core engine","icon":"microchip","href":"/concepts/core-engine"},{"title":"Architecture","icon":"sitemap","href":"/concepts/architecture"},{"title":"Does PMB actually help?","icon":"chart-line","href":"/concepts/measuring-impact"},{"title":"Privacy \u0026 security","icon":"shield-halved","href":"/concepts/privacy-and-security"}]},{"group":"CLI reference","icon":"terminal","pages":[{"title":"Setup \u0026 connect","icon":"plug","href":"/reference/cli/setup-connect"},{"title":"Capture \u0026 track","icon":"pen","href":"/reference/cli/write"},{"title":"Recall \u0026 explore","icon":"magnifying-glass","href":"/reference/cli/read"},{"title":"Manage, sync \u0026 backup","description":"Export, delete, pin, snapshot - and the only commands that ever touch the network, run on purpose.","icon":"box-archive","href":"/reference/cli/manage"},{"title":"Hooks \u0026 ambient memory","icon":"wand-magic-sparkles","href":"/reference/cli/hooks"},{"title":"Config, UI \u0026 maintenance","description":"Settings, the web dashboard, background upkeep, and the few opt-in LLM-powered commands.","icon":"sliders","href":"/reference/cli/config"}]},{"group":"MCP \u0026 agents","icon":"plug","pages":[{"title":"Agents \u0026 MCP tools","icon":"plug","href":"/reference/mcp-tools"},{"title":"Configuration","icon":"sliders","href":"/reference/configuration"}]},{"group":"Contributing","icon":"code-pull-request","pages":[{"title":"Contributing","icon":"code-pull-request","href":"/contributing/contributing"},{"title":"Adding a language","icon":"language","href":"/contributing/adding-a-language"},{"title":"Roadmap","icon":"map","href":"/contributing/roadmap"}]}]},"basePath":"","title":"Hooks \u0026 ambient memory - PMB","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":[],"chunks":[]}