Noureddine RAMDI / Meridian: tackling AI session context loss with smart lifecycle hooks and project scaffolding

Created Mon, 04 May 2026 10:13:55 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

markmdev/meridian

Meridian tackles a problem every developer using AI coding assistants knows too well: losing track of session context during long interactions. When your AI’s context window compacts or drifts, crucial project knowledge fades, making the assistant less effective. Meridian’s approach is to keep project context persistent and inject it smartly, behind the scenes, so you can keep coding with Claude Code as usual without losing coherence.

What Meridian does and how it works

Meridian is a plugin for Claude Code designed to maintain persistent project context across long-running AI coding sessions. It achieves this by establishing a dedicated workspace directory (.meridian/) inside your project, which holds key files like WORKSPACE.md, SOUL.md, config files, and documentation. This workspace acts as a central knowledge base that the plugin reads from and updates throughout your session.

Under the hood, Meridian splits its architecture into two halves. The first is the plugin-managed runtime installed through Claude Code’s plugin system, which provides lifecycle hooks, agents, commands, and Python helper scripts. The second half is the project scaffolding installed directly into your repo by an install script, which creates the .meridian/ folder with the workspace files.

This design means developers continue interacting with Claude Code normally—sending prompts and receiving completions—while Meridian intercepts and enhances the process. It injects context from the workspace, reinforces instructions, routes documents based on frontmatter hints, and performs quality checks at key lifecycle moments.

Key lifecycle hooks include:

  • Session start: Initializes context for a new session.
  • Prompt submit: Injects relevant context and instructions.
  • Pre-compact checkpoint: Captures transcript state and session learnings just before Claude’s context window compacts.
  • Session end: Performs cleanup and final updates.

The pre-compact checkpoint hook is Meridian’s standout technical feature. It solves a real-world problem where AI assistants lose crucial context when their internal message window compacts to stay within token limits. By snapshotting session data before compaction, Meridian preserves continuity and prevents knowledge loss.

Document routing is enhanced using frontmatter-based hints embedded in Markdown files. This allows Meridian to intelligently select which documents and snippets to feed into the context, avoiding noise and keeping focus tight.

Why Meridian’s approach stands out

The code is surprisingly clean for a project tackling such a complex problem. Splitting responsibilities clearly between the plugin runtime and project scaffolding reduces coupling and allows each half to evolve independently. The plugin half handles interaction with Claude Code’s environment and lifecycle, while the scaffolding focuses on project-specific knowledge management.

This non-invasive integration is a major DX win. Developers don’t have to learn a new interface or workflow—they use Claude Code as normal. Meridian works quietly in the background, managing context injection and quality assurance.

The tradeoff is the added complexity of maintaining two synchronized halves and the dependency on Claude Code’s plugin infrastructure. Projects must adopt the .meridian/ workspace structure and run the install script to scaffold the project side files.

Still, this approach is worth understanding because most AI coding tools overlook the session drift problem entirely. Meridian’s lifecycle hooks and persistent workspace offer a concrete solution that can be adapted or inspire similar designs.

Quick start with Meridian

To try Meridian, follow the exact steps outlined by the author:

/plugin marketplace add markmdev/claude-plugins
/plugin install meridian@markmdev

Then, inside your project repo, scaffold the project workspace files:

curl -fsSL https://raw.githubusercontent.com/markmdev/meridian/main/install.sh | bash

Finally, restart or reload Claude Code to pick up the new plugin and workspace.

This creates the .meridian/ directory in your project with files like WORKSPACE.md, SOUL.md, config.yaml, and subfolders for docs, prompts, scripts, and libraries. Meridian will then begin managing your session context and lifecycle hooks automatically.

Verdict: who Meridian is for and what to expect

Meridian is a solid tool for developers or teams using Claude Code for extended AI coding sessions who hit the wall of session context loss. If you need persistent project context, smarter document routing, and lifecycle hooks that capture session state pre-compaction, Meridian delivers a practical, well-engineered solution.

That said, it’s not a plug-and-play magic bullet. You must adopt the .meridian/ workspace pattern and work within Claude Code’s plugin ecosystem. This means some setup and discipline around project scaffolding.

The real strength is in its lifecycle hook approach—especially the pre-compact checkpoint—which addresses a gap in most AI assistant tooling. If you’ve struggled with AI assistants forgetting your project context or degrading in quality over long sessions, Meridian is worth exploring.

For those who value non-invasive integrations and want to keep using Claude Code as usual, Meridian’s architecture is a thoughtful balance of automation and developer control. It’s a practical step forward in making AI coding sessions more reliable and context-aware.


→ GitHub Repo: markmdev/meridian ⭐ 172 · Python