memory-bridge-operation

Manage the Hermes ↔ repo memory sync system — bridge, quality gate, compaction, health checks, and cron

5 stars

Best use case

memory-bridge-operation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Manage the Hermes ↔ repo memory sync system — bridge, quality gate, compaction, health checks, and cron

Teams using memory-bridge-operation should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/memory-bridge-operation/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/coordination/memory-bridge-operation/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/memory-bridge-operation/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How memory-bridge-operation Compares

Feature / Agentmemory-bridge-operationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Manage the Hermes ↔ repo memory sync system — bridge, quality gate, compaction, health checks, and cron

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Memory Bridge Operation

Manage the Hermes ↔ repo memory sync system that propagates context across all machines.

## Architecture

Memory travels with the repository via git. Hermes memory (~/.hermes/memories/) is the source of truth on ace-linux-1. The bridge script reads it, writes into .Codex/memory/ in the workspace-hub repo, commits, and pushes. Every other machine (Windows licensed-win-1, new clones) gets updated context via git pull. Gateway must be running for cron jobs to fire.

## Script Inventory

| Script | Purpose |
|--------|---------|
| scripts/memory/bridge-hermes-Codex.sh --commit | Reads Hermes memory, injects into agents.md via BRIDGE markers, commits and pushes |
| scripts/memory/pre-bridge-quality.sh --fix | Quality gate (0-100 score) before bridge; auto-compacts if needed |
| scripts/memory/check-memory-drift.sh | Exits 1 if Hermes memory ahead of repo, 0 if in sync |
| scripts/memory/bootstrap-machine.sh | Creates ~/.Codex/AGENTS.md on new machine, OS-aware |
| scripts/upkeep/health-check.sh --save | 16-check report: gateway, cron, memory, disk, repo sync, Codex topics |

## Cron Jobs

- memory-bridge-daily: 04:00 daily (job 8c797470d7d3) — runs pre-bridge-quality.sh --fix which calls bridge internally
- Gateway must be active (systemctl is-active hermes-gateway.service) or cron jobs won't fire

## Memory Compaction

Hermes memory has hard limits: MEMORY.md = 2200 chars, USER.md = 1375 chars. When approaching 90%+, compact before bridging.

### Manual Compaction Steps

1. Check current sizes: `wc -c ~/.hermes/memories/MEMORY.md ~/.hermes/memories/USER.md`
2. Read current content: `cat ~/.hermes/memories/MEMORY.md`
3. Identify entries to remove: resolved issues > 90 days old, stale tool versions, duplicates with USER.md
4. Write compacted version to /tmp/compacted-memory.md (DO NOT use write_file on ~/.hermes/ paths — overlay issue)
5. Apply via terminal: `cp /tmp/compacted-memory.md ~/.hermes/memories/MEMORY.md`
6. Verify all critical facts preserved
7. Run bridge: `bash scripts/memory/pre-bridge-quality.sh --fix`

### Critical Facts That Must Always Be Preserved

- /mnt/local-analysis/workspace-hub is the real mount
- ~/workspace-hub is sparse overlay — write to /tmp/ then move
- uv run on Linux, python on Windows
- digitalmodel/ is separate git repo — cd in before commits
- .legal-deny-list.yaml mandatory for doc-intelligence work
- aceengineer-strategy/ GTM context
- Hermes: 691 skills, 5 external_dirs repos
- User preferences: context parity, adversarial review, overnight batch execution

## Gateway Stability (2026-04-05 findings)

The gateway DOES stay alive with zero messaging platforms — it logs "No messaging platforms enabled" then "Gateway will continue running for cron job execution" and starts the cron ticker. The real crashes are from:

1. **API credit exhaustion** — if a cron job (e.g. gemini-overnight-batch-1) hits a 402 OpenRouter error, the gateway exits. Check `~/.hermes/logs/gateway.log` for "Non-retryable client error: Error code: 402"
2. **Restart loop** — after crash, systemd restarts it. If it again finds no platforms AND no pending cron jobs, it may exit quickly (53ms). Restart with: `systemctl restart hermes-gateway.service`
3. **Replace flag** — if gateway won't start because old PID lingers: `hermes gateway run --replace`

### Cron without gateway (manual fallback)

If gateway won't stay up, fire due jobs manually:
```
hermes cron tick
```
This ticks once and exits — no persistent gateway needed.

## Troubleshooting

| Symptom | Fix |
|---------|-----|
| Gateway down | `systemctl start hermes-gateway.service`; if crashes again, check gateway.log for 402 errors |
| Bridge didn't commit (dirty submodule) | `git stash && cd /path/to/repo && bash scripts/memory/bridge-hermes-Codex.sh --commit && git push` |
| Memory at 98%+ | Compact manually (steps above), then pre-bridge-quality.sh --fix |
| Windows missing context | `bash scripts/memory/bootstrap-machine.sh && git pull` |
| Drift detected | `bash scripts/memory/bridge-hermes-Codex.sh --commit && git push` |
| Cron jobs not firing | Check gateway.log; if 402, pause offending job; if no platforms, gateway still works |

## Pitfalls

1. write_file/patch to ~/.hermes/ paths may hit overlay issues — use terminal to cp/mv
2. Bridge git pull --rebase fails with dirty submodules — script handles via stash/restore, but heavyequipemnt-rag may still cause issues
3. Gateway crashes — check `journalctl -u hermes-gateway --no-pager -n 30` and `~/.hermes/logs/gateway.log`
4. Existing compact-memory.py and curate-memory.py have bugs (wrong default paths) — use manual compaction instead
5. Cron output file may not exist after gateway restart
6. `hermes cron tick` works as manual fallback when gateway won't stay alive

Related Skills

git-operation-serialization-preflight

5
from vamseeachanta/workspace-hub

Before any commit, stash, merge, reset, rebase, or checkout in a multi-agent or shared-checkout environment, run a bounded preflight to detect active git writers and stale index/config locks, then serialize the mutating step under a single-writer guarantee.

memory-bridge-operations

5
from vamseeachanta/workspace-hub

Operate and recover the Hermes-to-repo memory bridge: drift checks, quality gate, bridge commits, push verification, and stash recovery when pre-bridge scripts fail after generating outputs.

hermes-memory-bridge

5
from vamseeachanta/workspace-hub

Architecture and scripts for syncing Hermes memory into git-tracked .claude/memory/ so all machines get context via git pull. Covers quality gate, drift detection, topic mirroring, and cron automation.

bridge-brokerage-market-data-apis

5
from vamseeachanta/workspace-hub

Handle ticker symbol mismatches between brokerage exports and market data APIs

gsd-operational-audit

5
from vamseeachanta/workspace-hub

Audit a repo's live GSD/get-shit-done workflow state against docs, issues, and runtime outputs to find stale issues, automation reliability gaps, parser drift, migration residue, and policy contradictions.

github-issue-lifecycle-operations

5
from vamseeachanta/workspace-hub

Class-level GitHub issue lifecycle operations: issue creation, planning/execution routing, labels, evidence fields, roadmap anchors, closeout races, and visual planning.

gmail-operations

5
from vamseeachanta/workspace-hub

Class-level Gmail and email operations: multi-account setup, OAuth, triage, extraction, archiving, attachments, unsubscribe, and touchbase workflows.

memory-bridge-commit-fallbacks

5
from vamseeachanta/workspace-hub

Fallback procedures when the Hermes ↔ Codex memory bridge writes .Codex/memory outputs but the internal git commit/push path fails because of dirty, stale, or broken submodule state.

agent-memory-bridge

5
from vamseeachanta/workspace-hub

Bidirectional sync between Hermes memory and Codex auto-memory, with licensed machine bootstrap. Use when context parity across agents is needed.

memory-management

5
from vamseeachanta/workspace-hub

Two-tier memory system for decoding workplace shorthand, acronyms, nicknames, and internal language.

agent-cli-delegation-operations

5
from vamseeachanta/workspace-hub

Class-level Codex/Codex/delegate_task agent operations: background execution, stdin/print stalls, plugin IDs, worker patch loops, and fallback routing.

provider-session-quota-operations

5
from vamseeachanta/workspace-hub

Class-level provider/session operations for Codex, Codex, Gemini, Hermes, quotas, audit exporters, readiness dispatch, and utilization scorecards.