{"_id":"@abix5/opencode-hindsight","_rev":"8-9f2dd7f391119d2aab3169640fbe092d","name":"@abix5/opencode-hindsight","dist-tags":{"latest":"0.7.0"},"versions":{"0.2.1":{"name":"@abix5/opencode-hindsight","version":"0.2.1","keywords":["opencode","opencode-plugin","hindsight","memory","ai","llm"],"license":"MIT","_id":"@abix5/opencode-hindsight@0.2.1","maintainers":[{"name":"abix5","email":"abix5@yandex.ru"}],"homepage":"https://github.com/abix5/opencode-hindsight#readme","bugs":{"url":"https://github.com/abix5/opencode-hindsight/issues"},"dist":{"shasum":"ad6a4ff4011579d82d3d8b2127313313880a54b2","tarball":"https://registry.npmjs.org/@abix5/opencode-hindsight/-/opencode-hindsight-0.2.1.tgz","fileCount":32,"integrity":"sha512-paZA4ClMsNl+WeEAH5rxNNVdo/tjaw9QGa1TkRy/zxb9gZobFi5PtEnMw6XC0r+uGnA6jL+18zGNiS6Q/Vm6Ww==","signatures":[{"sig":"MEQCIFx3LZOyWnmYlq+WCqYVy3Z8keWXtxh83Va3FqHXWWInAiArtaHUjYMpmfPQUZ2U10GEFJJRMpvzg46p1P4PlRsotA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":202279},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"360ae282ee64436c36586e8ff2b5e2c73c9a6a15","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"abix5","email":"abix5@yandex.ru"},"repository":{"url":"git+https://github.com/abix5/opencode-hindsight.git","type":"git"},"_npmVersion":"10.9.3","description":"Hindsight memory bank plugin for OpenCode","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@opencode-ai/plugin":"^1.1.53"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.2","@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/opencode-hindsight_0.2.1_1771609878353_0.6786259425141037","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@abix5/opencode-hindsight","version":"0.3.0","keywords":["opencode","opencode-plugin","hindsight","memory","ai","llm"],"license":"MIT","_id":"@abix5/opencode-hindsight@0.3.0","maintainers":[{"name":"abix5","email":"abix5@yandex.ru"}],"homepage":"https://github.com/abix5/opencode-hindsight#readme","bugs":{"url":"https://github.com/abix5/opencode-hindsight/issues"},"bin":{"opencode-hindsight":"dist/cli.js"},"dist":{"shasum":"7f3c8cd0c24f3e2eb93c6551b8fbe8e8dea702e1","tarball":"https://registry.npmjs.org/@abix5/opencode-hindsight/-/opencode-hindsight-0.3.0.tgz","fileCount":37,"integrity":"sha512-RIKKSSDD0dlDCkrEz+lg3Z8gWOmh7VqgUUaakXDaxvPX2kxMOxFLtKt5QyfrRzAJPgMR9cJEfBSXMcFmFeBLTw==","signatures":[{"sig":"MEUCIQDAE712B+Hv5XRF2A3qhsUIiHhPsqyfrV2Pt3Ychc5/MQIgBpIbuzFfsKyuM3ir0jVFeM64zq7ejuFmzvRj+U43/Z0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":226625},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"b7578c21fa7ddf1fb39719c252604beb9900edec","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"abix5","email":"abix5@yandex.ru"},"repository":{"url":"git+https://github.com/abix5/opencode-hindsight.git","type":"git"},"_npmVersion":"10.9.3","description":"Hindsight memory bank plugin for OpenCode","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@opencode-ai/plugin":"^1.1.53"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.2","@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/opencode-hindsight_0.3.0_1771919553561_0.9513659357942601","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@abix5/opencode-hindsight","version":"0.4.0","keywords":["opencode","opencode-plugin","hindsight","memory","ai","llm"],"license":"MIT","_id":"@abix5/opencode-hindsight@0.4.0","maintainers":[{"name":"abix5","email":"abix5@yandex.ru"}],"homepage":"https://github.com/abix5/opencode-hindsight#readme","bugs":{"url":"https://github.com/abix5/opencode-hindsight/issues"},"bin":{"opencode-hindsight":"dist/cli.js"},"dist":{"shasum":"e37e8658c5cadd106d3899f0aa97b1365380f140","tarball":"https://registry.npmjs.org/@abix5/opencode-hindsight/-/opencode-hindsight-0.4.0.tgz","fileCount":43,"integrity":"sha512-ntuI/m6ipKIDsvzR7/H4HvYxCZsD4wAYilK3Pd1UDGyZn1AvBkNaXRkjUZzdVrSCsHmT+sXhRPArwheQyTdrHw==","signatures":[{"sig":"MEUCIFp8E4lVvBMv8wJnyhPIRrIqOYjRhzWwkk3dhnrbqOv6AiEAqolCm/LvmnW7rjswuIVIDlGCxHsc4TKqYR1/sSxSr+s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":302483},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4f2fb6aed780f93e6abdaa3769a78e95ac9f8002","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"abix5","email":"abix5@yandex.ru"},"repository":{"url":"git+https://github.com/abix5/opencode-hindsight.git","type":"git"},"_npmVersion":"10.9.3","description":"Hindsight memory bank plugin for OpenCode","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@opencode-ai/plugin":"^1.1.53"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.2","@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/opencode-hindsight_0.4.0_1773139495225_0.7516751228858076","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@abix5/opencode-hindsight","version":"0.5.0","keywords":["opencode","opencode-plugin","hindsight","memory","ai","llm"],"license":"MIT","_id":"@abix5/opencode-hindsight@0.5.0","maintainers":[{"name":"abix5","email":"abix5@yandex.ru"}],"homepage":"https://github.com/abix5/opencode-hindsight#readme","bugs":{"url":"https://github.com/abix5/opencode-hindsight/issues"},"bin":{"opencode-hindsight":"dist/cli.js"},"dist":{"shasum":"e70b44e4716f02022d7c2104ca45ae18edadbb8c","tarball":"https://registry.npmjs.org/@abix5/opencode-hindsight/-/opencode-hindsight-0.5.0.tgz","fileCount":37,"integrity":"sha512-P8eR4lrXW0NqVMzdDKMuHKSjhRPkqoo58YNz9I45FvHt6WKNHLAcLNEk29aw12MtZmCHJsV5E5Ab6EflnsB+rw==","signatures":[{"sig":"MEQCIBfZgQBCKcX0jzrBQZX5XaYU7hemj2qO5J5rtCmi/96/AiBzQ/TAgEoZmuSfB1sqGW4YS0JBE3jaGBS6kuuMbvYDZQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":299627},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8e2a41127378b9ea3fc800dfc2b1f6d12230f36b","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"abix5","email":"abix5@yandex.ru"},"repository":{"url":"git+https://github.com/abix5/opencode-hindsight.git","type":"git"},"_npmVersion":"10.9.3","description":"Hindsight memory bank plugin for OpenCode","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@opencode-ai/plugin":"^1.1.53"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.2","@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/opencode-hindsight_0.5.0_1773168426500_0.4746699377660817","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@abix5/opencode-hindsight","version":"0.5.1","keywords":["opencode","opencode-plugin","hindsight","memory","ai","llm"],"license":"MIT","_id":"@abix5/opencode-hindsight@0.5.1","maintainers":[{"name":"abix5","email":"abix5@yandex.ru"}],"homepage":"https://github.com/abix5/opencode-hindsight#readme","bugs":{"url":"https://github.com/abix5/opencode-hindsight/issues"},"bin":{"opencode-hindsight":"dist/cli.js"},"dist":{"shasum":"9f9531062c9c039ec7216456ca8d74931881feb5","tarball":"https://registry.npmjs.org/@abix5/opencode-hindsight/-/opencode-hindsight-0.5.1.tgz","fileCount":37,"integrity":"sha512-CZfwiZik9yER1ReEOAzWuIWrN5AfJxfhl7vXYAsF9vJ3TllPgssw2WybIYX8ri3UDErYNBN529sdXerloGijKw==","signatures":[{"sig":"MEUCIQDdjrk5ws621ifBVin4Ke7HRGqYflQPRqKfMMMXx8HqEgIgba19bDPFcZYwb9ZHAOWbLHudlPMvZp/xVTFWyerO5uk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296222},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"a0f71ac6d4e09e294f84e56be731a1bce69698c5","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"abix5","email":"abix5@yandex.ru"},"repository":{"url":"git+https://github.com/abix5/opencode-hindsight.git","type":"git"},"_npmVersion":"10.9.3","description":"Hindsight memory bank plugin for OpenCode","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@opencode-ai/plugin":"^1.1.53"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.2","@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/opencode-hindsight_0.5.1_1773205139078_0.7760387770659596","host":"s3://npm-registry-packages-npm-production"}},"0.5.2":{"name":"@abix5/opencode-hindsight","version":"0.5.2","keywords":["opencode","opencode-plugin","hindsight","memory","ai","llm"],"license":"MIT","_id":"@abix5/opencode-hindsight@0.5.2","maintainers":[{"name":"abix5","email":"abix5@yandex.ru"}],"homepage":"https://github.com/abix5/opencode-hindsight#readme","bugs":{"url":"https://github.com/abix5/opencode-hindsight/issues"},"bin":{"opencode-hindsight":"dist/cli.js"},"dist":{"shasum":"622852e5974bbcee5b77a135765c82eb33fe2880","tarball":"https://registry.npmjs.org/@abix5/opencode-hindsight/-/opencode-hindsight-0.5.2.tgz","fileCount":37,"integrity":"sha512-2yLDUIc3E6axzqSwDMCsaUbNthCI1edb7ecS+H1IdEzTBx3QqdU3gpwQlOiCL02cOTxadQX/5wMJrTZDonyDIg==","signatures":[{"sig":"MEYCIQDFiIYJz9jmbFaR/fmPvYpTgqAXJDxXiDQsWTqTgSMcvAIhAPR1jL9guYc001H8xJcy/ROXHgDEELi6qVimJ0EW2mqp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296580},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"392f8ec81f3550621ad38e556907589b5f2581d8","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"_npmUser":{"name":"abix5","email":"abix5@yandex.ru"},"repository":{"url":"git+https://github.com/abix5/opencode-hindsight.git","type":"git"},"_npmVersion":"10.9.3","description":"Hindsight memory bank plugin for OpenCode","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@opencode-ai/plugin":"^1.1.53"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.2","@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/opencode-hindsight_0.5.2_1773206788310_0.9721459793093854","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@abix5/opencode-hindsight","version":"0.6.0","keywords":["opencode","opencode-plugin","hindsight","memory","ai","llm"],"license":"MIT","_id":"@abix5/opencode-hindsight@0.6.0","maintainers":[{"name":"abix5","email":"abix5@yandex.ru"}],"homepage":"https://github.com/abix5/opencode-hindsight#readme","bugs":{"url":"https://github.com/abix5/opencode-hindsight/issues"},"bin":{"opencode-hindsight":"dist/cli.js"},"dist":{"shasum":"bcd010905fc440bb30648b92b3b5b459271eb73c","tarball":"https://registry.npmjs.org/@abix5/opencode-hindsight/-/opencode-hindsight-0.6.0.tgz","fileCount":106,"integrity":"sha512-K+Q/mJLSKArlaheGUhotWWE6iVf1umRb3/6O1MlBys1X95DLGX9uc/eu9XmL84ZiPIEuvDJMygZj4/1X3eNLUg==","signatures":[{"sig":"MEYCIQChLs7KL4HvIUR84QtYsPS3I3yk81HpKBmg4E7yNM5BuwIhAOjfd4/ye1H15e1Uk3VKs89QaMcDM/z6N0Vh/Zn1xdwJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":559401},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"f38a434ee9af6752b873a6ead6b88e75eda8c9e2","scripts":{"test":"vitest run","build":"tsc","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"abix5","email":"abix5@yandex.ru"},"repository":{"url":"git+https://github.com/abix5/opencode-hindsight.git","type":"git"},"_npmVersion":"10.9.3","description":"Hindsight memory bank plugin for OpenCode","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@opencode-ai/sdk":"^1.4.12","@opencode-ai/plugin":"^1.4.12","@vectorize-io/hindsight-client":"^0.5.3"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","typescript":"^5.8.2","@types/node":"^25.2.1"},"_npmOperationalInternal":{"tmp":"tmp/opencode-hindsight_0.6.0_1776682026389_0.6890761189629473","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@abix5/opencode-hindsight","version":"0.7.0","description":"Hindsight memory bank plugin for OpenCode","type":"module","main":"dist/index.js","bin":{"opencode-hindsight":"dist/cli.js"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"repository":{"type":"git","url":"git+https://github.com/abix5/opencode-hindsight.git"},"bugs":{"url":"https://github.com/abix5/opencode-hindsight/issues"},"homepage":"https://github.com/abix5/opencode-hindsight#readme","engines":{"node":">=22"},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run build"},"keywords":["opencode","opencode-plugin","hindsight","memory","ai","llm"],"license":"MIT","dependencies":{"@opencode-ai/plugin":"^1.4.12","@opencode-ai/sdk":"^1.4.12","@vectorize-io/hindsight-client":"^0.5.3"},"devDependencies":{"@types/node":"^25.2.1","typescript":"^5.8.2","vitest":"^4.0.18"},"_id":"@abix5/opencode-hindsight@0.7.0","gitHead":"b4792d210dd4643bad21ded62bfaffb0ff12b2a1","types":"./dist/index.d.ts","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-rRdC338tdf630X6mPqnHAMHQOcxBUU+84UvzDUxRCFF8P5rjAYQVF1wMuWXfXM3EJv5sYx6t9ppdPHsO1zH/cA==","shasum":"bb16c6373c0dd4a66261e7c60ce149f661575d97","tarball":"https://registry.npmjs.org/@abix5/opencode-hindsight/-/opencode-hindsight-0.7.0.tgz","fileCount":115,"unpackedSize":610850,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDxxpJyJudQduN8Mrpsp5YUCISQXhGhDuVsgYHSfX1FjQIhAMoPIIhXiV5U3nX6jxoSUoEgLOzCC9amln5ilobCMS2+"}]},"_npmUser":{"name":"abix5","email":"abix5@yandex.ru"},"directories":{},"maintainers":[{"name":"abix5","email":"abix5@yandex.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/opencode-hindsight_0.7.0_1776859594886_0.5429522029663272"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-20T17:51:18.204Z","modified":"2026-04-22T12:06:35.165Z","0.2.1":"2026-02-20T17:51:18.525Z","0.3.0":"2026-02-24T07:52:33.689Z","0.4.0":"2026-03-10T10:44:55.386Z","0.5.0":"2026-03-10T18:47:06.679Z","0.5.1":"2026-03-11T04:58:59.230Z","0.5.2":"2026-03-11T05:26:28.501Z","0.6.0":"2026-04-20T10:47:06.545Z","0.7.0":"2026-04-22T12:06:35.041Z"},"bugs":{"url":"https://github.com/abix5/opencode-hindsight/issues"},"license":"MIT","homepage":"https://github.com/abix5/opencode-hindsight#readme","keywords":["opencode","opencode-plugin","hindsight","memory","ai","llm"],"repository":{"type":"git","url":"git+https://github.com/abix5/opencode-hindsight.git"},"description":"Hindsight memory bank plugin for OpenCode","maintainers":[{"name":"abix5","email":"abix5@yandex.ru"}],"readme":"# opencode-hindsight\n\nPersistent project memory for [OpenCode](https://opencode.ai), powered by [Hindsight](https://github.com/vectorize-io/hindsight).\n\n`opencode-hindsight` gives your OpenCode agent a living memory of architectural decisions, conventions, tradeoffs, and lessons — auto-recalled on every user turn, auto-retained on session compaction, and configurable through an interactive wizard.\n\n## What You Get\n\n- **Auto-recall on every user message.** Conservative 60 s timeout, XML-tagged injection in the system prompt, session-level dedup.\n- **Auto-retain on compaction and session end.** Background queue with exponential backoff if the server is down.\n- **Interactive wizard via tools and natural language.** Ask to configure or reconfigure the memory bank and the agent will drive `hindsight_config_wizard` + `hindsight_bank` directly.\n- **Full Hindsight v0.5 API.** `retain` with document IDs / entities / strategies / observation scopes; `recall` with types / tag-groups / includes; `reflect` with response schemas and tool-call traces.\n- **Bulk ingest.** `hindsight_ingest` uploads whole directories of Markdown / PDF / DOCX through Hindsight's file pipeline with a built-in secrets denylist.\n- **Memory researcher sub-agent.** Dedicated `memory-researcher` for multi-query investigations.\n- **Dynamic tool descriptions.** `hindsight_retain` / `hindsight_recall` / `hindsight_reflect` pick up retain strategies, hot topics, and mental model names from the current bank at LLM call time.\n- **Official SDK under the hood.** Built on `@vectorize-io/hindsight-client`, with thin wrappers only for endpoints the SDK does not cover yet (bank template import/export, mental-model trigger v0.5, retain v2).\n- **Minimal slash surface.** The plugin relies on native `/hindsight:*` tool commands exported by OpenCode and does not install extra alias skills like `/retain` or `/recall`.\n- **Safe apply.** Every wizard apply is preceded by an automatic snapshot of the live bank state.\n\n## Requirements\n\n- OpenCode with plugin support (`@opencode-ai/plugin >= 1.4.12`).\n- Node.js `>=22`.\n- A running Hindsight API server — self-hosted (`http://localhost:8888`) or Hindsight Cloud (`https://api.hindsight.vectorize.io`) with `HINDSIGHT_API_TOKEN`.\n\n### Recommended Companion Plugin\n\n`opencode-hindsight` works standalone, but it is strongly recommended to use it together with `oh-my-opencode`:\n\n- `oh-my-opencode` provides `/init-deep` and directory-level `AGENTS.md` hierarchy.\n- `opencode-hindsight` uses that hierarchy for path-aware mental model injection.\n- Result: cleaner, module-relevant context and less prompt noise.\n\n## Install\n\n```bash\nbunx @abix5/opencode-hindsight install\n```\n\nThis command:\n\n- registers the plugin in OpenCode config,\n- installs the agent, templates, and bank presets into OpenCode config directories.\n\nUseful flags:\n\n- `--project` installs assets into project `.opencode/`, but the plugin entry itself is still registered through the global OpenCode config.\n\nAlternative: add `\"@abix5/opencode-hindsight\"` to `plugins[]` in `opencode.json`; assets auto-bootstrap on first run.\n\n## Quick Start\n\n1. Start Hindsight server.\n2. Start OpenCode.\n3. Run `/hindsight:init`.\n4. Work normally; memory tools run as needed.\n\n## User Workflow (Short Version)\n\n1. Before important design/tech decisions, ask the assistant to check memory first.\n2. After agreeing on a decision, ask it to save the decision (WHAT + WHY).\n3. If memory-derived context seems stale, inspect operations and refresh scope/models.\n\n### Example prompts\n\n- `Check what we previously decided about API auth before proposing changes.`\n- `Save this decision: we keep typed REST client for Hindsight because shell integration is too fragile in CI.`\n- `Show pending memory operations and explain why the model is not updated yet.`\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `/hindsight:init` | Initialize memory bank for the current project |\n| `/hindsight:info` | Show bank health, config, directives, counters, and configuration guidance |\n| `/hindsight:pause` | Toggle pause/resume for automatic memory behavior |\n\nOther actions (configuration, ingest, capture mode, mental models, scope diagnostics, operations, assets) are available via native `/hindsight:*` tools or natural language — just ask the assistant.\n\n## Tools Exposed to OpenCode\n\n| Tool | Purpose |\n|---|---|\n| `hindsight_init` | Initialize bank and local config |\n| `hindsight_retain` | Advanced/internal low-level save tool (prefer memory-keeper delegation) |\n| `hindsight_recall` | Advanced/internal low-level search tool (prefer memory-keeper delegation) |\n| `hindsight_reflect` | Synthesize patterns across all memory |\n| `hindsight_mental_model` | Manage auto-updating living docs |\n| `hindsight_context` | Manage context injection directives/scopes |\n| `hindsight_info` | Connection/config/status overview and configuration tips |\n| `hindsight_tags` | List available tags and policy |\n| `hindsight_capture` | Configure capture policy mode |\n| `hindsight_scope` | Inspect active scope and refresh scope refs |\n| `hindsight_operations` | Inspect async operation status |\n| `hindsight_assets` | Manage installed markdown assets |\n\n## Capture Modes\n\nCapture mode is stored in `.opencode/hindsight/config.json` as `memory_capture_mode`.\n\n- `autonomous`: save immediately.\n- `propose`: request confirmation via interactive `ask`.\n- `manual`: do not save unless explicitly approved.\n\nIf interactive approval is unavailable, delegated retention may need a follow-up direct `hindsight_retain` call with `approved: true`.\n\n## Scope Registry\n\n`.opencode/hindsight/scopes.json` defines path-scoped behavior for memory retrieval and model injection. It is auto-created by `hindsight_init` with an empty `scopes` list.\n\nExample:\n\n```json\n{\n  \"version\": 1,\n  \"default_scope\": \"shared\",\n  \"scopes\": [\n    {\n      \"id\": \"scope:api\",\n      \"paths\": [\"apps/api/**\"],\n      \"model_refs\": [\"API Context\"],\n      \"memory_tags\": [\"scope:api\"],\n      \"retrieval_mode\": \"advisory\"\n    }\n  ]\n}\n```\n\nRetrieval modes:\n\n- `open`: no tags injected by default.\n- `advisory`: uses `tags_match=any` (tagged + untagged memories).\n- `strict`: uses `tags_match=all_strict` (tagged only).\n\nDefault behavior:\n\n- `hindsight_recall` / `hindsight_reflect`: if `tags` are not provided, active scope defaults are applied.\n- `hindsight_retain`: if `tags` are not provided and tags are enabled, active scope tags are auto-applied.\n- If scope is `strict` but tags are disabled, plugin warns and degrades to advisory/open behavior.\n\n## Context Injection and Directory Awareness\n\nMental model directives use compact syntax:\n\n```html\n<!-- hs:model Model Name -->\n```\n\nSupported locations:\n\n- root `AGENTS.md` / `CLAUDE.md` (always context),\n- nested `AGENTS.md` / `CLAUDE.md` (directory-scoped context),\n- `.opencode/agents/*.md`,\n- `SKILL.md` files.\n\nThe plugin tracks active session path from file tools (`read/edit/write/glob/grep`) and injects only relevant model content.\n\n## Troubleshooting\n\nCommon warnings and fixes:\n\n- `HS_MODEL_MISSING`: check `model_refs` and model existence via `hindsight_mental_model list_detailed`.\n- `HS_MODEL_EMPTY`: refresh the model and review `source_query`.\n- `HS_SCOPE_TAG_MISMATCH`: align scope tags and model tags.\n- `HS_SCOPE_NO_DATA`: add retained memories with matching scope tags.\n- `HS_SCOPE_STRICT_REQUIRES_TAGS`: enable tags or switch scope retrieval mode.\n\nUseful diagnostics:\n\n- Ask: \"audit my scope\" or \"explain current scope\"\n- Ask: \"list mental models\" or \"inspect model X\"\n- Ask: \"show pending operations\" or \"any failed operations?\"\n\n## CLI\n\n```bash\nbunx @abix5/opencode-hindsight install\nbunx @abix5/opencode-hindsight sync [--project]\nbunx @abix5/opencode-hindsight status\nbunx @abix5/opencode-hindsight uninstall\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}