← ClaudeAtlas

ref-sp-agents-hookslisted

Author agent lifecycle hooks that run deterministic shell commands at session, prompt, tool, and stop events across Claude Code, GitHub Copilot CLI, VS Code, and Gemini CLI. Use when: creating or editing a hook, choosing a lifecycle event, writing a hook script that reads stdin JSON and returns an allow/deny/context decision, making a hook portable across agents, or debugging why a hook does not fire or block.
swiftpostlabs/agentic-tools · ★ 0 · AI & Automation · score 73
Install: claude install-skill swiftpostlabs/agentic-tools
# Agent Hooks ## Purpose Give the agent portable defaults for authoring lifecycle hooks -- shell commands that run automatically at agent events -- so the shared input/output contract lives in one place and only the per-service specifics (event names, config location, field names) are looked up per platform. ## When to use this skill - Creating or editing a hook for any agent CLI or IDE. - Deciding which lifecycle event a behavior should attach to. - Writing a hook script that reads a JSON event on stdin and returns a decision. - Making one hook work across more than one agent platform. - Debugging why a hook does not fire, does not block, or breaks output parsing. ## Scope Boundaries - This skill centers on `command` (shell) hooks, the one type every platform supports. Non-command types (`http`, `mcp_tool`, `prompt`, `agent`) are noted per platform in the references. - For the config location, event vocabulary, and payload field names of one platform, read that platform's reference file. - This skill is not about MCP servers, skills, or subagents themselves. - For repo instruction files (`AGENTS.md`, `GEMINI.md`, `.claude/CLAUDE.md`), use the repo's instruction-authoring skill (`ref-sp-agents-instructions-authoring` here). - When a hook reads or guards protected/secret files, use the repo's agent-security skill (`ref-sp-agents-security` here). ## Mental Model A hook is a triple: **(event, matcher, command)**. At a lifecycle event, the agent runs your command, passes