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.
npx skills add JimmyPaolini/codebase --skill agent-session-hooksgit clone --depth 1 https://github.com/JimmyPaolini/codebaseWrote 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/jimmypaolini/codebase/agent-session-hooks)<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.
<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>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.00076 | $0.00533 |
| Opus 5.5 | $0.00030 | $0.00213 |
| Sonnet 5.5 | $0.00015 | $0.00107 |
| Haiku 4.5 | $0.00008 | $0.00053 |
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.
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.
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.
- 2mo ago Changed · +1 lines · +7 tokens per session f5d1971f0581
- 2mo ago First seen · 36 lines · 69 tokens per session scan A afcbb2e9fc8c
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.
agent-session-hooks compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| agent-session-hooksJimmyPaolini/codebase | Skill | 0 | 2mo ago | MIT | A | 76 | Claude Code |
| create-prprisma/orm | Skill | 48k | today | Apache-2.0 | A | 47 | Claude Code, Codex |
| git-commitThinkInAIXYZ/deepchat | Skill | 6.4k | yesterday | Apache-2.0 | A | 15 | Claude Code, Codex |
| engineer-bot-opsmakecindy/cindy | Skill | 11k | today | Apache-2.0 | A | 57 | Claude Code, Codex |
| mcore-split-prNVIDIA/skills | Skill | 4.2k | 2d ago | Apache-2.0 | A | 25 | Claude Code |
| contributingHugoRCD/evlog | Skill | 2.0k | yesterday | MIT | A | 68 | Claude Code, Codex |
| git-commit-writermergisi/awesome-openclaw-agents | Skill | 4.1k | 26d ago | MIT | A | 53 | Claude Code, Codex |