Configure SessionStart hooks for Claude Code on the web. Use when setting up a repository to run on cloud infrastructure, installing dependencies, or initializing environments for remote Claude Code sessions.
View on GitHubcameronsjo/claude-marketplace
cc-web
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/cameronsjo/claude-marketplace/blob/main/plugins/cc-web/skills/session-start-hook/SKILL.md -a claude-code --skill session-start-hookInstallation paths:
.claude/skills/session-start-hook/# SessionStart Hook Configuration
Configure your repository for Claude Code on the web using SessionStart hooks. This skill helps you create hooks that automatically run when Claude Code starts a session in the cloud environment.
## Overview
**SessionStart hooks** execute when Claude Code begins a session, allowing you to:
- Install project dependencies (npm, pip, etc.)
- Set up environment variables
- Configure databases or services
- Run initialization scripts
- Validate the environment
## Quick Setup
### 1. Create the settings file
Create `.claude/settings.json` in your repository root:
```json
{
"hooks": {
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "./scripts/claude-setup.sh",
"timeout": 120
}
]
}
]
}
}
```
### 2. Create the setup script
Create `scripts/claude-setup.sh`:
```bash
#!/bin/bash
set -e
# Detect package manager and install dependencies
if [ -f "package.json" ]; then
if [ -f "pnpm-lock.yaml" ]; then
pnpm install
elif [ -f "yarn.lock" ]; then
yarn install
elif [ -f "bun.lockb" ]; then
bun install
else
npm install
fi
fi
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
if [ -f "pyproject.toml" ]; then
if command -v uv &> /dev/null; then
uv sync
elif command -v poetry &> /dev/null; then
poetry install
else
pip install -e .
fi
fi
exit 0
```
### 3. Make the script executable
```bash
chmod +x scripts/claude-setup.sh
```
## Hook Configuration Reference
### Basic Structure
```json
{
"hooks": {
"SessionStart": [
{
"matcher": "<pattern>",
"hooks": [
{
"type": "command",
"command": "<script-or-command>",
"timeout": <seconds>,
"statusMessage": "<optional-message>"
}
]
}
]
}