hub

hub is a command for Claude Code from jianzhichun/emerge. It costs 13 tokens per session (726 once invoked), scanned A, original, MIT.

A command for configuring and checking a Memory Hub, which is a Git-based place for synchronizing stored workflow knowledge between systems.

In plain words
What is it for?
Use it to set the remote repository, branch, author, and connectors to synchronize, then check sync status and follow the steps to start the sync agent.
Why use it?
It guides first-time setup and helps resolve synchronization conflicts instead of leaving remote settings and disagreements unclear.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python scripts/emerge_sync.py run.

Part of the emerge plugin — 15 skills, 10 commands, 3 agents, 24 hooks shipped together

Good fit Use it to set the remote repository, branch, author, and connectors to synchronize, then check sync status and follow the steps to start the sync agent.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/jianzhichun/emerge
agentmods
npx agentmods add commands/jianzhichun/emerge/hub

Made for: Claude Code.

Or install emerge, the plugin that ships this one along with the rest of its 15 skills, 10 commands, 3 agents, 24 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hub

README.md
[![agentmods](https://agentmods.dev/badge/commands/jianzhichun/emerge/hub/github.svg)](https://agentmods.dev/commands/jianzhichun/emerge/hub)
Your own site
<a href="https://agentmods.dev/commands/jianzhichun/emerge/hub"><img src="https://agentmods.dev/badge/commands/jianzhichun/emerge/hub/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hub

Your own site · 80×15
<a href="https://agentmods.dev/commands/jianzhichun/emerge/hub"><img src="https://agentmods.dev/badge/commands/jianzhichun/emerge/hub.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 726 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.00726
Opus 5 $0.00006 $0.00363
Sonnet 5 $0.00003 $0.00145
Haiku 4.5 $0.00001 $0.00073

Measured 9d ago against content hash 2197062575f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

hub scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/hub.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Manage the Memory Hub: first-time setup via natural language, or show sync status and resolve conflicts.

First-time setup (when not yet configured)

If icc_hub(action="list") shows configured: false, run the setup flow:

  1. Collect information from the user (ask one question at a time):

    • Remote URL — the git remote on their self-hosted server, e.g. user@quasar:repos/emerge-hub.git
    • Branch name — default emerge-hub (ask only if they want a custom name)
    • Author identity — Name <email>, used for git commits
    • Which connectors to sync — call icc_hub(action="list") to show what's available locally; ask the user to pick
  2. Initialize the hub:

    icc_hub(action="configure",
      remote="<url>",
      author="<name> <<email>>",
      selected_verticals=["<connector1>", ...],
      branch="emerge-hub")           # omit if using default
    
    • On success, the daemon saves config and initialises the git worktree.
    • Report the result (action: "created" / "cloned" / "already_exists").
  3. Start the sync agent — tell the user to run this once in a terminal (and keep it running):

    python scripts/emerge_sync.py run
    

    Tip: they can background it with nohup python scripts/emerge_sync.py run > ~/.emerge/sync.log 2>&1 &

  4. Verify — call icc_hub(action="status") and confirm configured: true, no pending conflicts.


Ongoing status and conflict resolution

  1. Check hub status — call icc_hub(action="status").

    • Report: remote, selected connectors, queue depth, pending_conflicts, awaiting_application.
  2. Pending conflicts — if pending_conflicts > 0: For each conflict in conflicts:

    • Show: connector, file, ours_ts_ms vs theirs_ts_ms, ours_success_rate if present.
    • Ask the operator which version to keep:
      • ours — keep local (no file change)
      • theirs — overwrite with remote version (applied on next sync cycle)
      • skip — leave file as-is, mark resolved
    • Call icc_hub(action="resolve", conflict_id="<id>", resolution="<choice>") for each conflict.
    • After all resolved: report awaiting_application count; sync agent applies on its next cycle, or the user can flush immediately: python scripts/emerge_sync.py sync.

Read the full file on GitHub · 62 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 62 lines · 13 tokens per session scan A 2197062575f7

Subscribe to this mod's changes

hub is a command published in the GitHub repository jianzhichun/emerge (107 stars, last pushed 4mo ago), licensed MIT. It adds 13 tokens to every session and 726 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.