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.5 $0.00038 $0.00422
Sonnet 5.5 $0.00019 $0.00211
Haiku 4.5 $0.00010 $0.00105

Measured 1mo ago against content hash 3288fa05d7f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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)
  • scope — project (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. 1mo 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 today), licensed MIT. It adds 95 tokens to every session and 1,055 once invoked, about $0.0004 per session on Opus 5.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

yantrikdb

Persistent cognitive memory via YantrikDB's MCP server. Semantic recall, remember, belief revision, knowledge graph, contradiction detection, and procedural learning that survive across sessions and agents. Tools are auto-discovered from the server at runtime.

yantrikos/yantrikdb-mcp · 52 tokens

persistent-memory

Give this agent durable memory across sessions using YantrikDB. Use at the start of every session to load prior context, whenever the user or a job references past decisions, people, preferences, or earlier runs, and whenever something worth keeping is learned (a decision, a fact, a working method, a qualified lead, a…

yantrikos/yantrikdb-mcp · 84 tokens

cortadel

Cortadel is a self-hosted, bi-temporal graph memory server for AI agents — one .NET container exposing a REST API and an MCP endpoint over FalkorDB or Memgraph, with intent-aware writes (store/invalidate/delete-entity/touch/resolve), LLM-verified dedup with a negation guard, and hybrid BM25+vector+RRF retrieval…

cortadel/cortadel · 178 tokens

forget

Retract or permanently erase a Cortadel memory. Use when the user says "forget that...", "X is no longer true", "that's outdated", "delete this memory", or "permanently remove ". Default path is a natural-language retraction that keeps history queryable; hard, unrecoverable deletion only happens on an explicit…

cortadel/cortadel · 77 tokens

history

Reconstruct what Cortadel memory said as of a past date, or trace a fact's supersession chain (what replaced or invalidated it, and when). Use when the user asks what they believed on a given date, wants to see superseded/historical versions of a fact, or asks how something changed over time. mem0 has no equivalent …

cortadel/cortadel · 81 tokens

recall

Search Cortadel memory deliberately — broader, filtered, or budgeted retrieval beyond what the automatic per-prompt recall gives. Use when the user asks to look something up in memory, search past context, or wants results scoped by project/tag/type — e.g. "search my memories for X", "what do we know about Y", "recall…

cortadel/cortadel · 77 tokens