You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aidd-context ships hooks/hooks.json, which runs update_memory.js at Claude Code SessionStart. That script refreshes the generated memory block in the project's already-wired context files.
OpenCode flat output currently declares hooks unsupported, and the pending Kilo flat contract does the same. AIDD therefore installs skills and agents for those tools but does not install the automatic memory synchronization hook. Memory can still be synchronized manually by 02-project-memory, but it is not refreshed when a session begins.
This is not a request to convert hooks.json: both tools use local JavaScript/TypeScript plugins and their event APIs. Kilo support in this issue is conditional: PR #745 is a draft, has not been reviewed or merged, and may not be accepted.
Scope
Implement the project-memory synchronization behavior as local plugin adapters:
OpenCode: a project plugin under .opencode/plugins/.
Kilo: a project plugin under .kilo/plugin/, only after Kilo is a supported target.
Verify the documented session-start-equivalent event for each tool and invoke the sync once per newly created session; do not infer a Claude event-name mapping.
Reuse one implementation of the memory-sync logic. Extract a shared core from update_memory.js, or otherwise prove that no behavior is duplicated between Claude, OpenCode, and Kilo.
Preserve the current guard behavior: no memory bank or no existing managed block means no unexpected file creation; malformed markers are reported without overwriting user content.
Make a plugin failure non-blocking for the AI session and surface a useful diagnostic.
Add the corresponding target-specific hook support only when a runtime smoke test proves that the plugin loads and the event fires.
Update 08-hook-generate so it can direct a user to the supported plugin shape instead of offering declarative hook output for OpenCode or Kilo.
Acceptance criteria
In a real OpenCode project containing an already-wired aidd_docs/memory/ bank and AGENTS.md, starting a new session refreshes the generated memory block exactly once.
The OpenCode plugin is loaded from the documented project plugin directory and does not require a global installation.
If the bank is absent, no managed block exists, or markers are malformed, the plugin does not overwrite files or prevent the session from starting; it reports the reason.
A second session with unchanged memory produces no content drift.
The Kilo equivalent passes the same runtime checks only after feat(cli): add Kilo Code support #745 is merged; otherwise the Kilo work remains explicitly blocked.
The Kilo plugin is loaded from .kilo/plugin/ and is tested through the Kilo CLI or VS Code extension, not only by inspecting files.
The implementation shares the sync logic with the existing Claude hook rather than maintaining independent copies.
Existing Claude, Cursor, Codex, and Copilot hook behavior remains unchanged.
Unit, integration, golden, typecheck, lint, and target-runtime smoke tests pass for every implemented target.
08-hook-generate tool paths already identify OpenCode hooks as plugin code rather than declarative configuration.
External references, verified 2026-09-06
OpenCode plugins: local project plugins are JavaScript/TypeScript modules under .opencode/plugins/.
Kilo plugins: project plugins load from .kilo/plugin/; they are JavaScript/TypeScript modules and expose session events such as session.created.
Relation to the intentional YAGNI decision
This is separate from the rules/commands work in #789. The scope comment on draft PR #745 records why those static artifact kinds were intentionally skipped. Hooks are different: they are executable lifecycle integrations and require target-native plugin adapters.
Out of scope
Generic conversion of arbitrary Claude hooks.json files into OpenCode or Kilo plugins.
A generic hook-plugin generator beyond the aidd-context project-memory synchronization use case.
Problem
aidd-contextshipshooks/hooks.json, which runsupdate_memory.jsat Claude CodeSessionStart. That script refreshes the generated memory block in the project's already-wired context files.OpenCode flat output currently declares hooks unsupported, and the pending Kilo flat contract does the same. AIDD therefore installs skills and agents for those tools but does not install the automatic memory synchronization hook. Memory can still be synchronized manually by
02-project-memory, but it is not refreshed when a session begins.This is not a request to convert
hooks.json: both tools use local JavaScript/TypeScript plugins and their event APIs. Kilo support in this issue is conditional: PR #745 is a draft, has not been reviewed or merged, and may not be accepted.Scope
.opencode/plugins/..kilo/plugin/, only after Kilo is a supported target.update_memory.js, or otherwise prove that no behavior is duplicated between Claude, OpenCode, and Kilo.08-hook-generateso it can direct a user to the supported plugin shape instead of offering declarative hook output for OpenCode or Kilo.Acceptance criteria
aidd_docs/memory/bank andAGENTS.md, starting a new session refreshes the generated memory block exactly once..kilo/plugin/and is tested through the Kilo CLI or VS Code extension, not only by inspecting files.Prior art in this repository
aidd-contexthook definition registersupdate_memory.jsat ClaudeSessionStart.update_memory.jsowns the existing synchronization behavior and supported invocation modes.02-project-memorysync action defines the manual fallback and validation contract.08-hook-generatetool paths already identify OpenCode hooks as plugin code rather than declarative configuration.External references, verified 2026-09-06
.opencode/plugins/..kilo/plugin/; they are JavaScript/TypeScript modules and expose session events such assession.created.Relation to the intentional YAGNI decision
This is separate from the
rules/commandswork in #789. The scope comment on draft PR #745 records why those static artifact kinds were intentionally skipped. Hooks are different: they are executable lifecycle integrations and require target-native plugin adapters.Out of scope
hooks.jsonfiles into OpenCode or Kilo plugins.aidd-contextproject-memory synchronization use case.