AgentIndex icon
AgentIndex
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Submit Tool
ToolsMCP ServersHOTCategoriesTrendingNewBest ListsCompareGuides
Home/
Memory & Context/
magic-context
magic-context logo

magic-context

Active·★ 2.4k·MIT·Updated 2026-10-22
★ Essential★ Trending

Magic Context is a plugin for coding agent harnesses, currently OpenCode, Pi and OMP. It replaces the host's built-in compaction with its own context management so the agent does not pause to compact and drop what it knew mid-task.

A background historian compresses older history into tiered summaries with importance scores and lifts durable decisions, constraints and conventions into project memory. Separate dreamer agents run later to verify memories against the codebase and remove duplicates or stale entries, and relevant memories are injected each turn. The agent can also search memories, past conversations and git history.

Setup is a wizard (`npx @cortexkit/magic-context@latest setup`) that detects installed harnesses, registers the plugin and turns off built-in compaction. A historian model must be configured; the README notes it can be a cheaper or local model than the main agent.

This write-up is based on the project's README and public repository data. We have not hand-tested the tool. Data as of 2026-10-18.

License
MIT
Latest release
dashboard-v0.20.4 · 2026-10-18
Last commit
2026-10-18
Contributors
43
Forks
140
Open issues and PRs
31
First published
2026-03-26
npm package
@cortexkit/magic-context 0.49.12 · 1,340 downloads last week

Source: GitHub, npm and PyPI public APIs.

#agent-framework#agent-memory#ai#ai-agents#ai-context#ai-memory#cache-aware#context-engineering
$ Install
$ npx @cortexkit/magic-context@latest setup
↗ Visit site★ GitHub
01

Features

01Background history compression that lifts durable knowledge into project memory
02Overnight dreamer agents verify, deduplicate and curate memories
03Automatic recall each turn plus search across memories, past conversations and git history
04Setup wizard that configures OpenCode, Pi or OMP and disables built-in compaction
02

Why choose it

+Removes compaction pauses, so long tasks keep their context instead of losing it mid-flow.
+Builds project memory from work you are already doing and recalls it automatically each turn.
+The historian can run on a cheaper or local model while the main agent stays on a top model.
03

Trade-offs

!Only supports OpenCode, Pi and OMP; it does not plug into Claude Code, Cursor or Codex.
!A historian model must be configured, otherwise history compression fails and the plugin shows a warning.
!It disables the host's built-in compaction, so the agent relies on Magic Context working correctly.
04

Maintenance check

ActiveChecked: 2026-10-22
Last commit
2026-10-22
Commits, last 90 days
100+
Releases, last 90 days
30
Latest release
dashboard-v0.20.11 (2026-10-22)
Open issues
35
Recent issues with at least one comment
27/30
Commits per week, last 12 weeks
Commits per week, last 12 weeks: 138, 221, 105, 117, 190, 189, 316, 703, 693, 643, 474, 172

Oldest week on the left; the latest four weeks are orange. Source: GitHub commit activity.

Status rule: archived on GitHub = Archived; last commit within 90 days = Active; 91 to 365 days = Slowing; older = Stale. All figures come from the GitHub API on the date shown.

Most discussed open issues

  • #332 On win11, entering the first character after starting opencode causes bun error. However, after restarting opencode 2 - 3 times it remains s11 comments · 2026-08-18
  • #646 [omp] Non-git project memories do not follow /move — dir identity has no re-home hook6 comments · 2026-10-09
  • #335 Memory promotion is single-episode: `seen_count` counts phrasing repeats, not corroboration — proposal for an episode table + optional tieri6 comments · 2026-08-18
  • #554 [Windows][OpenCode 2] MC 0.44.0 hangs opencode serve at boot: /health never answers, supervisor kill/restart loop5 comments · 2026-09-28
  • #360 Add little-coder support5 comments · 2026-08-23

Issue titles are quoted from GitHub. Open the link to check whether a problem still applies to the version you use.

05

Compatibility

OpenCode
Plugin
Verified via docs
Pi
Plugin
Verified via docs
OMP
Plugin
Verified via docs
06

Quick start

1
$ npx @cortexkit/magic-context@latest setup
07

Use cases

↳Keep one coding-agent session per project running for weeks
↳Avoid compaction pauses that drop context mid-task
↳Give an agent memory of past decisions and project conventions
08

Alternatives

⚡Top VS:
VSpensyve★97→VSorigin★86→VSctx-open★59→VSwidemem-ai★49→
pensyve logo
pensyve★ 97
Universal memory runtime for AI agents
VSCompare→
origin logo
origin★ 86
Local-first Rust daemon for AI work. Git-versioned memories, distilled wiki pages, sessions for Claude Code, Cursor, Codex, and any MCP client.
VSCompare→
ctx-open logo
ctx-open★ 59
CTX is the standard Cognitive Version Control System for AI. Structured working memory for AI agents. CTX preserves goals, tasks, evidence, decisions, conclusions, runbooks, and origins so agents can continue work instead of restarting from scratch.
VSCompare→
widemem-ai logo
widemem-ai★ 49
Next-gen AI memory layer with importance scoring, temporal decay, hierarchical memory, and YMYL prioritization
VSCompare→
TrueMemory logo
TrueMemory★ 381
A living memory system that ingests long-horizon data to infer insights, enabling more decisive action, all while running on a single SQLite file locally.
VSCompare→
swarmclaw logo
swarmclaw★ 696
Self-hosted multi-agent AI runtime with MCP server support. Build, orchestrate, and run autonomous agents with memory, skills, schedules, and 23+ LLM providers (Claude, GPT, Gemini, OpenRouter, Ollama).
VSCompare→
Ori-Mnemos logo
Ori-Mnemos★ 331
Local-first persistent agentic memory powered by Recursive Memory Harness (RMH). Open source must win.
VSCompare→
AgentRecall-MCP logo
AgentRecall-MCP★ 371
Persistent, correction-driven memory for AI agents. Cross-session, cross-platform (Claude Code, Codex, Gemini — any MCP client). Learns from mistakes, compresses context to save tokens, consolidates knowledge overnight. npm: agent-recall-mcp
VSCompare→
See all alternatives →

Comments

Log in to leave a comment

No comments yet. Be the first!

On this page
01Features02Why choose it03Trade-offs04Maintenance check05Compatibility06Quick start07Use cases08Alternatives
cortexkit /
magic-context
↗

Background context compression and project memory for OpenCode, Pi and OMP, so one coding session can run for weeks

2.4k140MIT
Last commit1d ago
StatusActive
CategoryMemory & Context
Contributors43
Latest releasedashboard-v0.20.4
Links
Documentation↗Discussion↗Issues↗Releases↗
Cloud Infrastructure
Ad

Deploy on DigitalOcean

Host your MCP servers, Docker containers, and AI agents with $200 free credit over 60 days.

Claim $200 Free Credit
© 2026 AgentIndex.app|Built by a 10-year iOS Developer.
Best by use caseAboutContactAdvertisePrivacy PolicyTerms of UseQYSGitHubBuy me a coffee ☕

Browse by Category

MCP ServersCode AssistantWorkflow AutomationRAG / Knowledge BaseMulti-AgentBrowser AutomationLLM InfraDev ToolingObservability

Not affiliated with Anthropic, OpenAI or Microsoft.