save-session-learnings

save-session-learnings is a command for coding agents from CloudAI-X/claude-workflow-v2. It costs 28 tokens per session (841 once invoked), scanned A, original, MIT.

A documentation workflow for recording important discoveries from a coding session in CLAUDE.md and AGENTS.md.

In plain words
What is it for?
Use it after significant development or debugging work to record architecture decisions, patterns, gotchas, and reliable commands.
Why use it?
It prevents useful debugging results, project conventions, and working commands from being forgotten between sessions.

Command

Part of the claude-workflow-v2 plugin — 14 skills, 26 commands, 7 agents, 6 hooks shipped together

About the project

Project Starter is a workflow plugin that equips coding agents with specialized subagents, reusable skills, commands, hooks, and output styles for software projects. It is for developers who want structured assistance with tasks such as planning, debugging, code review, security, and automation across several coding-agent platforms. Catalogue add-ons are components of its own workflow.

CloudAI-X/claude-workflow-v2 · 1,413 stars · on GitHub

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/cloudai-x/claude-workflow-v2/save-session-learnings
Clone the repo
git clone --depth 1 https://github.com/CloudAI-X/claude-workflow-v2

Or install claude-workflow-v2, the plugin that ships this one along with the rest of its 14 skills, 26 commands, 7 agents, 6 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 save-session-learnings

README.md
[![agentmods](https://agentmods.dev/badge/commands/cloudai-x/claude-workflow-v2/save-session-learnings.svg)](https://agentmods.dev/commands/cloudai-x/claude-workflow-v2/save-session-learnings)
Your own site
<a href="https://agentmods.dev/commands/cloudai-x/claude-workflow-v2/save-session-learnings"><img src="https://agentmods.dev/badge/commands/cloudai-x/claude-workflow-v2/save-session-learnings.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 841 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.00028 $0.00841
Opus 5 $0.00014 $0.00420
Sonnet 5 $0.00006 $0.00168
Haiku 4.5 $0.00003 $0.00084

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

Security

Grade A, and why

save-session-learnings 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 5d 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.

commands/save-session-learnings.md · 134 lines

How it starts

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

Save Session Learnings

Capture and persist significant discoveries from this session into project documentation so knowledge survives across sessions and agents.

Phase 1: Gather Session Context

Collect evidence of what was learned during this session:

git diff HEAD~5 --stat
git log --oneline -10
git diff --name-only HEAD~5

Also review the conversation history for:

  • Bugs that were debugged (root cause + fix)
  • Architecture decisions made
  • Configuration or environment discoveries
  • Patterns established or followed
  • Commands that worked (or failed)
  • Gotchas and edge cases encountered

Phase 2: Categorize Learnings

Sort each finding into one of these categories:

Architecture

  • Key files, folders, data flow, component relationships
  • Service boundaries, module dependencies

Patterns

  • Naming conventions, code style, recurring design patterns
  • File structure conventions, import ordering

Gotchas

  • Things that break, common errors, non-obvious behavior
  • Workarounds for known issues

Commands

  • Build, test, deploy, dev server commands that work
  • Tool-specific invocations with correct flags

Decisions

  • Why something was done a certain way
  • Trade-offs considered, alternatives rejected

Phase 3: Check Existing Documentation

Before writing, read both files to avoid duplicating entries:

  1. Use Glob to check if CLAUDE.md and AGENTS.md exist in the project root
  2. If they exist, Read them fully
  3. Compare gathered learnings against existing entries
  4. Skip anything already documented
  5. If existing entries are outdated, update them instead of adding duplicates

Phase 4: Write Learnings

Update both CLAUDE.md and AGENTS.md in the project root (create if missing).

Format for New Entries

Append to the ## Session Log section (create it if absent). Use this format:

## Session Log

- YYYY-MM-DD: [Category] Brief, actionable description of what was learned

For structured learnings, append to the relevant section (### Gotchas, ### Patterns, etc.) or create the section if it does not exist:

Read the full file on GitHub · 134 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. 5d ago First seen · 134 lines · 28 tokens per session scan A 275ca6bc9484

Subscribe to this mod's changes

save-session-learnings is a command published in the GitHub repository CloudAI-X/claude-workflow-v2 (1,413 stars, last pushed 10d ago), licensed MIT. It adds 28 tokens to every session and 841 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.