Skip to content
Agentmart
Submit a tool

hooks-session-start

Session initialization hook that cleans stale agents, injects recent memory context, and ensures 100% CLAUDE.md adherence

Skill by DammianMiller

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/dammianmiller-hooks-session-start

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Session initialization hook that cleans stale agents, injects recent memory context, and ensures 100% CLAUDE.md adherence

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/hooks-session-start

What's inside

Skill name
hooks-session-start
Description
Session initialization hook that cleans stale agents, injects recent memory context, and ensures 100% CLAUDE.md adherence
License
MIT
Instructions
46 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Session Start Hook

Automated session initialization that maintains agent health, context, and CLAUDE.md compliance.

## Purpose

This hook runs at the start of each agent session to:

1. Clean stale agents from coordination database (heartbeat >24h old)
2. Inject recent memory context (last 24h, high importance)
3. Surface open loops and active goals
4. **READ AND OBEY CLAUDE.md** - Explicitly loads and surfaces architectural constraints, security rules, and quality gates from CLAUDE.md

## Functions

### Stale Agent Cleanup

Removes agents that haven't heartbeated in 24 hours:

- Deletes stale work claims
- Cancels open work announcements
- Marks agents as 'failed'
- Purges old agent registry entries (>7 days)
- Clears old messages (>24h)

### Context Injection

Provides recent context:

- **Recent Memories**: Last 10 high-importance memories from 24h
- **Open Loops**: Top 5 action/goal/decision items with importance >= 7

## Usage

Automatically invoked by opencode at session start. No manual invocation needed.

## Location

`.forge/hooks/session-start.sh` (also mirrored at `.uap/omp/hooks/pre/session-start.sh`)

## Database Paths

- Memory DB: `agents/data/memory/short_term.db`
- Coordination DB: `agents/data/coordination/coordination.db`

From DammianMiller/universal-agent-protocol, MIT.

More from DammianMiller/universal-agent-protocol

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Mar 18, 2026 (7 months ago)
Last release
Oct 9, 2026 (20 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from DammianMiller

Cite this page

hooks-session-start skill. Agent Mart. https://agentmart.dev/skills/dammianmiller-hooks-session-start (last updated 2026-10-24)