agent-session-hooks

agent-session-hooks is a skill for Claude Code from JimmyPaolini/codebase. It costs 76 tokens per session (533 once invoked), scanned A, original, MIT.

A guide to startup checks that run when an agent session begins and add failures to the agent's context. It covers branch names, signed Git commits, GitHub access, and installed skills.

In plain words
What is it for?
It helps troubleshoot or add session-start checks for Git branches, commit signing, GitHub authentication, and repository skills.
Why use it?
It helps explain why a session stopped before coding and points to the repair command for each failed check.

Skill for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: reads .claude/ paths; mentions Claude Code; installed under .agents/ (shared by several agents).

Good fit It helps troubleshoot or add session-start checks for Git branches, commit signing, GitHub authentication, and repository skills.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jimmypaolini/codebase/agent-session-hooks
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.

Any agent
npx skills add JimmyPaolini/codebase --skill agent-session-hooks
Clone the repo
git clone --depth 1 https://github.com/JimmyPaolini/codebase

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 agent-session-hooks

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/jimmypaolini/codebase/agent-session-hooks"><img src="https://agentmods.dev/badge/skills/jimmypaolini/codebase/agent-session-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 533 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.00076 $0.00533
Opus 5.5 $0.00030 $0.00213
Sonnet 5.5 $0.00015 $0.00107
Haiku 4.5 $0.00008 $0.00053

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

Security

Grade A, and why

agent-session-hooks 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.

.agents/skills/agent-session-hooks/SKILL.md · 37 lines

How it starts

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

Agent Session Hooks

Startup checks run at the start of every agent session and inject their failure as additional context. Fix what they report before writing any code — each one names the problem and the command that repairs it.

When to Use This Skill

  • When an agent session fails at startup due to a hook.
  • When you need to understand how the session gets context about branches, worktrees, git signing, GitHub authentication, or missing skills.
  • When you need to add a new check that should run for every agent session.

Architecture

Script Checks
validate-session-branch-name.sh Branch follows <type>/<scope>-<description>; directs the agent to the rename-branch skill
validate-session-worktree-name.sh Worktree directory follows lowercase kebab-case naming and ignore conventions
validate-session-commit-signing.sh commit.gpgsign, user.signingkey, and a GPG signing smoke test
validate-session-gh-authentication.sh The active gh account plus Projects access
validate-session-skills.sh Every skill declared in skills-lock.json is present; directs the agent to codebase:install-skills

Each script is registered twice, once per harness, and both registrations point at the same file:

Harness Registration
Claude Code SessionStart entries in .claude/settings.json
GitHub Copilot sessionStart entries in .github/hooks/*.json

Adding a New Check

When adding a check: put the script under scripts/git/, emit through scripts/git/emit-session-hook-context.sh so both harnesses can read it, and register it in both places.

Read the full file on GitHub · 37 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 Changed · +1 lines · +7 tokens per session f5d1971f0581
  2. 2mo ago First seen · 36 lines · 69 tokens per session scan A afcbb2e9fc8c

Subscribe to this mod's changes

agent-session-hooks is a skill published in the GitHub repository JimmyPaolini/codebase (0 stars, last pushed 2mo ago), licensed MIT. It adds 76 tokens to every session and 533 once invoked, about $0.0003 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-09-18.

Related

agent-session-hooks compared with skills from other repositories

agent-session-hooks next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-session-hooksJimmyPaolini/codebaseSkill02mo agoMITA76Claude Code
create-prprisma/ormSkill48ktodayApache-2.0A47Claude Code, Codex
git-commitThinkInAIXYZ/deepchatSkill6.4kyesterdayApache-2.0A15Claude Code, Codex
engineer-bot-opsmakecindy/cindySkill11ktodayApache-2.0A57Claude Code, Codex
mcore-split-prNVIDIA/skillsSkill4.2k2d agoApache-2.0A25Claude Code
contributingHugoRCD/evlogSkill2.0kyesterdayMITA68Claude Code, Codex
git-commit-writermergisi/awesome-openclaw-agentsSkill4.1k26d agoMITA53Claude Code, Codex