save-context

save-context is a skill for Claude Code, Codex from hifriendbot/cogmemai-mcp. It costs 95 tokens per session (1,055 once invoked), scanned A, original, MIT.

A helper that saves the current conversation as persistent project memory in CogmemAi.

In plain words
What is it for?
It helps create checkpoints, preserve project state before risky work, and save selected facts or a larger group of memories.
Why use it?
It prevents important decisions and work context from being lost when a session ends, the conversation is shortened, or another agent takes over.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md.

Good fit It helps create checkpoints, preserve project state before risky work, and save selected facts or a larger group of memories.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hifriendbot/cogmemai-mcp/save-context
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 hifriendbot/cogmemai-mcp --skill save-context
Clone the repo
git clone --depth 1 https://github.com/hifriendbot/cogmemai-mcp

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/hifriendbot/cogmemai-mcp/save-context/github.svg)](https://agentmods.dev/skills/hifriendbot/cogmemai-mcp/save-context)
Your own site
<a href="https://agentmods.dev/skills/hifriendbot/cogmemai-mcp/save-context"><img src="https://agentmods.dev/badge/skills/hifriendbot/cogmemai-mcp/save-context/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for save-context

Your own site · 80×15
<a href="https://agentmods.dev/skills/hifriendbot/cogmemai-mcp/save-context"><img src="https://agentmods.dev/badge/skills/hifriendbot/cogmemai-mcp/save-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,055 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.00095 $0.01055
Opus 5 $0.00048 $0.00528
Sonnet 5 $0.00019 $0.00211
Haiku 4.5 $0.00010 $0.00105

Measured 9d ago against content hash 3288fa05d7f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

save-context 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 9d 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.

skill/save-context/SKILL.md · 102 lines

How it starts

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

Save Context with CogmemAi

This skill captures the live conversation state into CogmemAi so it survives context compaction, the end of the session, or a switch to a different agent.

When to Use

Trigger on any of these signals:

  • The user says "save context", "save this", "checkpoint", "write this down", "don't forget"
  • The context window is approaching its limit and important facts risk being evicted
  • About to run a destructive or expensive operation where losing the why would hurt
  • A long planning or design discussion just produced decisions worth keeping
  • Switching from one phase of work to another (e.g., planning to implementation)

How to Save Context

Pick the right tool for the volume of information:

Multi-fact context: extract_memories

When the conversation covers several distinct facts (decisions, preferences, constraints, file paths, bugs), call extract_memories once. It identifies and saves each fact with the right type, importance, and tags automatically.

Faster and more thorough than calling save_memory five times.

Single fact: save_memory

When there's one specific thing to capture, use save_memory with:

  • content — one or two sentences, concrete and self-contained
  • memory_type — pick from: architecture, decision, preference, bug, dependency, pattern, context, identity, session_summary, task, correction, reminder
  • importance — 1-10 (see the cogmemai-memory skill for the scoring guide)
  • scopeproject (default) or global if the fact applies everywhere
  • tags — short labels for grouping related memories

End-of-session wrap-up: save_session_summary

When wrapping up, call save_session_summary to capture what was accomplished, decisions made, and concrete next steps. The next session will see this immediately via get_project_context.

What to Save

Save:

  • Architecture and tech stack decisions ("auth uses Supabase", "DB is PostgreSQL 15")
  • User preferences ("never auto-commit", "always use Bun instead of npm")
  • File paths and project structure that took effort to discover
  • Bug fixes with non-obvious root causes
  • Patterns and conventions used in the codebase
  • Constraints from the user's environment, deadlines, or stakeholders

Read the full file on GitHub · 102 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. 9d ago First seen · 102 lines · 95 tokens per session scan A 3288fa05d7f7

Subscribe to this mod's changes

save-context is a skill published in the GitHub repository hifriendbot/cogmemai-mcp (7 stars, last pushed 8d ago), licensed MIT. It adds 95 tokens to every session and 1,055 once invoked, about $0.0005 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.

Related

Other skills, from other repositories

mem9-recall

Search shared memories from past sessions. Use when the user's question could benefit from historical context, past decisions, project knowledge, or team expertise.

unvulcanised-watercress762/mem9 · 33 tokens

mem9-store

Save important information to shared memory. Use when the user asks you to remember, note down, or save something for future sessions.

unvulcanised-watercress762/mem9 · 30 tokens

install-memex

Make Claude, Cursor, and OpenClaw remember every AI conversation forever — one local SQLite corpus shared across all of them. Installs memex (local-first MCP server) in 60 seconds via curl one-liner. Includes auto-capture daemon for Claude Code / Cowork / Cursor / Obsidian; v0.10 Telegram auto-detect (export from…

parallelclaw/memex-mvp · 194 tokens

mem9-setup

Setup Mem9 persistent memory. Triggers: set up mem9, install mem9, configure memory, enable memory.

unvulcanised-watercress762/mem9 · 29 tokens

mnemos-setup

Setup mnemos persistent memory with mnemo-server. Triggers: "set up mnemos", "install mnemo plugin", "configure memory plugin", "configure openclaw memory", "configure opencode memory", "configure claude code memory".

unvulcanised-watercress762/mem9 · 54 tokens

hypermnesic-memory

Use when Hermes needs durable project or personal memory through the local hypermnesic CLI: retrieve prior context, think through related notes, resolve entities, inspect writable folders, capture notes, or preview guarded writes.

leonardsellem/hypermnesic · 0 tokens