From grāmatr
Install or refresh the versioned grāmatr block in CLAUDE.md. Shows a diff and requires explicit user confirmation before writing.
How this command is triggered — by the user, by Claude, or both
Slash command
/gramatr:gramatr-updateFiles this command reads when invoked
The summary Claude sees in its command listing — used to decide when to auto-load this command
# /gramatr-update
You install or refresh the `<!-- gramatr-block: vN -->` section in CLAUDE.md.
The block is a persistent floor of grāmatr operational knowledge — versioned,
plugin-owned, and replaced only between its markers. Everything outside the
markers is user-owned and must be preserved byte-for-byte.
## Step 1 — Locate candidate files
Check both locations and note which exist:
- Project: `${CLAUDE_PROJECT_DIR:-$PWD}/CLAUDE.md`
- Global: `~/.claude/CLAUDE.md`
For each existing file, scan for the marker regex
`<!--\s*gramatr-block:\s*v(\d+)\b` to discover the installed version (if...You install or refresh the <!-- gramatr-block: vN --> section in CLAUDE.md.
The block is a persistent floor of grāmatr operational knowledge — versioned,
plugin-owned, and replaced only between its markers. Everything outside the
markers is user-owned and must be preserved byte-for-byte.
Check both locations and note which exist:
${CLAUDE_PROJECT_DIR:-$PWD}/CLAUDE.md~/.claude/CLAUDE.mdFor each existing file, scan for the marker regex
<!--\s*gramatr-block:\s*v(\d+)\b to discover the installed version (if any).
Use the Read tool — do not shell out to cat/grep.
Read the bundled v6 block from the plugin install. It ships at:
${CLAUDE_PLUGIN_ROOT}/blocks/gramatr-block-v6.md (when running inside the
Claude Code plugin), OR<repo-root>/packages/mcp/blocks/gramatr-block-v6.md (when developing
against the source tree).The file content begins with <!-- gramatr-block: v6 — managed by @gramatr/mcp plugin -->
and ends with <!-- /gramatr-block -->. Use it verbatim — do not paraphrase
or "improve" the content. The block was carefully drafted with a v2 → v3 → v4 → v5 → v6
changelog and is the single source of truth.
Never assume. The user owns these files.
For each target file, compute what would change:
<!-- gramatr-block: vN --> and <!-- /gramatr-block -->
markers: the diff replaces everything between (and including) those markers
with the bundled v6 block.Render the diff in unified format so the user can verify the change is contained between markers and nothing outside is touched.
Ask: "Apply this update? (yes / no)". Wait for a direct yes/no. Anything ambiguous — abort with a one-line explanation; do not proceed.
On confirmation, write each chosen file using the Write tool. Preserve every
byte outside the markers. After each write, confirm with one line:
Updated <path> → gramatr-block v6.
If the file did not exist, create it. If the markers were absent, append (blank line + block) to the end.
/gramatr-update if action is needed.packages/mcp/blocks/gramatr-block-vN.md) and the GRAMATR_BLOCK_VERSION
constant in packages/mcp/src/hooks/lib/gramatr-block.ts. They must stay
aligned — the detection logic and this command both read the same constant.npx claudepluginhub gramatr/claude-plugin --plugin gramatr-headless