ai-memory plugin
The released @aviaratech/ai-memory runtime includes this built self-contained plugin under plugins/ai-memory. Its portable plugin.json/mcp.json metadata supports Codex, while .claude-plugin/plugin.json/.mcp.json preserves Claude Code compatibility. The matching GitHub plugin archive contains the same files, including bundled launcher/server, skills, hooks, canonical migrations, license and third-party notices. No private checkout, source build or npm postinstall is needed by consumers.
SessionStart adds the same pinned project brief on startup, clear and compact. AI_MEMORY_ROLE selects the role (default default); audience tags select all, host or role, with role state first. The hook refreshes a private cache per project/host/role and reuses it with a generated-at warning when PostgreSQL is unavailable. If Codex hooks are off, run ai-memory brief --project example/catalog --host codex --role lead --out ./project-brief.md and include that file as context. The repository README documents metadata, ordering, limits and cache location. This command does not enable hooks or install configuration.
Use ai-memory plugin install|doctor|update|rollback|remove with explicit --host codex|claude-code and --scope; install/update also require the exact runtime --version. The helper verifies actual native registration and launcher bytes. Hook review/trust and host restart remain explicit actions. Configure the dedicated protected ~/.config/ai-memory/plugin.env file and initialize PostgreSQL separately; plugin doctor verifies schema readiness read-only before an MCP handshake. See the installation guide for supported scopes, recovery, conflicts and data preservation.
When supported and enabled by the native host, SessionStart with source: startup arms one task retrieval. The first nonempty UserPromptSubmit consumes that eligibility and adds at most 3,200 decoded characters containing memory IDs, categories, dates and excerpts. Later prompts, startup replay, and resume, compact, fork or clear events do not rearm it. Missing or expired lifecycle state suppresses automatic retrieval; explicit memory tools remain available. Unknown harnesses do not run these automatic reads.
PreCompact writes a derived checkpoint only for the validated producing session and repository. It uses the supplied transcript path and preserves a competing newer explicit flush. Unsupported, oversized, missing or inconsistent transcripts leave checkpointing unavailable. Session start prefers a matching task checkpoint; otherwise it shows keyed durable project facts without another session's latest flush. Explicit logical-task recovery continues to preserve the original producing session.
The narrow PostToolUse hook observes successful memory_get results from the bundled ai-memory server names. Invocation telemetry stores bounded numeric IDs and harness/session/project/time metadata, without prompt text, memory contents or raw tool arguments. Existing session ingestion can also observe explicit assistant [memory:123] citations with original timestamps. Citation coverage is partial because history is bounded and host transcript formats can change. The health report shows the last seven days of distinct injected session/ID pairs and matching later observed use per harness; missing observations yield an unavailable rate. These counts are an observed lower bound, not proof of semantic use.
Hook payloads follow the current Claude Code and Codex contracts. Packaging source hooks does not establish that a particular installed native version supports or has activated them. Issue #34 remains open until separately authorized operator acceptance includes seven days of actual use data.
For contributors, npm run build from the repository root bundles the launcher/server, copies core migrations, and stages the same plugin inventory into the runtime package. Build scripts are not shipped in the consumer plugin.