lifecycle-hooks

lifecycle-hooks is a skill for Claude Code from sequenzia/agent-alchemy. It costs 35 tokens per session (391 once invoked), scanned A, original, MIT.

A set of rules that runs at specific points in an agent's workflow, such as before it writes a file or runs a command.

In plain words
What is it for?
It helps define automatic behavior for file operations and shell commands in agent sessions.
Why use it?
It removes repeated manual checks and can keep approved workflow actions from being interrupted by permission prompts.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event.

Good fit It helps define automatic behavior for file operations and shell commands in agent sessions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sequenzia/agent-alchemy/lifecycle-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 sequenzia/agent-alchemy --skill lifecycle-hooks
Clone the repo
git clone --depth 1 https://github.com/sequenzia/agent-alchemy

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 lifecycle-hooks

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sequenzia/agent-alchemy/lifecycle-hooks"><img src="https://agentmods.dev/badge/skills/sequenzia/agent-alchemy/lifecycle-hooks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 391 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.00035 $0.00391
Opus 5.5 $0.00014 $0.00156
Sonnet 5.5 $0.00007 $0.00078
Haiku 4.5 $0.00003 $0.00039

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

Security

Grade A, and why

lifecycle-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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (references/auto-approve-da-session.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

ported/20260304-102613/core-tools/skills/lifecycle-hooks/SKILL.md · 40 lines

What it actually says

Lifecycle Hooks

This skill defines behavioral rules that were originally enforced by platform lifecycle hooks. These rules describe automated behaviors that trigger at specific points in the agent workflow.


On before_action

Trigger: Fires before the agent executes any action (file write, shell command, etc.) Applies when: Action matches Write|Edit|Bash

This rule auto-approves file operations targeting deep-analysis session and cache directories. It prevents permission prompts from interrupting autonomous exploration workflows.

The implementation logic is in references/auto-approve-da-session.sh. This script:

  • Reads action context from stdin (JSON with action type and parameters)
  • Checks if the target file path or command references session directories (.agents/sessions/__da_live__/, .agents/sessions/exploration-cache/, .agents/sessions/da-*/)
  • If matched, approves the action automatically
  • If not matched, passes through to normal permission flow (no opinion)

Integration Notes

What this component does: Defines automated behavioral rules that were originally enforced by platform lifecycle hooks.

Origin: Converted from 1 lifecycle hook (PreToolUse/before_action)

Capabilities needed:

  • Event/lifecycle hook system (if the target harness supports one)
  • Alternatively, implement as middleware, conditional checks, or manual review steps

Adaptation guidance:

  • This behavior was originally enforced automatically by the platform. In the target harness, it may need to be implemented as middleware, event handlers, or manual review steps.
  • The command hook script in references/ can be executed directly if the harness supports shell-based hooks.
  • The auto-approval targets session file operations to enable uninterrupted deep analysis workflows.
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 40 lines · 35 tokens per session scan A 88f90513924c

Subscribe to this mod's changes

lifecycle-hooks is a skill published in the GitHub repository sequenzia/agent-alchemy (45 stars, last pushed 4mo ago), licensed MIT. It adds 35 tokens to every session and 391 once invoked, about $0.0001 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-03.