{"id":47706178,"url":"https://github.com/cortexkit/opencode-magic-context","last_synced_at":"2026-04-15T10:04:04.028Z","repository":{"id":347049206,"uuid":"1192646696","full_name":"cortexkit/opencode-magic-context","owner":"cortexkit","description":"OpenCode plugin for Magic Context — cache-aware infinite context, cross-session memory, and background history compression for AI coding agents","archived":false,"fork":false,"pushed_at":"2026-04-12T18:44:31.000Z","size":81176,"stargazers_count":146,"open_issues_count":0,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-12T19:02:24.744Z","etag":null,"topics":["agent-context","agent-framework","agent-memory","ai","ai-agents","ai-context","ai-memory","cache-aware","context-engineering","context-management","langchain","memory","opencode"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cortexkit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-26T12:27:01.000Z","updated_at":"2026-04-12T18:44:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b61c62e-9af5-41ef-a0af-029ea91c2924","html_url":"https://github.com/cortexkit/opencode-magic-context","commit_stats":null,"previous_names":["cortexkit/opencode-magic-context"],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/cortexkit/opencode-magic-context","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cortexkit%2Fopencode-magic-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cortexkit%2Fopencode-magic-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cortexkit%2Fopencode-magic-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cortexkit%2Fopencode-magic-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cortexkit","download_url":"https://codeload.github.com/cortexkit/opencode-magic-context/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cortexkit%2Fopencode-magic-context/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31835821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T07:17:56.427Z","status":"ssl_error","status_checked_at":"2026-04-15T07:17:30.007Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-context","agent-framework","agent-memory","ai","ai-agents","ai-context","ai-memory","cache-aware","context-engineering","context-management","langchain","memory","opencode"],"created_at":"2026-04-02T17:58:50.099Z","updated_at":"2026-04-15T10:04:03.987Z","avatar_url":"https://github.com/cortexkit.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003eMagic Context\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eCache-aware infinite context, cross-session memory, and background history compression for AI coding agents.\u003c/strong\u003e\u003cbr\u003e\n  An \u003ca href=\"https://github.com/anomalyco/opencode\"\u003eOpenCode\u003c/a\u003e plugin that keeps your agent's memory intact — no matter how long the session runs.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@cortexkit/opencode-magic-context\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@cortexkit/opencode-magic-context?color=blue\u0026style=flat-square\" alt=\"npm\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/cortexkit/opencode-magic-context/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/cortexkit/opencode-magic-context?style=flat-square\u0026color=yellow\" alt=\"stars\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/cortexkit/opencode-magic-context/commits\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/cortexkit/opencode-magic-context?style=flat-square\u0026color=green\" alt=\"last commit\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/cortexkit/opencode-magic-context/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green?style=flat-square\" alt=\"MIT License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/packages/plugin/docs/animation/out/optimized2.gif\" alt=\"Magic Context in action\" width=\"720\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#get-started\"\u003eGet Started\u003c/a\u003e ·\n  \u003ca href=\"#what-is-magic-context\"\u003eWhat is Magic Context?\u003c/a\u003e ·\n  \u003ca href=\"#what-your-agent-gets\"\u003eWhat Your Agent Gets\u003c/a\u003e ·\n  \u003ca href=\"#how-it-works\"\u003eHow It Works\u003c/a\u003e ·\n  \u003ca href=\"#magic-context-app\"\u003e🖥️ Desktop App \u003csup\u003e(NEW)\u003c/sup\u003e\u003c/a\u003e ·\n  \u003ca href=\"#commands\"\u003eCommands\u003c/a\u003e ·\n  \u003ca href=\"#configuration\"\u003eConfiguration\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## What is Magic Context?\n\nYour agent should never stop working to manage its own context. Magic Context is an OpenCode plugin that handles context and memory management entirely in the background:\n\n**1.** Transparent context compaction via a background historian — the main agent keeps working while a separate model compresses older conversation. All operations are **cache-aware** and deferred to avoid wasting cached prefixes.\n\n**2.** Cross-session project memory — architecture decisions, constraints, and preferences persist across conversations.\n\n**3.** Overnight dreamer agent that consolidates, deduplicates, and promotes memories into canonical facts, plus maintains codebase documentation.\n\n**4.** On-demand sidekick that augments prompts with relevant project context.\n\n**5.** TUI sidebar with live context breakdown, token usage, historian status, and memory counts — right inside the terminal.\n\n### 🧪 New Experimental Features\n\n**Compaction Markers** — after historian compresses older messages, Magic Context injects a boundary into OpenCode's message table. OpenCode's built-in message loader stops at the boundary, so the transform processes only the live tail instead of the full session history. Dramatically reduces per-turn overhead on long sessions. Enable with `experimental.compaction_markers: true`.\n\n**User Memories** — historian extracts behavioral observations about you alongside its normal compartment output (communication style, expertise level, review focus, working patterns). Recurring observations are promoted by the dreamer to stable user memories that appear in all sessions via `\u003cuser-profile\u003e`. Enable with `experimental.user_memories.enabled: true` (requires dreamer).\n\n**Key File Pinning** — dreamer analyzes which files your agent reads most frequently across the session. Core orientation files (architecture, config, types) that get re-read after every context drop are pinned into the system prompt as `\u003ckey-files\u003e`, so the agent always has them without needing to re-read from disk. Files are read fresh on each cache-busting pass. Enable with `experimental.pin_key_files.enabled: true` (requires dreamer).\n\n---\n\n## Get Started\n\n### Quick Setup (Recommended)\n\nRun the interactive setup wizard — it detects your models, configures everything, and handles compatibility:\n\n**macOS / Linux:**\n```bash\ncurl -fsSL https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/scripts/install.sh | bash\n```\n\n**Windows (PowerShell):**\n```powershell\nirm https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/scripts/install.ps1 | iex\n```\n\n**Or run directly (any OS):**\n```bash\nbunx @cortexkit/opencode-magic-context@latest setup\n```\n\nThe wizard will:\n1. Check your OpenCode installation and available models\n2. Add the plugin and disable built-in compaction\n3. Help you pick models for historian, dreamer, and sidekick\n4. Handle oh-my-opencode compatibility if needed\n\n### Manual Setup\n\nAdd to your OpenCode config (`opencode.json` or `opencode.jsonc`):\n\n```jsonc\n{\n  \"plugin\": [\"@cortexkit/opencode-magic-context\"],\n  \"compaction\": {\n    \"auto\": false,\n    \"prune\": false\n  }\n}\n```\n\n\u003e **Why disable compaction?** Magic Context manages context itself — built-in compaction interferes with its cache-aware deferred operations and would cause duplicate compression.\n\nCreate `magic-context.jsonc` in your project root, `.opencode/`, or `~/.config/opencode/`:\n\n```jsonc\n{\n  \"$schema\": \"https://raw.githubusercontent.com/cortexkit/opencode-magic-context/master/assets/magic-context.schema.json\",\n  \"enabled\": true,\n\n  // Which model the historian uses for background compression, \n  // Prefer providers that charge by request instead of tokens\n  \"historian\": {\n    \"model\": \"github-copilot/gpt-5.4\",\n    \"fallback_models\": [\"opencode-go/glm-5\"]\n  }\n}\n```\n\n\u003e **Tip:** The `$schema` key enables autocomplete and validation in VS Code and other editors.\n\nThat's it. Everything else has sensible defaults. Project config merges on top of user-wide settings.\n\n### Oh-My-OpenCode / Oh-My-OpenAgent Users\n\nIf you use [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent) (formerly oh-my-opencode), disable the hooks that conflict with Magic Context in your `oh-my-openagent.json`:\n\n```json\n{\n  \"disabled_hooks\": [\n    \"context-window-monitor\",\n    \"preemptive-compaction\",\n    \"anthropic-context-window-limit-recovery\"\n  ]\n}\n```\n\nThe setup wizard handles this automatically if it detects an oh-my-openagent or oh-my-opencode config.\n\n### Doctor (Troubleshooting)\n\nAlready installed but something isn't working? Run the doctor to check and auto-fix configuration issues:\n\n```bash\nbunx @cortexkit/opencode-magic-context@latest doctor\n```\n\nDoctor checks for conflicts (compaction, DCP, OMO hooks), ensures the TUI sidebar is configured, verifies the plugin is registered, and checks the npm cache — fixing what it can automatically.\n\nUse `--force` to force-clear the plugin cache even when versions match (fixes broken transitive dependencies):\n\n```bash\nbunx @cortexkit/opencode-magic-context@latest doctor --force\n```\n\n---\n\n## What Your Agent Gets\n\nMagic Context injects structured context automatically and gives the agent five tools.\n\n### `ctx_reduce` — Shed weight\n\nAfter tool-heavy turns (large grep results, file reads, bash output), the agent calls `ctx_reduce` to mark stale content for removal. Drops are queued — not applied immediately — until the cache expires or context pressure forces it.\n\n```\nctx_reduce(drop=\"3-5,12\")     // Drop tags 3, 4, 5, and 12\n```\n\nRecent tags (last 20 by default) are protected. Drops targeting them stay queued until they age out.\n\n### `ctx_expand` — Decompress history\n\nWhen the agent needs to recall details from a compressed history range, it can expand specific compartment ranges back to the original conversation transcript.\n\n```\nctx_expand(start=100, end=200)   // Expand raw messages 100-200\n```\n\nReturns the same compact `U:`/`A:` transcript format the historian sees, capped at ~15K tokens per request. Use `start`/`end` from compartment attributes visible in `\u003csession-history\u003e`.\n\n### `ctx_note` — Deferred intentions\n\nSession notes are the agent's scratchpad for things to tackle later — not task tracking (that's what todos are for), but deferred work and reminders that should surface at the right time.\n\n```\nctx_note(action=\"write\", content=\"After this fix, check if the compressor budget formula is correct\")\nctx_note(action=\"read\")\n```\n\nNotes surface automatically at natural work boundaries: after commits, after historian runs, and after all todos complete.\n\n**Smart notes** are project-scoped notes with an open-ended `surface_condition` that the dreamer evaluates nightly. When the condition is met, the note surfaces in the next session:\n\n```\nctx_note(action=\"write\", content=\"Implement X because Y\", surface_condition=\"When PR #42 is merged in this repo\")\nctx_note(action=\"dismiss\", note_id=1)\n```\n\nSmart notes require dreamer enabled. Pending notes are invisible until the dreamer marks them ready. Use `dismiss` to clear a surfaced note.\n\n### `ctx_memory` — Persistent cross-session knowledge\n\nArchitecture decisions, naming conventions, user preferences — anything that should survive across conversations. Memories are project-scoped and automatically promoted from session facts by the historian.\n\n```\nctx_memory(action=\"write\", category=\"ARCHITECTURE_DECISIONS\", content=\"Event sourcing for orders.\")\nctx_memory(action=\"delete\", id=42)\n```\n\n### `ctx_search` — Unified search\n\nSearch across all data layers with a single query — project memories, session facts, and raw conversation history. Results are ranked by source (memories first, then facts, then message hits).\n\n```\nctx_search(query=\"authentication approach\")\n```\n\nMessage results include ordinal numbers the agent can pass to `ctx_expand` to retrieve the surrounding conversation context.\n\n### Automatic context injection\n\nEvery turn, Magic Context injects a `\u003csession-history\u003e` block containing:\n\n- **Project memories** — cross-session decisions, constraints, and preferences\n- **Compartments** — structured summaries replacing older raw history\n- **Session facts** — durable categorized facts from the current session\n\nThis block is stable between historian runs. Memory writes persist immediately for search but don't change the injected block until the next historian run — so writes never bust the cache mid-conversation.\n\n---\n\n## How It Works\n\n### Tagging\n\nEvery message, tool output, and file attachment gets a monotonically increasing `§N§` tag. The agent sees these inline and uses them to reference specific content when calling `ctx_reduce`. Tags persist in the database and resume across restarts.\n\n### Queued reductions\n\nWhen the agent calls `ctx_reduce`, drops go into a pending queue — not applied immediately. Two conditions trigger execution:\n\n- **Cache expired** — enough time has passed that the cached prefix is likely stale (configurable per model, default 5 minutes)\n- **Threshold reached** — context usage hits `execute_threshold_percentage` (default 65%)\n\nBetween triggers, the conversation continues unchanged. The agent doesn't need to think about timing.\n\n### Background historian\n\nWhen local drops aren't buying enough headroom, Magic Context starts a historian — a separate lightweight model that reads an eligible prefix of raw history and produces:\n\n- **Compartments** — chronological blocks that replace older raw messages\n- **Facts** — durable decisions, constraints, and preferences (categorized)\n\nThe historian runs asynchronously. The main agent never waits for it. When the historian finishes, its output is materialized on the next transform pass.\n\nA **separate compressor** pass fires when the rendered history block exceeds the configured history budget, merging the oldest compartments to keep the injected context lean.\n\n### Nudging\n\nAs context usage grows, Magic Context sends rolling reminders suggesting the agent reduce. Cadence tightens as usage approaches the threshold — from gentle reminders to urgent warnings. If the agent recently called `ctx_reduce`, reminders are suppressed. An emergency nudge at 80% always fires.\n\n### Cross-session memory\n\nAfter each historian run, qualifying facts are promoted to the persistent memory store. On every subsequent turn, active memories are injected in `\u003csession-history\u003e`. New sessions inherit all project memories from previous sessions.\n\nMemories are searchable via `ctx_search` alongside session facts and raw conversation history, using semantic embeddings (local by default) with full-text search as fallback.\n\n### Dreamer\n\nAn optional background agent that maintains memory quality overnight:\n\n- **Consolidate** — merge semantically similar memories into canonical facts\n- **Verify** — check memories against current codebase (configs, paths, code patterns)\n- **Archive stale** — retire memories referencing removed features or old paths\n- **Improve** — rewrite verbose memories into terse operational form\n- **Maintain docs** — update ARCHITECTURE.md and STRUCTURE.md from codebase changes\n- **Evaluate smart notes** — check pending smart note conditions and surface ready notes\n- **Review user memories** (experimental) — promote recurring user behavior observations to stable memories\n\nThe dreamer runs during a configurable schedule window and creates ephemeral OpenCode child sessions for each task. Since it runs during idle time (typically overnight), it works well with local models — even slower ones like `ollama/mlx-qwen3.5-27b-claude-4.6-opus-reasoning-distilled` are fine since there's no user waiting.\n\nWhen dreamer is enabled, ARCHITECTURE.md and STRUCTURE.md are automatically injected into the agent's system prompt (configurable via `inject_docs`). Content is cached per-session and refreshed on cache-busting passes.\n\n### User Memories (Experimental)\n\nWhen `experimental.user_memories.enabled` is set, historian extracts behavioral observations about the user alongside its normal compartment output — things like communication style, expertise level, review focus, and working patterns. These go into a candidate pool.\n\nDuring dreamer runs, a dedicated review pass checks candidates for recurring patterns across sessions. Observations that appear at least `promotion_threshold` times (default 3) are promoted to stable user memories and injected into all sessions via `\u003cuser-profile\u003e` in the system prompt.\n\nStable user memories are visible and manageable in the dashboard's User Memories page. Requires dreamer to be enabled for the promotion step.\n\n### TUI Sidebar\n\nWhen running in OpenCode's terminal UI, Magic Context shows a live sidebar panel with:\n\n- **Context breakdown bar** — visual token split across System Prompt, Compartments, Facts, Memories, and Conversation\n- **Historian status** — idle, running, or compartment/fact counts\n- **Memory counts** — total project memories and how many are injected\n- **Dreamer status** — last run time\n- **Queue status** — pending operations count\n\nThe sidebar updates after every message. Commands (`/ctx-status`, `/ctx-flush`, `/ctx-aug`) also work directly in TUI mode via dialogs and toasts.\n\nThe TUI plugin is configured automatically by the setup wizard and the `doctor` command. If you installed manually, add to your `tui.json` or `tui.jsonc`:\n\n```jsonc\n{\n  \"plugin\": [\"@cortexkit/opencode-magic-context\"]\n}\n```\n\n### Startup conflict detection\n\nOn startup, Magic Context checks for common configuration problems — OpenCode's built-in compaction being enabled, DCP plugin being active alongside Magic Context, or conflicting oh-my-openagent hooks. When conflicts are detected, it warns the active session with a fix suggestion pointing to `bunx @cortexkit/opencode-magic-context@latest doctor`.\n\n---\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `/ctx-status` | Debug view: tags, pending drops, cache TTL, nudge state, historian progress, compartment coverage, history compression budget |\n| `/ctx-flush` | Force all queued operations immediately, bypassing cache TTL |\n| `/ctx-recomp` | Rebuild compartments and facts from raw history — use when stored state seems wrong |\n| `/ctx-aug` | Run sidekick augmentation on a prompt — retrieves relevant memories via a separate model |\n| `/ctx-dream` | Run dreamer maintenance on demand — consolidate, verify, archive, improve memories |\n\n---\n\n## Magic Context App\n\nA companion desktop app for browsing and managing Magic Context state outside of OpenCode.\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://github.com/cortexkit/opencode-magic-context/releases/tag/dashboard-v0.2.4\"\u003e\u003cstrong\u003e⬇️ Download for macOS · Windows · Linux\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e\n\n**Features:**\n- **Memory Browser** — search, filter, and edit project memories with category and project filtering\n- **Session History** — browse compartments, facts, and notes for any session with timeline navigation\n- **Cache Diagnostics** — real-time cache hit/miss timeline, bust cause detection, per-session stats\n- **Dreamer Management** — view dream run history per project, trigger runs, inspect task results\n- **Configuration Editor** — form-based editing for all settings including model selection with fallback chains\n- **Log Viewer** — live-tailing log viewer with search\n- **System Tray** — quick access to dreamer status and controls\n\nThe app reads directly from Magic Context's SQLite database — no additional server or API required. Auto-updates are built in.\n\n---\n\n## Configuration\n\nAll settings live in `magic-context.jsonc` as flat top-level keys. See **[CONFIGURATION.md](./CONFIGURATION.md)** for the full reference — cache TTL tuning, per-model execute thresholds, historian model selection, embedding providers, memory settings, sidekick, and dreamer.\n\n**Config locations** (merged in order, project overrides user):\n1. `\u003cproject-root\u003e/magic-context.jsonc`\n2. `\u003cproject-root\u003e/.opencode/magic-context.jsonc`\n3. `~/.config/opencode/magic-context.jsonc`\n\n---\n\n## Storage\n\nAll durable states live in a local SQLite database. If the database can't be opened, Magic Context disables itself and notifies the user.\n\n```\n~/.local/share/opencode/storage/plugin/magic-context/context.db\n```\n\n| Table | Purpose |\n|-------|---------|\n| `tags` | Tag assignments — message ID, tag number, session, status |\n| `pending_ops` | Queued drop operations |\n| `source_contents` | Raw content snapshots for persisted reductions |\n| `compartments` | Historian-produced structured history blocks |\n| `session_facts` | Categorized durable facts from historian runs |\n| `notes` | Unified session notes and project-scoped smart notes |\n| `session_meta` | Per-session state — usage, nudge flags, anchors |\n| `memories` | Cross-session persistent memories |\n| `memory_embeddings` | Embedding vectors for semantic search |\n| `dream_state` | Dreamer lease locking and task progress |\n| `dream_queue` | Queued projects awaiting dream processing |\n| `dream_runs` | Per-project dream run history — task names, durations, memory changes |\n| `compression_depth` | Per-message compression depth for weighted compressor selection |\n| `message_history_fts` | FTS5 index of user/assistant message text for `ctx_search` |\n| `message_history_index` | Tracks last indexed ordinal per session for incremental FTS population |\n| `recomp_compartments` | Staging for `/ctx-recomp` partial progress |\n| `recomp_facts` | Staging for `/ctx-recomp` partial progress |\n| `user_memory_candidates` | User behavior observations from historian (experimental) |\n| `user_memories` | Promoted stable user memories injected into all sessions (experimental) |\n\n---\n\n## Star History\n\n\u003ca href=\"https://www.star-history.com/?repos=cortexkit%2Fopencode-magic-context\u0026type=date\u0026legend=bottom-right\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=cortexkit/opencode-magic-context\u0026type=date\u0026theme=dark\u0026legend=top-left\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=cortexkit/opencode-magic-context\u0026type=date\u0026legend=top-left\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=cortexkit/opencode-magic-context\u0026type=date\u0026legend=top-left\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n\n---\n\n## Development\n\n**Requirements:** [Bun](https://bun.sh) ≥ 1.0\n\n```sh\nbun install              # Install dependencies\nbun run build            # Build the plugin\nbun run typecheck        # Type-check without emitting\nbun test                 # Run tests\nbun run lint             # Lint (Biome)\nbun run lint:fix         # Lint with auto-fix\nbun run format           # Format (Biome)\n```\n\n**Utility scripts:**\n\n```sh\nbun packages/plugin/scripts/tail-view.ts             # Show post-compartment message tail\nbun packages/plugin/scripts/context-dump/index.ts     # Dump full context state for a session\nbun packages/plugin/scripts/backfill-embeddings.ts   # Backfill missing memory embeddings\n```\n\nDream execution requires a live OpenCode server — the dreamer creates ephemeral child sessions. Use `/ctx-dream` inside OpenCode for on-demand maintenance.\n\n---\n\n## Contributing\n\nBug reports and pull requests are welcome. For larger changes, open an issue first to discuss the approach.\n\nRun `bun run format` before submitting — CI rejects unformatted code.\n\n---\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcortexkit%2Fopencode-magic-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcortexkit%2Fopencode-magic-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcortexkit%2Fopencode-magic-context/lists"}