okfmem-save

okfmem-save is a skill for Claude Code from s-annam/okfmem. It costs 80 tokens per session (6,985 once invoked), scanned A, original, Apache-2.0.

A session close-out command for projects using the okfmem memory system. It records active work and lasting insights in Markdown, then synchronizes those records and can comment on a resolved GitHub issue.

In plain words
What is it for?
Use it at the end of a work session to update STATE.md, save durable project memories, clean up tool-created worktrees or branches, and commit and push the memory store.
Why use it?
It reduces the chance of losing important context between coding sessions. It also handles the final cleanup and synchronization steps described by the project workflow.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Good fit Use it at the end of a work session to update STATE.md, save durable project memories, clean up tool-created worktrees or branches, and commit and push the memory store.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/s-annam/okfmem/okfmem-save
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.

Any agent
npx skills add s-annam/okfmem --skill okfmem-save
Clone the repo
git clone --depth 1 https://github.com/s-annam/okfmem

Made for: Claude Code.

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 okfmem-save

README.md
[![agentmods](https://agentmods.dev/badge/skills/s-annam/okfmem/okfmem-save.svg)](https://agentmods.dev/skills/s-annam/okfmem/okfmem-save)
Your own site
<a href="https://agentmods.dev/skills/s-annam/okfmem/okfmem-save"><img src="https://agentmods.dev/badge/skills/s-annam/okfmem/okfmem-save.svg" alt="Measured on agentmods" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,985 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.00080 $0.06985
Opus 5 $0.00040 $0.03492
Sonnet 5 $0.00016 $0.01397
Haiku 4.5 $0.00008 $0.00698

Measured 8d ago against content hash 6bfece7c3143, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

okfmem-save 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 8d 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.

skills/okfmem-save/SKILL.md · 348 lines

How it starts

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

/okfmem-save — Write active state + capture insights + commit & push okfmem-store

Names. Canonical /okfmem-save; /primer is a back-compat alias (a symlink at ~/tools/skills/primer → this skill). Both invoke the same process. This skill and the memory engine live in the okfmem repo (~/okfmem/skills/); okfmem init symlinks it into each harness.

/okfmem-save closes out a work session in one move: overwrite the project's bounded active state (STATE.md), capture durable insights as per-project markdown memory pages, optionally post an impl-complete comment on the resolved GitHub issue, and commit + push ~/okfmem-store synchronously at the end.

Everything is plain markdown under ~/okfmem-store — no MCP, no daemon. Active state and durable insights are files the native memory system auto-loads next session (STATE.md, MEMORY.md, and the <topic>.md pages). This skill writes them directly, in-session, on whatever model the session is on, then runs the final git commit/push via the shared okfmem sync helper.

Two-layer architecture (for context)

Everything lives under ~/.claude/projects/<proj-dir>/memory/ (symlinked to ~/okfmem-store/projects/<name>/):

  • Active state lives in STATE.md — a bounded, single-session snapshot with a fixed 6-section shape (Summary / Left off / Next steps / Decisions / Blockers / Goal) plus OKF type: state frontmatter. It is overwritten every session, never appended. The native memory system auto-loads it next session.
  • Durable knowledge lives in per-topic <topic>.md pages (OKF v0.1: markdown + YAML frontmatter with a top-level type: field ∈ user | feedback | project | reference), indexed by one-line pointers in a MEMORY*.md index — the matching lane index by default, the root MEMORY.md only for cross-lane or type: feedback pages (#53; see Step 3). This is the durable write path: create or update the page, then add/refresh its pointer in that index.
  • STATE.md uses a separate type: state (see Step 5) — a different file with a different consumer (active-state snapshot, not the durable-page index), not a fifth value in the type: enum above.

Read the full file on GitHub · 348 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. 8d ago First seen · 348 lines · 80 tokens per session scan A 6bfece7c3143

Subscribe to this mod's changes

okfmem-save is a skill published in the GitHub repository s-annam/okfmem (5 stars, last pushed 25d ago), licensed Apache-2.0. It adds 80 tokens to every session and 6,985 once invoked, about $0.0004 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-31.