agent-session-memory-protocol

agent-session-memory-protocol is a skill for Claude Code, Codex from topprismdata/cultivating-ml-agent. It costs 130 tokens per session (1,822 once invoked), scanned A, original, MIT.

A four-file system for recording the state, timeline, experiments, and handoff notes of a long-running machine-learning project. It is designed for work that continues across sessions or changes hands between agents.

In plain words
What is it for?
Use it to document ongoing experiments, compare submissions and scores, record decisions and blockers, and prepare instructions for another session or agent.
Why use it?
It prevents lost context, repeated dead ends, and forgotten experiment results after a break or disconnection. A later session can use the records to resume with the current goal and next actions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

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 skills/topprismdata/cultivating-ml-agent/agent-session-memory-protocol
Any agent
npx skills add topprismdata/cultivating-ml-agent --skill agent-session-memory-protocol
Clone the repo
git clone --depth 1 https://github.com/topprismdata/cultivating-ml-agent

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 agent-session-memory-protocol

README.md
[![agentmods](https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/agent-session-memory-protocol.svg)](https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/agent-session-memory-protocol)
Your own site
<a href="https://agentmods.dev/skills/topprismdata/cultivating-ml-agent/agent-session-memory-protocol"><img src="https://agentmods.dev/badge/skills/topprismdata/cultivating-ml-agent/agent-session-memory-protocol.svg" alt="Measured on agentmods" height="20"></a>
Per session 130 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,822 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.1 $0.00130 $0.01822
Opus 5 $0.00065 $0.00911
Sonnet 5 $0.00026 $0.00364
Haiku 4.5 $0.00013 $0.00182

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

Security

Grade A, and why

agent-session-memory-protocol 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 6d 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/examples/agent-session-memory-protocol/SKILL.md · 182 lines

How it starts

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

Agent Session Memory Protocol

Problem

Long-running Kaggle experiments span hours to days. Between sessions:

  • Agent forgets what was tried and why
  • Submissions and their OOF/LB pairs get lost
  • Dead ends get repeated
  • Handoff to a new session loses critical context

The 4-File Session Memory Structure

Create a session directory per experiment session:

~/.claude/projects/<project>/sessions/
└── <YYYYMMDD_HHMMSS>/
    ├── session_state.md    # Goal, subtask, status, plan, blockers, next actions
    ├── timeline.md         # Append-only log of actions, commands, results
    ├── experiments.md      # Structured table of all submissions/attempts
    └── handoff.md          # Concise resume instructions for next session

File 1: session_state.md

# Session State
- Session: 20260708_140000
- Project: pokemon-tcg-ai-battle
- Started: 2026-07-08 14:00
- Updated: 2026-07-08 18:30

## Goal
Optimize PTCG agent to reach top 200 on the leaderboard.

## Current Subtask
Waiting for Nithin A/B convergence after 07-06 re-submit (μ₀=600 reset).

## Status
- Nithin A: LB 869 (converging from 600, +17/day)
- Nithin B: LB 772 (converging from 600, +2.5/day)
- Latest-2 = Nithin A + Nithin B (both in final-2 slots)

## Plan
1. WAIT — do not re-submit (resets convergence)
2. Check LB daily until ~Jul 20 (expected ~950/910)
3. Aug 10-14: submit 2 copies of best agent (high-roll)

## Blockers
- GPU quota exhausted (30h/week) — blocks Biohub, Industrial T1, ARC-AGI-3

## Next Actions
- [ ] Jul 13: Check PTCG LB (expected Nithin A ~920)
- [ ] Jul 20: Check PTCG LB (expected Nithin A ~950)
- [ ] Aug 10: Begin high-roll duplicate submissions

File 2: timeline.md

# Timeline (append-only)

## 2026-07-08 14:00 — Session Start
- Recalled AutoMem: 109 memories, PTCG status, ROGII Pipeline A

## 14:15 — PTCG Check
- Nithin A: 869.2 (+17 from yesterday)
- Nithin B: 772.3 (+2.5)
- Decision: WAIT, no re-submit

## 14:30 — ROGII Pipeline A
- Pushed rogii-pipea-only kernel (Pipeline B trimmed)
- Kernel COMPLETE, submission.csv written (14152 rows)
- Manual Submit to Competition required

## 15:00 — ROGII Score
- LB: 19545.46 (TERRIBLE — predicted values include -27561 outliers)
- Root cause: Pipeline A predictions have negative TVT values for some rows
- Old v7 (13.82) still better than Pipeline A on LB

Read the full file on GitHub · 182 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. 6d ago First seen · 182 lines · 130 tokens per session scan A 35ca27ccd3ee

Subscribe to this mod's changes

agent-session-memory-protocol is a skill published in the GitHub repository topprismdata/cultivating-ml-agent (5 stars, last pushed 9d ago), licensed MIT. It adds 130 tokens to every session and 1,822 once invoked, about $0.0006 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.