Conversation
…ion skills packages/claude-code-plugin is a Claude Code plugin, installable from this repository's .claude-plugin/marketplace.json as magic-context@cortexkit. It shares context.db with the other hosts as the claude-code harness. - MCP server with ctx_memory, ctx_note, ctx_search, ctx_expand and ctx_skill. ctx_search and ctx_expand read Claude Code's transcripts, so what Claude Code compacted away stays recoverable. - SessionStart hook injects project memory, session notes and the project's operation skills on startup, resume, /clear and after compaction. - Operation skills record a project's verified flows (trigger -> action -> APIs -> data written -> state updated -> runnable steps -> verification) in the project's .claude/skills/, where Claude Code loads them as native skills. Referenced files are hashed so changed code is flagged. - UserPromptSubmit hook: a prompt that names a recorded button or intent gets the verified operation in context. - Stop hook: after verified work the session's own model is asked once to record it; no separate model is configured. Shared code changes are additive: ctx_search and ctx_expand take an optional compaction cutoff, HarnessId gains "claude-code", and two memory rendering helpers are exported. OpenCode and Pi keep their current behaviour. The plugin's dist/ is committed because Claude Code installs a plugin by copying it out of the marketplace repository with no build step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Harness coverage advisory: these conventional twins were not touched:
Cover every shipped harness or explain why the surface does not exist there. See CONTRIBUTING.md. This is advisory only; no draft state is changed. |
|
This PR needs a linked issue with the |
|
Thank you for the time and care you put into this. The live I'm closing it, and I'm sorry the reason is one our process is meant to prevent. Full Claude Code support for Magic Context is already built, and it covers context management (tags, Operation skills (recording verified UI flows as Claude Code skills) are an interesting idea, but they're a separate product from context management, so we wouldn't take them into this repository. If you'd like to keep developing them, a standalone plugin that uses Magic Context's memory tools would be a good fit. If you want to contribute again, please open an issue first. I'll make sure it gets a quick answer. |
Approved issue: none yet. Opened as a draft, as CONTRIBUTING.md asks, until a design proposal for a Claude Code host is approved.
Summary
Adds
packages/claude-code-plugin, a Claude Code plugin installable from this repository's.claude-plugin/marketplace.jsonasmagic-context@cortexkit. It sharescontext.dbwith OpenCode and Pi as theclaude-codeharness.ctx_memory,ctx_note,ctx_searchandctx_expand. ASessionStarthook injects project memory and session notes on startup, resume,/clearand after compaction.ctx_searchandctx_expandread Claude Code's own transcripts, so what Claude Code compacted away stays recoverable.ctx_skill,/magic-context:capture-skill). These record a project's verified flows in the project's.claude/skills/, where Claude Code loads them as native skills. Each flow is button/event → action → APIs → data written → state updated → runnable steps → verification, plus a per-skill setup. Referenced files are hashed so changed code is flagged.UserPromptSubmithook adds the verified operation to the model's context when a prompt names a recorded button or intent. It reads only the skill files and takes about 50 ms.Stophook asks the running model once to save it. No separate model is configured.ctx_reduce, historian, dreamer and compartments. Local embeddings are not bundled, so search is lexical unless an embedding endpoint is configured. Details are inpackages/claude-code-plugin/README.md.packages/claude-code-plugin/dist/is committed, because Claude Code installs a plugin by copying it out of the marketplace repository with no build step (.gitignoreexception,linguist-generatedin.gitattributes).Shared code (additive)
ctx_searchandctx_expandtake an optional compaction cutoff (resolveMessageOrdinalCutoff,getLastCompactedOrdinal). When it is omitted they use the last compartment end, exactly as before.HarnessIdgains"claude-code". The stale-build notice and the prompt-surface config lookup handle it.resolveWorkspaceRenderContextandsourceNamesForMemoriesare exported frominject-compartments.tsso the plugin renders memories the same way. This is an export only.packages/plugin/src/shared/tool-schema.tsexposes the zod schema helper used by the MCP tools.Harness coverage (required)
For each entry select: covered / not applicable — surface does not exist there / NOT covered.
ctx_search/ctx_expand/stale-build changes keep the existing default path, andpackages/plugintests pass. The new Claude Code surfaces (ctx_skill, prompt and Stop hooks) are not applicable: they do not exist there.inject-compartments.tschange is export-only, and Pi uses its ownresolveWorkspaceRenderContextPi, so the twininject-compartments-pi.tsneeds no change.packages/pi-plugintests pass. The new Claude Code surfaces are not applicable.mc-modulealready accepts theclaude-codeharness id, and the dashboard parses it asClaudeCode.Testing
bun run typecheck,bun run build,check:tui-compiled, the historian prompt golden check andbun run dists:load-probepass.Tests:
packages/plugin: 6661 pass, 1 fail.clean-dist-chunks.test.tsneedsrsync, which the test machine lacked; it passes 8/8 withrsyncavailable.packages/pi-plugin: 1486 pass.packages/claude-code-plugin: 93 pass.packages/cli: 633 pass.packages/retina-local-fs: 26 pass.bun run lintpasses forpi-plugin,claude-code-plugin,cliandretina-local-fs.packages/pluginreports 3 import-order errors in files this PR does not touch (config/schema/magic-context.ts,historian-expand-tools.test.ts,read-session-chunk.ts, fromcad8ca016); the files this PR changes are clean.packages/claude-code-plugin/scripts/smoke.tscovers:/clearsession switching;--live, realclaude -psessions.The live sessions cover memory save and recall, recall after
/compact, capturing a demo frontend's buttons as operation skills, a fresh session performing a recorded operation without re-reading the source, and the Stop hook updating a skill after a verified change. The offline and live runs pass.Release notes: a "Claude Code (new)" section in
.cortexkit/alfonso/release-notes/v0.45.0.md;node scripts/check-release-notes.mjspasses.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Adds
packages/claude-code-plugin, bringing Magic Context's memory layer to Claude Code with shared memory, compaction recall, and operation skills — backed by the samecontext.dbas OpenCode and Pi.What the plugin provides
ctx_memory,ctx_note,ctx_search,ctx_expand, andctx_skill.SessionStarthook injects project memory and session notes on startup, resume,/clear, and after compaction.ctx_searchandctx_expandread Claude Code's transcripts, so compacted messages stay recoverable..claude/skills/, loaded as native skills; referenced files are hashed to flag drift.UserPromptSubmitinjects a matching operation when a prompt names it; theStophook asks the session's own model once to record verified work — no separate model is configured.ctx_reduce, historian, dreamer, compartments; local embeddings aren't bundled, so search is lexical unless an OpenAI-compatible embedding endpoint is configured.dist/is committed because Claude Code installs a plugin by copying it out of the marketplace with no build step.Shared code changes (additive)
HarnessIdadds"claude-code"; stale-build guidance and the prompt-surface config lookup handle it.ctx_searchandctx_expandtake an optional compaction cutoff, defaulting to the last compartment end as before.resolveWorkspaceRenderContextandsourceNamesForMemoriesare now exported (export-only);tool-schema.tsre-exports the zod helper the MCP adapter uses.Written for commit 19a7c3f. Summary will update on new commits.