startup-hook-skill

Create and validate Claude Code startup hooks that install dependencies.

4|1|Updated May 19, 2025
One-click install
npx skills add https://github.com/agentydragon/ducktape --skill startup-hook-skill-agentydragon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: startup-hook-skill
Source: https://github.com/agentydragon/ducktape/tree/main/claude_web_env/rootfs/home/claude/.claude/skills/session-start-hook
Command: npx skills add https://github.com/agentydragon/ducktape --skill startup-hook-skill-agentydragon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps automate the creation and validation of startup hooks for Claude Code on the web, ensuring dependencies are installed before sessions start.

Core Features & Use Cases

  • Design and implement session-start hooks that install dependencies for tests and linters.
  • Register and validate the hooks in Claude's settings, with idempotent behavior and environment variable persistence.
  • Use cases include web-based Claude Code sessions where reproducible environments are required for consistent development workflows.

Quick Start

Create a session-start hook at .claude/hooks/session-start.sh that installs dependencies and registers it in .claude/settings.json.

Frequently Asked Questions about startup-hook-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate dependency installation when Claude Code starts a session?

You can automate dependency installation at session start by creating a startup hook script and registering it in Claude Code settings. This ensures dependencies are installed before your web-enabled session begins, enabling consistent development workflows.

How does a Claude Code startup hook work for environment setup?

A Claude Code startup hook works by executing a shell script at session start to install dependencies and configure environment variables. It registers in settings.json, ensuring reproducible environments for tests and linters during initialization.

What's the best way to ensure startup hooks are idempotent in Claude Code?

The best way to ensure idempotent startup hooks is to use scripts that validate dependency states before installing and handle errors robustly. This prevents duplicate installations and ensures reliable startup behavior across repeated session initializations.

Can I use startup hooks to run tests and linters in web-based Claude Code sessions?

Yes, you can use startup hooks to run tests and linters in web-based Claude Code sessions. By designing session-start hooks that install required dependencies, you ensure the environment is fully prepared for tests and linters to execute during initialization.

Why do my Claude Code session-start hooks fail to persist environment variables?

Session-start hooks may fail to persist environment variables if they are not properly registered in Claude's settings or lack robust error handling. Ensuring proper settings registration and idempotent script behavior resolves persistence issues.

Do I need to manually register hooks in settings.json for Claude Code?

Yes, you need to register hooks in settings.json for Claude Code to recognize them at session start. The startup hook script must be placed in the hooks directory and properly referenced in settings to ensure reliable startup behavior.