dogma: Skill for Claude Code

.github/skills/session-management/SKILL.md

session-management is a skill for Claude Code from EndogenAI/dogma. It costs 134 tokens per session (5,009 once invoked), scanned A, original, Apache-2.0.

A session-lifecycle skill for AI coding agents. It defines how to keep a scratchpad, record session starts and summaries, manage context limits, and coordinate work across sessions.

In plain words
What is it for?
Use it when starting or closing an agent session, saving progress in the workspace's temporary notes, following phase gates, or preparing a handoff.
Why use it?
It reduces lost context and makes ongoing agent work easier to resume and review, especially when a session is interrupted or compressed.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions subagents; mentions AGENTS.md.

This is EndogenAI/dogma's own configuration. It tells Claude Code how to work on dogma itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dogma configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is uv run python scripts/prune_scratchpad.py --snapshot.

Reuse

Borrowing it

Nothing to install: this file belongs to EndogenAI/dogma. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/EndogenAI/dogma/main/.github/skills/session-management/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/EndogenAI/dogma

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 session-management

README.md
[![agentmods](https://agentmods.dev/badge/skills/endogenai/dogma/session-management/github.svg)](https://agentmods.dev/skills/endogenai/dogma/session-management)
Your own site
<a href="https://agentmods.dev/skills/endogenai/dogma/session-management"><img src="https://agentmods.dev/badge/skills/endogenai/dogma/session-management/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 session-management

Your own site · 80×15
<a href="https://agentmods.dev/skills/endogenai/dogma/session-management"><img src="https://agentmods.dev/badge/skills/endogenai/dogma/session-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,009 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.00134 $0.05009
Opus 5.5 $0.00054 $0.02004
Sonnet 5.5 $0.00027 $0.01002
Haiku 4.5 $0.00013 $0.00501

Measured 2mo ago against content hash f3bb8bfa5bbd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

session-management 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 2mo 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.

.github/skills/session-management/SKILL.md · 480 lines

How it starts

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

Session Management

This skill enacts the Algorithms Before Tokens axiom from MANIFESTO.md by encoding the full session lifecycle as a deterministic procedure. Session management is governed by AGENTS.md § Agent Communication — every rule in this skill derives from that section. Read AGENTS.md before deviating from any step below.


1. File Structure

The scratchpad lives in .tmp/ at the workspace root. It is gitignored and never committed.

.tmp/
  <branch-slug>/          # branch name with / replaced by -
    _index.md             # one-line stubs of all closed sessions on this branch
    <YYYY-MM-DD>.md       # one file per session day — the active scratchpad

<branch-slug> examples:

  • Branch main → .tmp/main/
  • Branch feat/agent-skills → .tmp/feat-agent-skills/
  • Branch docs/update-guides → .tmp/docs-update-guides/

The _index.md accumulates single-line stubs for every closed session on the branch. Future sessions read it for fast orientation without opening old files.


2. Session Start

Context Snapshot Before Reset

Before calling prune_scratchpad.py --init during error recovery, save a snapshot of the current context:

uv run python scripts/prune_scratchpad.py --snapshot

This saves .tmp/<branch>/<date>-snapshot.yaml containing: task_name, task_parameters, timestamp, and active scratchpad section.

After re-entry into the failed task's decision point, compare contexts:

uv run python scripts/compare_context_snapshot.py \
  --snapshot ".tmp/$(git branch --show-current | tr '/' '-')/$(date +%Y-%m-%d)-snapshot.yaml"

If equivalent: true → do not re-attempt. Escalate to user: "My context is identical to the failed attempt. New direction needed."

Encoding point: Research basis: docs/research/orchestrator-autopilot-failure.md § Recommendation 5. Scripts: scripts/prune_scratchpad.py --snapshot, scripts/compare_context_snapshot.py.

Read the full file on GitHub · 480 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. 2mo ago First seen · 480 lines · 134 tokens per session scan A f3bb8bfa5bbd

Subscribe to this mod's changes

session-management is a skill published in the GitHub repository EndogenAI/dogma (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 134 tokens to every session and 5,009 once invoked, about $0.0005 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

session-management compared with skills from other repositories

session-management next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
session-managementEndogenAI/dogmaSkill22mo agoApache-2.0A134Claude Code
custom-brand-designKbWen/agentic-osSkill2274d agoMITA23Claude Code, Codex
air-blackbox-sales-agentairblackbox/airblackboxSkill254d agoApache-2.0A248Claude Code, Codex
interpret-resultsairblackbox/airblackboxSkill254d agoApache-2.0A49Claude Code
nio-external-scorecore0-io/nioSkill2013d agoApache-2.0A97Claude Code
nio-scancore0-io/nioSkill2013d agoApache-2.0A81Claude Code
constitutional-aisynthetic-sciences/openscienceSkill4.3k2d agoApache-2.0A58Claude Code, Codex