push

push is a command for Claude Code from zhangfengcdt/memoir. It costs 40 tokens per session (1,221 once invoked), scanned A, original, Apache-2.0.

A command for pushing all local memoir branches, which are named lines of Git history, to Memoir Cloud. It can log in, link the repository, and handle branches that have conflicting changes.

In plain words
What is it for?
Use it to publish this repository's memoir branches, complete login when needed, and preserve conflicting or overwritten branch tips for later merging.
Why use it?
It avoids manually pushing each branch and records safer alternatives when the cloud branch has moved ahead, unless an overwrite is explicitly requested.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the memoir plugin — 2 skills, 8 commands, 4 hooks shipped together

Good fit Use it to publish this repository's memoir branches, complete login when needed, and preserve conflicting or overwritten branch tips for later merging.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add zhangfengcdt/memoir
Claude Code
/plugin install memoir

Made for: Claude Code.

Or install memoir, the plugin that ships this one along with the rest of its 2 skills, 8 commands, 4 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 push

README.md
[![agentmods](https://agentmods.dev/badge/commands/zhangfengcdt/memoir/push/github.svg)](https://agentmods.dev/commands/zhangfengcdt/memoir/push)
Your own site
<a href="https://agentmods.dev/commands/zhangfengcdt/memoir/push"><img src="https://agentmods.dev/badge/commands/zhangfengcdt/memoir/push/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 push

Your own site · 80×15
<a href="https://agentmods.dev/commands/zhangfengcdt/memoir/push"><img src="https://agentmods.dev/badge/commands/zhangfengcdt/memoir/push.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,221 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.00040 $0.01221
Opus 5.5 $0.00016 $0.00488
Sonnet 5.5 $0.00008 $0.00244
Haiku 4.5 $0.00004 $0.00122

Measured 12d ago against content hash c06bbdf43cf3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

push 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 12d 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.

plugins/claude-code/commands/push.md · 56 lines

How it starts

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

Push this repo's memoir branches to memoir cloud. Current state (JSON from the backing script):

!bash "${CLAUDE_PLUGIN_ROOT}/scripts/push-cmd.sh" plan 2>&1

Arguments passed by the user (may be empty): $ARGUMENTS. --force means: a branch the cloud has moved ahead of is overwritten (its cloud tip is kept locally under refs/memoir/backup/<branch> first). Without it, such a branch is pushed under another name to merge by hand.

Every call below is bash "${CLAUDE_PLUGIN_ROOT}/scripts/push-cmd.sh" <subcommand> …. Never run memoir yourself. Never print an API key.

Step 0 — Triage

  • Output starts with ERROR: or is not JSON: reply [mode=error] and the message. Stop.
  • branches is empty: reply [mode=nothing] — "No memoir branch to push." (mention skipped_merged if non-empty). Stop.

Step 1 — Log in if needed

If logged_in is false and remote is null, first ask with AskUserQuestion (header "Memoir cloud") how to proceed. This question is where the user's permission for an agent account is captured; never create one without it:

  • Create an agent account for this repo (Recommended) — "No login is needed. The cloud provisions a throwaway account that owns one store for this repo; the token stays with this repo's memoir store. The store is capped (5 branches, 2,000 memories per branch) and deleted after 30 idle days; memoir claim later moves it into your own account." On yes, run login-agent. On logged_in false in its answer, report its error and fall through to the browser login below. Otherwise report agent account <handle> owns <address> (capped at <limits.branches> branches, <limits.keys> memories per branch; deleted after <idle_days> idle days — memoir claim moves it to your account), treat the store as linked, and go to Step 3.
  • Sign in with my own account — the browser login below.

Browser login (also when logged_in is false but remote is set):

  1. Run login-start. If started is true, tell the user: "Open and enter to approve this machine", then run login-wait 240 (one Bash call; it returns as soon as the approval lands).
  2. If started is false, or login-wait reports logged_in: false: ask with AskUserQuestion (header "Memoir login") whether to paste an API key. On yes, ask for the key (they may paste it as the Other text), then run login-key with the key on stdin: printf '%s' '<key>' | bash … login-key. Never repeat the key back.
  3. Still not logged in: reply [mode=error] with "Not logged in to memoir cloud; run memoir login in a terminal." Stop.

Read the full file on GitHub · 56 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. 12d ago Changed · +5 lines c06bbdf43cf3
  2. 15d ago First seen · 51 lines · 40 tokens per session scan A 6c46a7778a3a

Subscribe to this mod's changes

push is a command published in the GitHub repository zhangfengcdt/memoir (625 stars, last pushed today), licensed Apache-2.0. It adds 40 tokens to every session and 1,221 once invoked, about $0.0002 per session on Opus 5.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-10-12.