Skip to main content

🌉 Agent Context Bridge (ACB)

PyPI version License: MIT Python: 3.10+ CI

Universal, zero-dependency context & memory bridge for autonomous coding agents.
Seamlessly share project decisions, architectural constraints, and task progress between Hermes Agent, Claude Code, OpenCode, and Codex.

⏱️ The 10-second version: every AI coding tool starts blind — decisions made in one agent are lost to the next. ACB records them once (acb record) and replays them in each agent's native format (acb inject).

ACB demo: init → record → inject

50s, no audio: init → record → list → inject for Claude & Hermes. One store (.agent_bridge/) → every agent.


💡 The Problem: Multi-Agent Context Fragmentation

When switching between modern AI developer tools (e.g., Claude Code in terminal, Hermes swarm running in background, OpenCode in IDE):

  1. Each agent starts blind: Context learned by one agent in a prior turn is lost to the next.
  2. Token waste: Agents re-read entire repository trees to rediscover decisions already made.
  3. No persistent audit trail: Critical architectural choices disappear with session resets.

Agent Context Bridge solves this with a lightweight, file-backed offline store (.agent_bridge/) and dedicated adapter templates for each agent's native prompt hook format.


✨ Features

  • Zero Runtime Dependencies: Pure Python standard library (argparse, json, dataclasses, datetime). Fast and crash-resilient.
  • Offline & Local-First: No background daemon, no external database, no network calls. Works 100% offline.
  • Multi-Agent Adapters: Native formatters for Hermes Agent, Claude Code, OpenCode, and Codex.
  • Human-Readable & Machine-Parseable: Automatically maintains both records.jsonl (structured) and SHARED_CONTEXT.md (markdown view).
  • Fast CLI: Simple agent-bridge (acb) command for CI, shell hooks, or direct agent execution.

📦 Installation

pip install agent-context-bridge

Or install locally from source:

git clone https://github.com/shenn667/agent-context-bridge.git
cd agent-context-bridge
pip install -e .

🚀 Quickstart

1. Initialize a Workspace

acb init

Creates .agent_bridge/records.jsonl and .agent_bridge/SHARED_CONTEXT.md.

2. Record a Context Decision

acb record \
  --agent hermes-dev \
  --topic "Database Engine" \
  --summary "Adopted SQLite WAL mode for local agent state storage" \
  --details "PostgreSQL required Docker containers; SQLite provides zero-latency offline access." \
  --tag db --tag architecture

3. List Shared Context

acb list

4. Inject Context into an Agent Session

Output prompt-ready context tailored for your target agent:

# For Claude Code SessionStart hook:
acb inject --target claude

# For Hermes Agent system context:
acb inject --target hermes

# For OpenCode:
acb inject --target opencode

✅ Demo locale (3 commandes)

Reproductible depuis une clone fraîche — prouve install + record/inject + version cohérente :

pip install -e .
acb init --dir /tmp/acb-demo && acb record --dir /tmp/acb-demo --agent hermes-dev --topic "Demo" --summary "Bridge OK" && acb inject --dir /tmp/acb-demo --target hermes
acb --version

Attendu : agent-bridge 0.2.0 (identique à pyproject.toml, __init__.__version__ et au tag v0.2.0 — le workflow release.yml refuse la publication si tag ≠ version).


🪝 Hooks natifs (1 commande chacun)

Claude Code — SessionStart

acb hooks claude --print     # affiche le snippet .claude/settings.json
acb hooks claude --install   # écrit/fusionne <workspace>/.claude/settings.json (idempotent)
echo '{}' | acb hooks run --target claude   # teste le hook : exit 0 + contexte sur stdout

Le hook enregistré est acb inject --target claude : Claude Code l'exécute à chaque SessionStart (payload JSON sur stdin, ignoré) et le stdout est injecté en contexte de session.

Hermes Agent — inject

acb hooks hermes --print     # snippet de câblage (préambule de session)
acb inject --target hermes   # inject 1-commande, prêt pour le system context

🏗️ Architecture

                      ┌──────────────────────┐
                      │  Your Project Repo   │
                      └──────────┬───────────┘
                                 │
                     .agent_bridge/SHARED_CONTEXT.md
                     .agent_bridge/records.jsonl
                                 │
           ┌─────────────────────┼─────────────────────┐
           ▼                     ▼                     ▼
     ┌───────────┐         ┌───────────┐         ┌───────────┐
     │  Hermes   │         │Claude Code│         │ OpenCode  │
     │  Adapter  │         │  Adapter  │         │  Adapter  │
     └───────────┘         └───────────┘         └───────────┘

🧪 Running Tests

pytest -v

📄 License

This project is open-source under the MIT License.
Authored by shenn667 (lehdev@yandex.com).

Metadata

Release files for agent-context-bridge 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-context-bridge 0.3.0
File Size Uploaded Provenance Actions
agent_context_bridge-0.3.0.tar.gz 363.9 kB With provenance Details for agent_context_bridge-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-context-bridge 0.3.0
File Interpreter ABI Platform Actions
agent_context_bridge-0.3.0-py3-none-any.whl Python 3 none any Details for agent_context_bridge-0.3.0-py3-none-any.whl

Total release size: 389.8 kB

Release files / agent_context_bridge-0.3.0.tar.gz

Download URL agent_context_bridge-0.3.0.tar.gz
Size 363.9 kB
Tags Source
SHA-256 checksum
How to use checksums
254eb4796f9bfb376d8cc82945450a4798d35fba84c40bd0b7a24270ef5dc81b
BLAKE2b-256 checksum
How to use checksums
8eb2a1695f52627c9a39b2f8c4a6e2aaa56cb3594a033a9ea746d81874a875f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / agent_context_bridge-0.3.0-py3-none-any.whl

Download URL agent_context_bridge-0.3.0-py3-none-any.whl
Size 25.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa1249923b790ddea9f6c86bc874d125a32871989d678e1f89752db04191f86e
BLAKE2b-256 checksum
How to use checksums
f30816a9c9a380ac4963281afe56099161d8095a5d934c502bcf0bbc8b0eee62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for agent-context-bridge 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_context_bridge-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page