MIT · open source zero core dependencies 190+ tests 7 layers · 4 hooks · MCP server
github.com/AnastasiyaW/mclaude
Dossier № 001 · Multi-session collaboration for Claude Code
mclaude
By AnastasiyaW · Pairs with claude-code-config
ENTRY READ TIME · 5 MIN
FILE · /locks · /handoffs · /memory · /messages · /identity · /index

Two Claude chats.
One project. Zero collisions.

mclaude is a small, file-based system that gives your Claude Code sessions a shared notebook, a shared lock box, a shared memory shelf and a shared address book — so two chats, two teammates or two laptops can work on the same project without stepping on each other. Plain markdown and JSON. No server, no database required.

FREE · MIT licensed
Python 3.9+ · stdlib only
Works offline · airgapped-ready
7
Coordination layers · locks, handoffs, memory, identity, messages, indexer, heartbeats
0
Required dependencies · standard library, file-based, grep-friendly
190+
Tests passing · core + hub + bridge + audio + indexer
30s
From pip install to a working parallel-session demo
Install · try · demo $ pip install mclaude && mclaude demo --no-pause # ~30 s · spins up two simulated sessions, writes a Mermaid diagram of everything that happened

Whose turn is it, what’s already done, and how do you ask without interrupting?

When you have two Claude chats on the same project — or two teammates running Claude Code, or yourself switching between laptops — you hit the same three questions. mclaude makes the answers readable files on disk that every session sees.

Without mclaude

Monday morning, two chats, one bug.

10:04 AM
You ask Claude to fix a race condition in auth/middleware.py.
10:07 AM
Your teammate, on their laptop, asks their Claude to do the same thing. Neither Claude knows about the other.
10:12 AM
Both PRs open. Both delete the same function. Your merge conflicts, their test fails, and nobody understands why.
10:30 AM
The decisions live in two separate chat histories nobody has permission to read.
With mclaude

Same morning. Same bug. No collision.

10:04 AM
Your Claude claims the slug fix-auth-race. A lock file appears in .claude/locks/.
10:07 AM
Teammate’s Claude sees the lock, reads the description: “ani is already on this since 10:04 — race condition in session write.”
10:12 AM
Your Claude finishes, releases the lock with a summary, writes a handoff.
10:14 AM
Teammate’s Claude reads the handoff and extends the fix with tests on a different file.

Each layer solves exactly one problem.

Use one layer, or all six. They don’t depend on each other — if you only want handoffs, handoffs work alone. Everything lives as markdown and JSON inside .claude/, so you can read it with any text editor.

Layer 01 01

Work locks

mclaude lock claim

Atomic file creation. Two sessions race for the same slug — the OS guarantees only one wins. A 30-second heartbeat proves the holder is alive; silent for 3 minutes and the lock becomes reclaimable.

claim mclaude lock claim --slug fix-auth-race \ --description "Race in session write"
Layer 02 02

Handoffs

mclaude handoff write

One file per session with a unique, collision-free name. Every handoff has Goal, Done, What did NOT work, Current state, Key decisions and Next step — so tomorrow’s session never repeats yesterday’s dead ends.

writes .claude/handoffs/
2026-04-09_14-32_373d_fix-auth-race.md
Layer 03 03

Memory graph

mclaude memory save · search

Decisions, gotchas and references stored as nested markdown — wings, rooms, drawers. Raw verbatim, never summarised. Old decisions are marked superseded_by, never deleted.

search mclaude memory search "JWT" → wings/project-myapp/rooms/auth-system/
decisions/2026-04-09_use-jwt.md
Layer 04 04

Identity registry

mclaude identity register

Map human-friendly names to Claude instances. Sessions stop being bare UUIDs and become ani, vasya, infra, design. Route notifications, attribute handoffs, read a real address book.

register mclaude identity register ani \ --owner "Anastasia" --roles infra ml
Layer 05 05

Messages · active mail

mclaude mail ask · reply

Live inter-session messaging. Questions, answers, broadcasts, acks — all append-only markdown with frontmatter. A UserPromptSubmit hook delivers new mail on every prompt. Same format works on hub + local.

ask mclaude mail ask vasya \ "What's the API schema for auth?"
Layer 06 06

Code indexer

mclaude index

AST-based scanner produces code-map.md (human-readable architecture) and llms.txt (agent-optimised index). New sessions skip the 15-minute “let me re-read the codebase” ritual.

scan mclaude index [index] 47 modules · 289 classes · 1,143 fns
Layer 07 07

Heartbeats

mclaude.heartbeat.beat()

Periodic liveness signal per session. Running sessions write a small JSON file with last_beat, current activity, and held locks. Other sessions see who is live versus stale. Same pattern as Kubernetes liveness probes, file-based instead of network-based.

pulse beat(project_root, "ani", "sess-1",   activity="running tests") [heartbeat] 2 live · 0 stale

A deterministic demo that prints a real sequence diagram.

Before you commit to reading seven layers of documentation, run mclaude demo. It spins up a temp directory, walks two simulated sessions — ani and vasya — through every coordination primitive, and writes a Mermaid sequence diagram of what happened.

Nothing is mocked. Every file on the right is a real file on disk after the run.

Runs17-step narration · real .claude/ files · Mermaid diagram
Takes~30 seconds · no API key · no network
Outputslocks · handoffs · memory · messages · diagram.md
— mclaude demo · parallel-session walkthrough
$ mclaude demo --no-pause # STEP 1/17 — ani claims lock [lock] claimed refactor-auth-middleware session: 665a44027f424db7 files: src/auth/middleware.py # STEP 4/17 — vasya collides, sees the lock [lock] already held by: ani · since 14:04 doing: race condition in session write # STEP 7/17 — vasya asks a question via mail [mail] question sent to ani thread: 2026-04-23_14-07_vasya_ani_q_write-or-read # STEP 9/17 — ani replies, saves a memory [memory] saved wings/project-myapp/ rooms/auth-system/decisions/ 2026-04-23_race-is-in-write-path.md # STEP 12/17 — handoff with worked_by attribution [handoff] written .claude/handoffs/ 2026-04-23_14-32_665a_refactor-auth.md # STEP 14/17 — lock released [lock] released refactor-auth-middleware # STEP 17/17 — rollup of older handoffs [rollup] rolled up 3 handoff(s) through 2026-04-23 diagram written to /tmp/mclaude-demo/diagram.md

Scales from one chat to a team.

You don’t need mclaude if you only ever run one Claude chat — but most people lose context between sessions anyway, so handoff alone is worth it. Add layers as your team grows.

01
Solo · one person · one machine

Never lose context between sessions.

Install mclaude. At the end of a long session, say “prepare handoff”. The next session reads it automatically via the SessionStart hook.

  • pip install mclaude
  • cp -r rules .claude/rules/
  • say: “prepare handoff”
02
Two chats · same machine

Race protection against yourself.

Open a second chat, tell it to “claim work on X”. If chat #1 is still on that slug, chat #2 sees the lock and asks you what to do.

  • locks · atomic, advisory
  • active mail · live Q/A
  • heartbeats · stale detection
03
Team · multi-person · multi-laptop

Your company’s shared brain.

Commit .claude/ to git. Every teammate registers a unique identity. Handoffs become team memory; the memory graph becomes living documentation.

  • git pull → claim → push
  • identity registry
  • optional hub · WebSocket relay

mclaude is the runtime.
claude-code-config is the rulebook.

mclaude coordinates who does what, when. claude-code-config codifies what good work looks like — 17 architectural principles, 5 ready-to-use safety hooks, skills, templates and side-by-side comparisons of alternative approaches. Parallel sessions especially benefit from its destructive-command guard, git-destructive guard and auto-backup hooks: mclaude coordinates access, claude-code-config protects the shared state.

10-second setup · paste into Claude Code

Drop it in. The agent reads everything.

Paste this line into a Claude Code chat and the agent walks the repository, picks the principles and hooks that fit your project, and sets them up for you. No plugin store, no config wizard.

https://github.com/AnastasiyaW/claude-code-config — look through everything here, pick what fits my project, and set it up
mclaude layer
claude-code-config complement
Handoffs
Verification Contract — handoffs carry checkable items the next session must verify.
Work locks
Principle 18 · GPU Lock Protocol — extended lock pattern for shared hardware.
Messages
Principle 19 · Inter-Agent Communication — formal mailbox theory.
Memory graph
KB-aware verification — verify code against project knowledge base.
All layers
Proof-Verify skill — plan → build → independent verify → fix loop.

17 architectural principles · ready for your agent to cite

Pick the one that matches your current failure mode.
01Harness Design 02Proof Loop 04Deterministic Orchestration 05Structured Reasoning 07Codified Context 09Supply Chain Defense 10Agent Security 11Documentation Integrity 15Red Lines 16Project Chronicles 18Multi-Session Coordination 19Inter-Agent Communication
§06 · Why it belongs at your company

Free infrastructure for teams that use Claude Code seriously.

Most AI-coding coordination products want to host your context, charge per seat, or lock you into their dashboard. mclaude and claude-code-config sit in your repo as plain files. No account. No server required. No subscription.

If your company already uses Claude Code, the coordination problem is already there — it’s just being paid as human tax. Teams fight merge conflicts, re-discover dead ends, duplicate investigations, and lose context every Friday. This gives that tax back as structured files in git.

Read the full README →
$
Free under MIT.

Use it, fork it, embed it in proprietary stacks. No per-seat pricing, no call for a quote.

Runs anywhere Python runs.

Python 3.9+ and a filesystem. CI runners, airgapped machines, emergency SSH — all supported.

Lives inside your git repo.

.claude/ is text. It diffs, reviews, and merges like any other code. Nothing to self-host unless you want to.

Graceful degradation.

Hub offline? Falls back to local files. Team doesn’t want messages? Use locks alone. Nothing hard-fails.

MCP server included.

20+ native tools (mclaude_lock_claim, mclaude_handoff_latest…) so Claude Code calls them directly — no Bash parsing.

Pair with claude-code-config for safety.

mclaude decides who does what. claude-code-config is the rulebook: 23 architectural principles, 14 safety hooks, 19 skills. Parallel sessions share a filesystem — they need guards that run whether the agent remembers the rule or not.

mclaude layer
+
claude-code-config
Layer 1 · Locks
+
destructive-command-guard
Layer 2 · Handoffs
+
git-auto-backup · git-destructive-guard
Layer 3 · Memory
+
proof-verify skill (KB conformance)
Layer 5 · Messages
+
secret-leak-guard (no secrets in mail)
All layers
+
session-drift-validator · 23 principles
— Start —

Install once. Never lose context again.

Start with pip install mclaude and the built-in demo. Add claude-code-config for principles and safety. Ship both to your team — same repo, zero infrastructure.

mclaude claude-code-config

MIT licensed · 190+ tests · zero core deps · contributions welcome