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 agentmods add instructions/johnlindquist/claude-session-hooks-template/agents-mdgit clone --depth 1 https://github.com/johnlindquist/claude-session-hooks-templateWrote 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/instructions/johnlindquist/claude-session-hooks-template/agents-md)<a href="https://agentmods.dev/instructions/johnlindquist/claude-session-hooks-template/agents-md"><img src="https://agentmods.dev/badge/instructions/johnlindquist/claude-session-hooks-template/agents-md.svg" alt="Measured on agentmods" 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 | $0.01453 | $0.01453 |
| Opus 5 | $0.00727 | $0.00727 |
| Sonnet 5 | $0.00291 | $0.00291 |
| Haiku 4.5 | $0.00145 | $0.00145 |
Grade C, and why
claude-session-hooks-template AGENTS.md scanned grade C with 1 finding 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 4d 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
Example: "Block Bash commands containing 'rm -rf'" How it starts
The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AI Agent Instructions
This is a template repository for building Claude Code session hook plugins. When working with this codebase, your goal is to help users create custom session behaviors.
Understanding This Template
What This Template Provides
-
Five hook scripts in
scripts/:SessionStart.ts- Fires when a session beginsUserPromptSubmit.ts- Fires on every user promptStop.ts- Fires when Claude tries to stopPreToolUse.ts- Fires before any tool executesPostToolUse.ts- Fires after a tool completes
-
Utilities in
src/:state.ts- Persist data across hook invocationsutils.ts- Common helper functions
-
Configuration in
hooks/hooks.jsonand.claude-plugin/plugin.json
How Hooks Work
Hooks are TypeScript scripts that:
- Receive JSON input via stdin
- Process the input
- Output JSON to stdout
Each hook has access to:
session_id- Unique identifier for the sessioncwd- Current working directory- Hook-specific data (prompt text, tool name, etc.)
Common User Requests
"I want to [action] when the user [trigger]"
Pattern: Use UserPromptSubmit hook
Example: "Remind the agent to run tests when the user mentions 'deploy'"
// In scripts/UserPromptSubmit.ts
if (prompt.toLowerCase().includes('deploy')) {
contextMessages.push('<reminder>Run tests before deploying!</reminder>');
}
"I want to block [tool] when [condition]"
Pattern: Use PreToolUse hook
Example: "Block Bash commands containing 'rm -rf'"
// In scripts/PreToolUse.ts
if (tool_name === 'Bash') {
const command = (tool_input as { command?: string }).command || '';
if (command.includes('rm -rf')) {
return denyTool('Dangerous command blocked');
}
}
"I want to require [condition] before completing"
Pattern: Use Stop hook
Example: "Require tests to pass before allowing stop"
// In scripts/Stop.ts
const state = await getState<MyState>(session_id);
if (state?.testsRequired && !state.testsPassed) {
return blockStop('Tests must pass before completing');
}
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.
- 4d ago First seen · 226 lines · 1,453 tokens per session scan C 3d2ece17b180
claude-session-hooks-template AGENTS.md is an instructions file published in the GitHub repository johnlindquist/claude-session-hooks-template (5 stars, last pushed 7mo ago), licensed MIT. It adds 1,453 tokens to every session, about $0.0073 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
systematic AGENTS.md
AGENTS.md instructions for marcusrbrown/systematic, covering agents.md - coding agent guidelines for systematic, for architecture questions, commands, conventions and anti-patterns.
systematic copilot-instructions.md
Copilot instructions for marcusrbrown/systematic, covering copilot instructions for systematic, stack, verification commands, do / don't and imports.
.claude CLAUDE.md
Claude Code instructions for samuelpatro/.claude, covering general, tooling, workflow, architecture and models for subagents & workflows.
obey CLAUDE.md
Claude Code instructions for Lexxes-Projects/obey, covering obey — claude code plugin, stack, architecture, key design decisions and status: mvp.
agentconfig.org AGENTS.md
Instructions for agentconfig/agentconfig.org, covering agent instructions for agentconfig.org, project overview, target audience, site structure and tech stack.
mumei CLAUDE.md
Instructions for iroha924/mumei, covering mumei development guide, what mumei is, language policy, bash + jq conventions (essentials) and schemas/ conventions (essentials).