Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/marcusgoll/Spec-Flownpx agentmods add skills/marcusgoll/spec-flow/session-boundaryWrote 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.
[](https://agentmods.dev/skills/marcusgoll/spec-flow/session-boundary)<a href="https://agentmods.dev/skills/marcusgoll/spec-flow/session-boundary"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/session-boundary/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.
<a href="https://agentmods.dev/skills/marcusgoll/spec-flow/session-boundary"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/session-boundary.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.01414 |
| Opus 5.5 | $0.00000 | $0.00566 |
| Sonnet 5.5 | $0.00000 | $0.00283 |
| Haiku 4.5 | $0.00000 | $0.00141 |
Grade A, and why
session-boundary 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.
How it starts
The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Session Boundary Skill
Detect and handle session boundaries for multi-context autopilot workflows.
Purpose
Manage smooth transitions across context windows by:
- Detecting when context is about to be compacted
- Generating comprehensive handoff documents
- Restoring state after context restoration
- Tracking session metrics for workflow optimization
When to Invoke
- Automatically via SessionStart hook (startup, resume, compact triggers)
- Automatically via PreCompact hook (before context compaction)
- Automatically via Stop hook (session end)
- Manually via
/context nextor/context status - During
/feature continueor/epic continue
Core Concepts
Write-Through State Pattern
Critical: Never keep state only in conversation memory. Always persist immediately.
# Good: Write to state.yaml immediately
session:
id: "session-20251204-143000"
started_at: "2025-12-04T14:30:00Z"
phase_at_start: "implement"
decisions_made: ["Redis for token blacklist"]
# Bad: Keeping state only in conversation
# "I decided to use Redis..." (lost on compaction)
Session Lifecycle
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ SessionStart │───▶│ Working │───▶│ Stop │
│ (restore) │ │ (track) │ │ (checkpoint) │
└──────────────┘ └──────────────┘ └──────────────┘
│
▼
┌──────────────┐
│ PreCompact │
│ (handoff) │
└──────────────┘
│
▼
┌──────────────┐
│ SessionStart │
│ (restore) │
└──────────────┘
Hook Integration
| Hook | Trigger | Purpose |
|---|---|---|
| SessionStart | startup, resume, compact | Restore workflow context |
| PreCompact | auto, manual | Generate handoff before context loss |
| Stop | session end | Checkpoint current state |
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.
- 1mo ago First seen · 228 lines · 0 tokens per session scan A c39657120b5d
session-boundary is a skill published in the GitHub repository marcusgoll/Spec-Flow (96 stars, last pushed 23d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,414 tokens. 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-09-03.
Other skills, from other repositories
agent-harness-fault-injection
Use when an agent workflow needs deterministic recovery evidence for sandbox, MCP/tool, worker, checkpoint, memory, or orchestration failures.
aria
Designs the data model, API contracts, and structural foundation of the system.
story-readiness
Is a story implementation-ready? Checks clear acceptance criteria, open questions, ADR refs. READY/NEEDS WORK/BLOCKED/NOT ASSESSED.
playtest-report
Structured playtest report template, or turn existing playtest notes into structured feedback.
aws-sst-development
SST v4 (Ion) expert for managing AWS resources as code with the Pulumi-backed framework.
autonomous-agent-patterns
Design patterns for building autonomous coding agents, inspired by Cline and OpenAI Codex.