Agent skill

Agent Runtime Lifecycle Hooks

by lobehub in lobehub/lobehub

Registers lifecycle hooks on an agent run to observe, mock or intervene at each step, dispatching them in the order they were registered.

Custom licenceAuto-check passedAgent Workflows

Install Agent Runtime Lifecycle Hooks

skills CLI
$ npx skills add lobehub/lobehub --skill agent-runtime-hooks -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lobehub/lobehub agent-runtime-hooks --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lobehub/lobehub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/agent-runtime-hooks .claude/skills/agent-runtime-hooks && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agent-runtime-hooks
GitHub stars
83k
Token cost
~2.8k tokens
SKILL.md length
799 words
Files
1
Skills in repo
50
Repo updated
First seen
Licence
Custom licence

At a glance

Registers lifecycle hooks on an agent run to observe, mock or intervene at each step, dispatching them in the order they were registered.

  • Observing or logging every step of an agent run
  • SKILL.md covers Hook Types, Key Files, Registration and Events, plus 3 more sections
  • Needs HOOK_TOKEN
  • Mocking a tool call during a test run

What it does

Hooks are registered by passing a hooks array into the agent runner, and a dispatcher stores them per operation, firing sixteen hook types across five categories such as before and after each step. A table of key files maps each concern to its implementation, covering the event types themselves, registration and webhook delivery, local mocks, tool-call context building, tool notifications, step events, human-intervention continuation, terminal completion events and sub-agent events.

A hook can define a local handler function, a webhook, or both; local dispatch always calls the handler, while queued dispatch sends the serialized webhook instead, and only the webhook configuration survives a process restart since functions cannot be serialized. Registrations are cleaned up automatically once an operation completes.

When your agent uses it

  • Observing or logging every step of an agent run
  • Mocking a tool call during a test run
  • Delivering agent events to a webhook instead of a local handler

Example prompts

  • “Register a beforeStep hook that logs the current operation.”
  • “Set up a webhook hook so queued runs notify our endpoint.”
  • “Which file handles human-intervention continuation in the agent runtime?”

What it can do on your machine

Read from SKILL.md and the folder at commit 1863542. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • HOOK_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Agent Runtime Lifecycle Hooks loads about 2.8k tokens when it runs. Until then it costs about 29 tokens; SKILL.md has 799 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~29
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 799 words (~2,766 tokens).

“Register lifecycle hooks through execAgent({ hooks }). HookDispatcher stores them per operation and dispatches them in registration order.”

— opening of SKILL.md by lobehub, Custom licence
name
agent-runtime-hooks
user-invocable
false

Read the full SKILL.md on GitHub

Files

Just SKILL.md in .agents/skills/agent-runtime-hooks of lobehub/lobehub.

Open the folder on GitHubat commit 1863542

Compare with similar skills

Agent Runtime Lifecycle Hooks next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Agent Runtime Lifecycle Hooks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agent Runtime Lifecycle Hooks this skilllobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
MCP Integration for Pluginsanthropics/claude-plugins-official37k11 repos~3.1kAutomated safety check: PassApache-2.0
Chat SDKdatabuddy-analytics/Databuddy1.2k—~2.6kAutomated safety check: PassAGPL-3.0
Build Codex Native Pluginscallstackincubator/codex-mobile-dev-plugin138—~1.9kAutomated safety check: PassNone
Slack Bot Builderdavila7/claude-code-templates32k4 repos~2.2kAutomated safety check: PassMIT
Interaction Flow Keeperdiscord-php/DiscordPHP1.1k—~1.7kAutomated safety check: PassMIT

Similar skills

  • MCP Integration for Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.

    37k GitHub starsUsed in 11 repos~3.1k tokens
    Agent WorkflowsAuto-check passed
  • Chat SDK

    databuddy-analytics/Databuddy

    Build multi-platform chat bots with Chat SDK (chat npm package).

    1.2k GitHub stars~2.6k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Build Codex Native Plugins

    callstackincubator/codex-mobile-dev-plugin

    Official

    Create, extend, package, and troubleshoot Codex and ChatGPT plugins using OpenAI MCP Extensions.

    138 GitHub stars~1.9k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Slack Bot Builder

    davila7/claude-code-templates

    Build Slack apps using the Bolt framework across Python, JavaScript, and Java.

    32k GitHub starsUsed in 4 repos~2.2k tokens
    Agent WorkflowsAuto-check passed
  • Interaction Flow Keeper

    discord-php/DiscordPHP

    Maintain interaction flow — Interaction typing, resolved data caching, command routing, autocomplete, modal responses, and interaction builders.

    1.1k GitHub stars~1.7k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Slack Bot Builder

    sickn33/agentic-awesome-skills

    Build Slack apps using the Bolt framework across Python, JavaScript, and Java.

    47k GitHub starsUsed in 2 repos~426 tokens
    Agent WorkflowsAuto-check passed

More from lobehub/lobehub

All 50 skills in this repo
  • Builds single-file interactive HTML prototypes rendered with the real LobeHub UI components and written as production-style React, so they can later be split into files.

    83k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Verifies a delivery end to end by driving the real product on a CLI, web, desktop or iOS Simulator surface, capturing evidence and publishing a round with the lh CLI.

    83k GitHub stars~9.7k tokensUpdated today
    Auto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Maintains LobeHub's model-backed alint rule set: writing rules, removing false positives against real code, deciding warn versus error and tracking token cost.

    83k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Guides building LobeHub builtin agent tools, from the manifest and execution runtime to executors, chat UI renders and registry wiring.

    83k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Explains how LobeHub client code fetches data through services, SWR store hooks and cache keys, and when to avoid useEffect fetching or duplicated state.

    83k GitHub stars~1.7k tokensUpdated today
    Auto-check passed

Works with

Questions about Agent Runtime Lifecycle Hooks

What does Agent Runtime Lifecycle Hooks do?

Registers lifecycle hooks on an agent run to observe, mock or intervene at each step, dispatching them in the order they were registered. Hooks are registered by passing a hooks array into the agent runner, and a dispatcher stores them per operation, firing sixteen hook types across five categories such as before and after each step. A table of key files maps each concern to its implementation, covering the event types themselves, registration and webhook delivery, local mocks, tool-call context building, tool notifications, step events, human-intervention continuation, terminal completion events and sub-agent events.

When should I use Agent Runtime Lifecycle Hooks?

Agent Runtime Lifecycle Hooks fits situations like: observing or logging every step of an agent run; mocking a tool call during a test run; delivering agent events to a webhook instead of a local handler.

How do I install Agent Runtime Lifecycle Hooks in Claude Code?

Run `npx skills add lobehub/lobehub --skill agent-runtime-hooks -a claude-code`. Or copy the skill folder (.agents/skills/agent-runtime-hooks in lobehub/lobehub) into .claude/skills/agent-runtime-hooks in your project. Claude Code loads it when a task matches its description.

How do I install Agent Runtime Lifecycle Hooks in Codex?

Run `npx skills add lobehub/lobehub --skill agent-runtime-hooks -a codex`. Or copy the skill folder (.agents/skills/agent-runtime-hooks in lobehub/lobehub) into .agents/skills/agent-runtime-hooks in your project. Codex loads it when a task matches its description.

Can I use Agent Runtime Lifecycle Hooks in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lobehub/lobehub --skill agent-runtime-hooks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agent-runtime-hooks, .gemini/skills/agent-runtime-hooks, .github/skills/agent-runtime-hooks and .opencode/skills/agent-runtime-hooks in your project.

What does Agent Runtime Lifecycle Hooks need to run?

Going by SKILL.md and its folder, Agent Runtime Lifecycle Hooks needs credentials named HOOK_TOKEN.

Does Agent Runtime Lifecycle Hooks access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Agent Runtime Lifecycle Hooks safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Agent Runtime Lifecycle Hooks use?

Agent Runtime Lifecycle Hooks has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Agent Runtime Lifecycle Hooks use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Agent Runtime Lifecycle Hooks?

Skills that share tags, products or a category with Agent Runtime Lifecycle Hooks: MCP Integration for Plugins (anthropics/claude-plugins-official, 37k stars), Chat SDK (databuddy-analytics/Databuddy, 1.2k stars), Build Codex Native Plugins (callstackincubator/codex-mobile-dev-plugin, 138 stars) and Slack Bot Builder (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agent Runtime Lifecycle Hooks?

lobehub (a GitHub organization) maintains it in lobehub/lobehub, which has 83,023 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on October 7, 2026.

Source: lobehub/lobehub on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.