Noureddine RAMDI / egregore: persistent multi-agent collaboration with Claude Code hooks and git-based shared memory

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

egregore-labs/egregore

Egregore tackles a common pain point in AI agent workflows: maintaining persistent, organization-wide memory and identity across multiple sessions without relying on background processes or constant network calls. Instead, it uses Claude Code’s session hooks combined with a git-based shared memory system to synchronize state and coordinate multi-agent collaboration purely through shell scripts triggered on session events.

architecture and core components of egregore

At its core, egregore is a shared cognition layer designed to transform Claude Code into a persistent, organization-owned production environment. It’s built around three foundational primitives:

  • egregore.md: This identity document defines the egregore’s unique identity and metadata.
  • memory/: A git repository that serves as a shared, version-controlled knowledge base. All state changes are committed here, providing provenance and history.
  • slash commands: A coordination protocol implemented as slash commands that enable multi-agent workflows and context handoffs.

The system hooks into Claude Code’s lifecycle events such as SessionStart, PreToolUse, and PostToolUse via shell scripts located in the .claude/hooks/ directory. These hooks fire automatically during agent sessions to sync memory, resolve identities, and track activity.

What sets egregore apart is that it requires no daemons, no persistent background processes, and no network calls beyond git operations. Instead, all synchronization and coordination happen through git commits and shell commands. This makes the architecture remarkably lightweight and portable.

Although Claude Code is the runtime environment integrated out-of-the-box, egregore is agent-agnostic. Other agents can interact with the shared memory and coordination protocol via the bin/agent.sh CLI commands for synchronization, activity reporting, handoff, and queries.

Under the hood, the architecture relies heavily on git’s version control capabilities to provide a robust provenance trail. Every change to memory is tracked, enabling auditability and rollback. The slash command protocol encapsulates multi-agent interactions, ensuring session continuity and decision persistence across users.

technical strengths and tradeoffs

The most distinguishing feature of egregore is its novel blend of Claude Code hooks and git-based shared memory to create a persistent multi-agent collaboration framework without any persistent daemons or networked services. This design offers several advantages:

  • Minimal runtime footprint: Since it uses shell scripts and git, there are no additional servers or background processes to manage.
  • Provenance and auditability: Git commits provide a detailed history of all memory changes, enabling tracking and rollback.
  • Agent-agnostic protocol: Although Claude Code is the main runtime, other agents can integrate via CLI commands.
  • Seamless session handoffs: The slash command protocol supports handing off context between team members or agents smoothly.

The codebase is surprisingly clean for a shell-script-heavy project, with well-organized hooks and clear separation of concerns between identity management, memory syncing, and command handling.

However, there are tradeoffs to this approach:

  • Git dependency: The entire system depends on git both as a storage and coordination mechanism. This might limit scalability or real-time collaboration speed compared to dedicated databases or message brokers.
  • Limited to environments supporting shell and git: This restricts use in some constrained or Windows-only environments.
  • Primarily integrated with Claude Code: While other agents can interact, the deep integration is currently Claude Code-centric.

In production, this means egregore is best suited for teams comfortable with git workflows and looking for a lightweight, auditable, persistent collaboration layer for AI agents without adding infrastructure complexity.

quick start with egregore

The installation process is streamlined with an npx command that handles GitHub authentication, repository creation, cloning, and shell command setup:

npx create-egregore@latest --open

This interactive setup walks you through naming your egregore instance and setting up the shared memory repos locally.

To join an existing egregore instance, use:

npx create-egregore join <github-org>

You’ll need an invitation from the instance owner, which is managed via slash commands.

For organizations that block third-party GitHub Apps, there’s an alternative installation path using the GitHub CLI documented in INSTALL-GH.md and the official docs.

verdict

egregore offers a thoughtful and practical approach to persistent multi-agent collaboration by leveraging Claude Code’s lifecycle hooks combined with git as a shared state store. This provides a lightweight and auditable solution that avoids the complexity of daemons or networked services.

It’s a solid fit for teams building AI agent workflows who want persistent memory, identity resolution, and seamless multi-agent handoffs without adding heavy infrastructure. The git-centric design is both a strength and a limitation—excellent for teams fluent with git but potentially cumbersome for high-frequency or real-time collaboration scenarios.

The shell script and git-based approach may feel unconventional but is surprisingly effective and cleanly implemented. If you are invested in Claude Code or need an agent-agnostic coordination protocol with version-controlled provenance, egregore is worth exploring. Just be mindful of the environment and scalability considerations inherent in its design.


→ GitHub Repo: egregore-labs/egregore ⭐ 223 · Shell