pin-memory

pin-memory is a command for coding agents from Synaptic-Labs-AI/PACT-Plugin. It costs 18 tokens per session (1,439 once invoked), scanned A, original, MIT.

A command for saving important project knowledge in CLAUDE.md, a project instruction file, or for reviewing the session to find knowledge worth saving. It limits how many items and how much text can be pinned.

In plain words
What is it for?
Use it to record non-obvious gotchas, architectural reasons, deployment commands, and codebase-specific patterns.
Why use it?
It keeps critical decisions, build commands, and unusual project rules available in future sessions without saving routine or temporary details.

Command

Part of the pact-plugin plugin — 21 skills, 13 commands, 13 agents, 11 hooks shipped together

Install

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.

agentmods
npx agentmods add commands/synaptic-labs-ai/pact-plugin/pin-memory
Clone the repo
git clone --depth 1 https://github.com/Synaptic-Labs-AI/PACT-Plugin

Or install pact-plugin, the plugin that ships this one along with the rest of its 21 skills, 13 commands, 13 agents, 11 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 pin-memory

README.md
[![agentmods](https://agentmods.dev/badge/commands/synaptic-labs-ai/pact-plugin/pin-memory.svg)](https://agentmods.dev/commands/synaptic-labs-ai/pact-plugin/pin-memory)
Your own site
<a href="https://agentmods.dev/commands/synaptic-labs-ai/pact-plugin/pin-memory"><img src="https://agentmods.dev/badge/commands/synaptic-labs-ai/pact-plugin/pin-memory.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 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,439 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00018 $0.01439
Opus 5 $0.00009 $0.00720
Sonnet 5 $0.00004 $0.00288
Haiku 4.5 $0.00002 $0.00144

Measured 3d ago against content hash b7d787a0a85c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pin-memory 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 3d 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.

pact-plugin/commands/pin-memory.md · 77 lines

How it starts

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

Mode

  • With arguments (/PACT:pin-memory <content>): Pin the specified content.
  • Without arguments (/PACT:pin-memory): Review the session for pin-worthy context and pin what matters.

Caps (enforced mechanically)

Cap violations are denied by hooks/pin_caps_gate.py when the Edit/Write tool call lands. You do NOT need to invoke a CLI check before adding — the hook is authoritative.

  • Count: 12 pins maximum.
  • Size: 1500 characters per pin body (excludes <!-- pinned: ... --> and <!-- STALE: ... --> auto-markers).
  • Override: verbatim load-bearing content MAY carry a pin-size-override rationale (≤ 120 chars, single line) — see Size Override. The hook validates the rationale in-band.

When to Pin

  • Critical gotchas that would waste hours if forgotten
  • Key architectural decisions that explain "why" (not "what")
  • Build/deploy commands needed every session
  • Non-obvious patterns unique to this codebase

When NOT to Pin

  • Routine session context (auto-memory and pact-memory handle this)
  • Things easily found in code or docs
  • Temporary information that will become stale

Process

Target file: The project CLAUDE.md may be at either $CLAUDE_PROJECT_DIR/.claude/CLAUDE.md (preferred) or $CLAUDE_PROJECT_DIR/CLAUDE.md (legacy). Use .claude/CLAUDE.md if it exists, otherwise ./CLAUDE.md. If neither exists, create at .claude/CLAUDE.md.

Adding a pin

  1. Read existing CLAUDE.md.
  2. Locate or create a ## Pinned Context section (place it before ## Working Memory).
  3. If the file carries a <!-- PACT_MEMORY_PINNED_END --> line, the new entry MUST go ABOVE that line. The pinned region ends there. A pin placed below it sits outside the region, so the count and size caps do not measure it and the hook cannot deny it — the pin is silently uncapped. Insert immediately before that line, after the last existing entry. If the file has no such line, append at the end of the section as usual.
  4. Add the new entry with a date tag. Make this write with the Edit tool. Do NOT use the Write tool. Step 1 gave you the full file, so a Write call looks like the short route to the new content. After a Write, a file that had CRLF line endings has LF line endings. The curator then sees a change to a file they did not edit. An Edit keeps the line endings of the file. Use the example below:
    <!-- pinned: YYYY-MM-DD -->
    ### Entry Title
    Content here (~5-10 lines max)
    
  5. Commit — then confirm CLAUDE.md is actually in the resulting commit. Where a project git-ignores CLAUDE.md (a bare CLAUDE.md line in .gitignore matches at any depth), the failure is loud in the obvious cases and silent in the one that matters. An explicit git add CLAUDE.md errors, and a commit whose only change is CLAUDE.md reports "nothing to commit" — both non-zero, both visible. But a blanket git commit -a / -am that also picks up other changed files succeeds, exits 0, and simply omits CLAUDE.md. Checking the commit's exit status instead of its contents is what turns that into a pin reported as durable while it has no git backing at all. So verify the file is in the commit, not that the commit succeeded. If it is not, report the pin as applied to the working file but not version-controlled, so the curator knows it lives only on this machine. NEVER use git add -f to force it past the ignore rule — the rule is the project's decision, not an obstacle.

Read the full file on GitHub · 77 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. 3d ago First seen · 77 lines · 18 tokens per session scan A b7d787a0a85c

Subscribe to this mod's changes

pin-memory is a command published in the GitHub repository Synaptic-Labs-AI/PACT-Plugin (71 stars, last pushed 3d ago), licensed MIT. It adds 18 tokens to every session and 1,439 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.