session-start-hook

Creates SessionStart hooks that install dependencies for Claude Code web sessions.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/Simon-YHKim/eject-button --skill session-start-hook-simon-yhkim
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-start-hook
Source: https://github.com/Simon-YHKim/eject-button/tree/main/.claude/skills/session-start-hook
Command: npx skills add https://github.com/Simon-YHKim/eject-button --skill session-start-hook-simon-yhkim

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Claude Code on the web starts sessions in fresh containers without your project's dependencies installed, so tests and linters fail until someone manually sets up the environment. This Skill automates the creation of a SessionStart hook that installs dependencies before the session begins. ## Core Features & Use Cases - Dependency Analysis: Detects package managers from manifests like package.json, pyproject.toml, Cargo.toml, go.mod, and Gemfile, plus README context. - Hook Generation: Writes an idempotent, non-interactive bash hook script and registers it in .claude/settings.json. - End-to-End Validation: Runs the hook, a sample linter command, and a sample test to confirm the environment works, then commits and pushes. - Use Case: You want every Claude Code web session on your Node.js repository to have npm dependencies pre-installed so lint and test commands work immediately. ## Quick Start Set up a SessionStart hook for this repository so tests and linters work in Claude Code on the web.

Frequently Asked Questions about session-start-hook

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

FAQPage Schema
How do I set up a SessionStart hook for Claude Code on the web?

Create a bash script in .claude/hooks/session-start.sh that installs your dependencies, then register it under the SessionStart hook in .claude/settings.json. The hook runs automatically when a web session starts.

How do I install dependencies automatically in Claude Code web sessions?

Use a SessionStart hook that detects your package manager from manifests like package.json or pyproject.toml and runs the install command. The container state is cached after the hook completes, so subsequent sessions start faster.

Should a SessionStart hook run synchronously or asynchronously?

Synchronous mode guarantees dependencies are installed before the session starts, avoiding race conditions, but delays session startup. Async mode returns immediately with an asyncTimeout, but the agent may run before installation finishes.

How do I run a hook only in remote Claude Code environments?

Check the CLAUDE_CODE_REMOTE environment variable at the start of your script and exit early if it is not set to true. This prevents the hook from running during local sessions.

Why does my SessionStart hook fail in Claude Code on the web?

Common causes include missing execute permissions on the script, interactive prompts blocking installation, or non-idempotent commands failing on cached containers. Test locally by running the script with CLAUDE_CODE_REMOTE=true.