agarzon/claude-plugins/tree/master/plugins/agarzon
この mod について
claude-plugins
Alexander Garzon 個人の Claude Code プラグイン marketplace です。公開 GitHub リポジトリであり、CC marketplace も兼ねています。Claude Code のネイティブな autoUpdate を使い、カスタムスキル、フック、テーマ、出力スタイル(後にはコマンド/エージェント/MCP も)をすべてのマシンへ配布します。
インストール
claude plugin marketplace add agarzon/claude-plugins
claude plugin install agarzon@agarzon-plugins
~/.claude/plugins/known_marketplaces.json の agarzon-plugins エントリに autoUpdate: true を設定すると、次のセッションで新しいスキルを取得します。
スキル、フック、mod、テーマ、出力スタイルを追加する
plugins/agarzon/skills/<name>/SKILL.md(またはoutput-styles/<name>.md)を置くか、hooks/hooks.jsonを編集するか、hooks/register.tsxの mod を編集します。mod はclaude plugin validate plugins/agarzonとclaude plugin test plugins/agarzonで確認します。plugins/agarzon/.claude-plugin/plugin.jsonのversionを上げます。- コミットして push します。
autoUpdateが有効なマシンは次のセッションで取得します。
ステップ 2 は省略できません。バージョンを上げなければ何も伝播しません。
内容
handoff/wrap(スキル)—保留中の作業をHANDOFF.mdに保存して新しいセッションで続ける、または一日を閉じるためのものです。以下を参照してください。- セッション mod(
hooks/register.tsx)—プロンプトキャッシュのカウントダウンと警告、出力スタイル切り替え、コンテキスト充填の促し、引き継ぎの自動化、読み込まれたスキル一覧を提供します。以下を参照してください。 - claude-mem 同期(フック+スクリプト)—claude-mem のメモリをマシン間で同期します。以下を参照してください。
ELI5(出力スタイル)—簡単な言葉と短い回答で、疲れた頭向けです。agarzon:ELI5として選べます。プラグインのスタイルはplugin:style名前空間で、裸のELI5は何にも解決されません。/configパネルで選ぶか、settings.jsonに"outputStyle": "agarzon:ELI5"と設定します。インラインの/config outputStyle=補完が提供するのは 5 つの組み込みスタイルだけなので、このスタイルはそこには表示されません。output-styles/のファイルは規約で拾われ、plugin.jsonのキーは不要です。
handoff と wrap
リポジトリルートにあり、.git/info/exclude によって git の外に置かれる HANDOFF.md は、セッション間で作業を運ぶ TODO リストです。保留中の作業だけを保持し、完了した項目を削除し、空になったらファイルを削除します。
/handoffはファイルを書き込むかマージし、mod のhandoff_readyツールを呼びます。ターンが終わると mod は/rename <name>、/clear、/rename <name>-2>を実行し、次のセッションに “Read HANDOFF.md and continue” を送ります。Claude Code は/clearをまたいでセッション名を保持するので、2 回目の rename によって履歴上の 2 つのセッションを区別できます。/wrapは同じファイルを処理し、日末の作業(コミット、削除対象の成果物、メモリと vault の更新を 1 バッチで承認)も行い、セッション名を変更して停止します。HANDOFF.mdを見つけた新しいセッションは、プロンプトの上に Load/Dismiss を表示します。
セッション mod
mod はプラグインフックモジュールです。hooks/hooks.json が、従来のコマンドフックと並ぶ modules の下に列挙します。プロンプトの上に次の行を描画します。
⧗ cache 42m │ [ Concise ] │ ctx 62% → /handoff
loaded: ponytail·hook 1.3k superpowers·hook 3.3k plugin-authoring 4.9k ×2
- キャッシュのカウントダウン。 プロンプトキャッシュの寿命は 1 h(トランスクリプトには
ephemeral_1hの書き込みだけが表示されます)。API 呼び出しを行ったメインループのターンが完了すると時計が再開し、サブエージェントのターンとローカルコマンドは数えません。残り 10 min でトーストとサウンド(WSL はpowershell.exe、macOS はafplay)を出します。0 を過ぎると、次のメッセージでコンテキスト全体を入力価格 2x で再キャッシュします。 - 出力スタイル。 ボタンは
/configのoutputStyle行を巡回します。組み込みスタイルだけなので、agarzon:ELI5はローテーションに入りません。 - コンテキストの促し。 充填率が 60 % になると、トーストと
ctxマーカーで/handoffを提案します。 - 読み込み済み一覧。 現在のコンテキストにあるすべてのスキル本文とフック注入ブロックを、トランスクリプトから読み取って表示するため
--resume後も残ります。スキルはシアン、フックはマゼンタ、本文が 2 回以上ある場合は 赤い ×N です。再起動や--resumeで起こります。Claude Code の「読み込み済み」重複排除はプロセスメモリ内にあるため、再起動時の呼び出しでは本文全体が再注入され、入力した/skillも毎回再注入します。コピーを除くのは/compactまたは新しいセッションだけです。
mod API は早期アクセスで、リリース間で変わります。claude plugin validate は実行中のビルドが拒否する内容を報告します。
スキルの frontmatter にある allowed-tools はコマンド専用キーです。SKILL.md に追加すると、Execute skill: <name> と表示されて読み込みに失敗します。
claude-mem 同期
claude-mem はマシンごとのローカル SQLite データベースにメモリを保存するため、各マシンが自分の履歴を蓄積し、互いの履歴を見ることはありません。このフックはサーバーなしでその差を埋めます。
| ファイル | 役割 |
|---|---|
| hooks/hooks.json | SessionStart → peer を import · Stop → 自分の新しい行を publish |
| scripts/mem-sync.sh | フックの入口:export | import |
| scripts/mem-export.sh | DB → /api/import ペイロード。増分は --since <epoch> |
| scripts/mem-import.sh | 分割・順序付き・再開可能な import。--dry-run は送信せず FK を確認 |
再開したセッションは content_session_id を保ちますが、新しい memory_session_id を取得します。一方 sdk_sessions は content_session_id に対して一意なので、すでに保持しているセッションの peer 版は重複として破棄され、その要約は外部キーに失敗して peer の import を永久に詰まらせます。mem-import.sh は投稿前に受信したセッション id をローカルのものへ書き換えます。各側は受信時に再リンクするため、2 台のマシンでラベルの認識が違っても問題ありません。--dry-run では検出できません。FK チェックがペイロード内だけだからです。
データは JSON として Syncthing 経由で ~/General/claude-mem-sync/<device>.json に転送されます。git は決して使いません。このリポジトリは公開です。CLAUDE_MEM_SYNC_DIR で別の場所を指定できます。
ファイルごとに 1 writer なのが安全性の条件です。各マシンは自分の <device>.json だけを書き込むため同じファイルを 2 台が触ることはなく、.sync-conflict-* も発生しません。デバイス名は CLAUDE_MEM_CLOUD_SYNC_DEVICE_NAME、なければ claude-mem の設定、さらに無ければ hostname -s から取得します。
Export は claude-mem の read API ではなく SQLite を直接読みます。read API は約 200 行で上限に達し、セッション id を書き換えるため、その出力を再 import すると外部キーに失敗します。Import は worker の POST /api/import を通るため、重複排除、トランザクション、FTS トリガーはベンダー側の責任です。
同期はセッションをブロックしません。すべてのパスは 0 で終了し、問題は ~/.claude-mem/logs/mem-sync.log に送られます。
許容される上限。 追記のみで、削除とタイトル/プロジェクト編集は伝播しません。2 台で同じ作業をしても 2 件残ります。セッション id を重複排除キーに使い、マシンごとに異なるためです。1 セッションにつき import 後に残る要約は 1 件だけです。埋め込みは同期せず、Chroma はマシンごとにローカルです。
一度だけ行う統合
離れていったマシンに初期状態を配るには、フックを迂回してスナップショットを手動でマージします。
mem-export.sh --db <snapshot>.db --out peer.json
mem-import.sh peer.json --dry-run # expect 0 orphans
mem-import.sh peer.json
sqlite3 <db> ".backup <out>" でスナップショットを取得します。データベースは WAL モードで writer が動作中なので、cp では壊れた状態を取得する可能性があります。
次に各マシンでウォーターマークを seedし、最初の Stop フックが共有済みの履歴を再送せず、新しい作業だけを公開するようにします。
date +%s000 > ~/.claude-mem/mem-sync.watermark
これを省くと、最初の export はマシンが持つすべての行を公開します。正しい動作ですが、最初の同期が不必要に大きくなり、各 peer がそれを再 import してスキップします。
完全な設計と理由は docs/design.md を参照してください。
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add agarzon/claude-plugins claude plugin install agarzon
原文 / README
claude-plugins
Alexander Garzon's personal Claude Code
plugin marketplace. A public GitHub repo that doubles as a CC marketplace,
distributing custom skills, hooks, themes and output styles (and later
commands/agents/MCP)
across all machines via Claude Code's native autoUpdate.
Install
claude plugin marketplace add agarzon/claude-plugins
claude plugin install agarzon@agarzon-plugins
Set autoUpdate: true for the agarzon-plugins entry in
~/.claude/plugins/known_marketplaces.json so machines pull new skills on the
next session.
Add a skill, hook, mod, theme, or output style
- Drop
plugins/agarzon/skills/<name>/SKILL.md(oroutput-styles/<name>.md, or edithooks/hooks.json, or the mod inhooks/register.tsx; check a mod withclaude plugin validate plugins/agarzonandclaude plugin test plugins/agarzon). - Bump
versioninplugins/agarzon/.claude-plugin/plugin.json. - Commit and push. Machines with
autoUpdatepull it on the next session.
Step 2 is not optional — without a version bump nothing propagates.
Contents
handoff/wrap(skills) — save pending work toHANDOFF.mdand continue in a fresh session, or close the day. See below.- Session mod (
hooks/register.tsx) — prompt-cache countdown and warning, output-style switcher, context-fill nudge, handoff automation, and the list of loaded skills. See below. - claude-mem sync (hooks + scripts) — keeps claude-mem memory in step across machines. See below.
ELI5(output style) — small words, short answers, for a fried brain. Selectable asagarzon:ELI5— plugin styles are namespacedplugin:style, and bareELI5resolves to nothing. Pick it in the/configpanel, or set"outputStyle": "agarzon:ELI5"insettings.json. Note that the inline/config outputStyle=completion only offers the five built-ins, so this style never appears there. Files inoutput-styles/are picked up by convention; noplugin.jsonkey needed.
handoff and wrap
HANDOFF.md, at the repo root and kept out of git through .git/info/exclude, is the
to-do list that carries work between sessions. It holds only pending work: each item is
removed when done and the file is deleted when empty.
/handoffwrites or merges the file, then calls the mod'shandoff_readytool. When the turn ends the mod runs/rename <name>,/clear,/rename <name>-2, and sends the next session "Read HANDOFF.md and continue". Claude Code carries a session's name across/clear, so the second rename keeps the two sessions apart in history./wrapdoes the same file plus the end-of-day chores (commits, artifacts to delete, memory and vault updates, approved in one batch), renames the session and stops.- A new session that finds a
HANDOFF.mdoffers Load / Dismiss above the prompt.
Session mod
A mod is a plugin hooks module: hooks/hooks.json lists it under modules, next to the
classic command hooks. The row it draws above the prompt:
⧗ cache 42m │ [ Concise ] │ ctx 62% → /handoff
loaded: ponytail·hook 1.3k superpowers·hook 3.3k plugin-authoring 4.9k ×2
- Cache countdown. The prompt cache lives 1 h (transcripts show only
ephemeral_1hwrites). The clock restarts when a main-loop turn that made an API call completes; subagent turns and local commands do not count. At 10 min left: a toast and a sound (powershell.exeon WSL,afplayon macOS). Past zero the next message re-caches the whole context at 2x input price. - Output style. The button cycles the
/configoutputStylerow. It offers only the built-in styles, soagarzon:ELI5is not in the rotation. - Context nudge. At 60 % fill, a toast and the
ctxmarker suggest/handoff. - Loaded list. Every skill body and every hook-injected block in context now, read
from the transcript so it survives
--resume. Skills cyan, hooks magenta, red ×N when a body is in context more than once. That happens across a restart or--resume: Claude Code's "already loaded" dedupe lives in process memory, so a re-invocation injects the whole body again, and a typed/skillre-injects every time. Only/compactor a fresh session removes the copies.
The mod API is early access and changes between releases; claude plugin validate
reports anything the running build would refuse.
allowed-tools in a skill's frontmatter is a command-only key; adding it to a
SKILL.md makes the skill fail to load with Execute skill: <name>.
claude-mem sync
claude-mem stores its memory in a local SQLite database per machine, so each machine accumulates its own history and none of them ever see each other's. These hooks close that gap without a server.
| File | Role |
|---|---|
| hooks/hooks.json | SessionStart → import peers · Stop → publish own new rows |
| scripts/mem-sync.sh | the hook entry point: export | import |
| scripts/mem-export.sh | DB → /api/import payload. --since <epoch> for incremental |
| scripts/mem-import.sh | chunked, ordered, resumable import. --dry-run does an FK check without sending |
A resumed session keeps its content_session_id but gets a new
memory_session_id, while sdk_sessions is unique on content_session_id — so a
peer's version of a session you already hold is dropped as a duplicate and its
summaries then fail the foreign key, jamming that peer's import permanently.
mem-import.sh rewrites incoming session ids to the local ones before posting.
Each side relinks on the way in, so the two machines disagreeing about the label
is harmless. --dry-run cannot catch this: its FK check is payload-internal.
Data travels as JSON in ~/General/claude-mem-sync/<device>.json over
Syncthing — never git, this repo is public. Set
CLAUDE_MEM_SYNC_DIR to point elsewhere.
One writer per file is what makes this safe: a machine only ever writes its
own <device>.json, so no two machines touch the same file and
.sync-conflict-* cannot happen. Device name comes from
CLAUDE_MEM_CLOUD_SYNC_DEVICE_NAME, else claude-mem's settings, else hostname -s.
Export reads SQLite directly rather than claude-mem's read API, which caps out
near 200 rows and rewrites session ids such that its own output fails the
foreign key on re-import. Import goes through the worker's POST /api/import
so dedupe, transactions and FTS triggers stay the vendor's problem.
Sync never blocks a session: every path exits 0 and problems go to
~/.claude-mem/logs/mem-sync.log.
Accepted ceilings. Append-only — deletions and title/project edits do not propagate. Identical work done on two machines survives twice, because dedupe keys on session id and those differ per machine. Only one summary per session survives an import. Embeddings never sync; Chroma is local per machine.
One-time consolidation
To seed machines that have been drifting apart, bypass the hooks and merge snapshots by hand:
mem-export.sh --db <snapshot>.db --out peer.json
mem-import.sh peer.json --dry-run # expect 0 orphans
mem-import.sh peer.json
Take snapshots with sqlite3 <db> ".backup <out>" — the database is WAL-mode
with a live writer, so cp can capture a torn state.
Then seed the watermark on each machine so the first Stop hook publishes
only new work instead of re-shipping the history the machines already share:
date +%s000 > ~/.claude-mem/mem-sync.watermark
Skip this and the first export publishes every row the machine holds — correct, but a needlessly large first sync that every peer then re-imports and skips.
See docs/design.md for the full design and rationale.

