Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/zhangfengcdt/memoir/syncgit clone --depth 1 https://github.com/zhangfengcdt/memoirWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00012 | $0.02016 |
| Opus 5 | $0.00006 | $0.01008 |
| Sonnet 5 | $0.00002 | $0.00403 |
| Haiku 4.5 | $0.00001 | $0.00202 |
Grade A, and why
sync 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Guide the user through promoting unmerged memoir branches into main. Current state (JSON from the backing script — unmerged is sorted most-recent-first):
!bash "${CLAUDE_PLUGIN_ROOT}/scripts/sync-cmd.sh" list 2>&1
Arguments passed by the user (may be empty): $ARGUMENTS
Step 0 — Triage the state above
- If the script output starts with
ERROR:(or is not JSON): reply[mode=error]plus the error/install hint on the next line. Stop. - If
$ARGUMENTSis non-empty: treat each whitespace-separated token as a branch name. Validate each against theunmergedlist — warn about and skip unknown names. Jump straight to Step 3 with the valid ones (no questions). Power-user fast path. - If
unmergedis empty: say "All memoir branches are merged into main." Add, when applicable: "N branch(es) are on your ignore list (delete a line in<store>/.git/plugin-ignored-branchesto unignore)" and, ifsnoozed_untilis a future epoch, when the session-start auto-offer resumes. Note that the currently-checked-out memoir branch is never listed. Then: ifstaleis also empty, reply[mode=clean]and stop; ifstaleis non-empty, ask one question (header "Stale branches"):Clean up <N> stale memoir branches→ Step 5, orNot now→[mode=clean]. - If
concurrent_warningis non-empty: print it as a one-line caution before any question (merging briefly moves the store's HEAD, which can collide with another live session).
Step 1 — Ask what to do (AskUserQuestion, single-select, header "Memoir sync")
Render the branch table in the question text, one line per branch: memoir/<branch> — <ahead> commits, last capture <age_days>d ago (if more than 6 branches, show the top 6 and "… (N more)"). If stale is non-empty, append one line: "Also: N stale branch(es) can be cleaned up (option 3)."
Multiple branches — options exactly:
Merge all (Recommended)— promote every listed branch into main → Step 3 with all branches.Choose branches→ Step 2.Ignore, snooze, or clean up→ Step 4.Not now— reply[mode=cancelled], mention/memoir:syncworks any time, change nothing. Stop.
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.
- 2d ago First seen · 98 lines · 12 tokens per session scan A d78a7a4a860f
sync is a command published in the GitHub repository zhangfengcdt/memoir (610 stars, last pushed 7d ago), licensed Apache-2.0. It adds 12 tokens to every session and 2,016 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.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
constitution
Create or update the project constitution from interactive or provided principle inputs.