/hooks-plugin:hooks-session-start-hook --remote-only to only run in web sessions, --no-verify to skip test verificationfrom hooks-plugin
Generates a SessionStart hook that auto-installs dependencies and verifies tests/linters when a repo is opened in Claude Code on the web. Detects project stack from lockfiles and config files.
Ships in hooks-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate a SessionStart hook that prepares your repository for Claude Code on the web — installing dependencies, configuring environment variables, and verifying that tests and linters work.
| Use this skill when... | Use /hooks:hooks-configuration instead when... |
|---|---|
| Setting up a repo for Claude Code on the web | Configuring other hook types (PreToolUse, Stop, etc.) |
| Need automatic dependency install in web sessions | Need general hooks knowledge or debugging |
| Want tests/linters verified on session start | Writing custom hook logic from scratch |
| Onboarding a project to remote Claude Code | Understanding hook lifecycle events |
Detect project stack:
find . -maxdepth 1 \( -name 'package-lock.json' -o -name 'yarn.lock' -o -name 'pnpm-lock.yaml' -o -name 'bun.lockb' -o -name 'poetry.lock' -o -name 'uv.lock' -o -name 'Cargo.lock' -o -name 'go.sum' -o -name 'Gemfile.lock' \)find . -maxdepth 1 \( -name 'package.json' -o -name 'pyproject.toml' -o -name 'requirements.txt' -o -name 'Cargo.toml' -o -name 'go.mod' -o -name 'Gemfile' -o -name 'pom.xml' \) -o -maxdepth 1 -name 'build.gradle*'find . -maxdepth 1 \( -name 'biome.json' -o -name 'biome.jsonc' -o -name '.eslintrc*' -o -name 'eslint.config.*' \)find . -path '*/.claude/settings.json' -maxdepth 3 -type ffind . -maxdepth 2 -type d -name 'scripts'| Flag | Default | Description |
|---|---|---|
--remote-only | off | Wrap script in CLAUDE_CODE_REMOTE guard — hook exits immediately in local sessions |
--no-verify | off | Skip test/linter verification step in the generated script |
Identify all languages and tooling from the values in Context.
Language detection:
| File Present | Language | Package Manager (from lockfile) |
|---|---|---|
package.json | Node.js | npm (package-lock.json), yarn (yarn.lock), pnpm (pnpm-lock.yaml), bun (bun.lockb) |
pyproject.toml | Python | poetry (poetry.lock), uv (uv.lock), pip (fallback) |
requirements.txt | Python | pip |
Cargo.toml | Rust | cargo |
go.mod | Go | go modules |
Gemfile | Ruby | bundler |
pom.xml | Java | maven |
build.gradle* | Java/Kotlin | gradle |
Test runner detection:
| Language | How to Detect | Test Command |
|---|---|---|
| Node.js | scripts.test in package.json | npm test / bun test / etc. |
| Python | [tool.pytest] in pyproject.toml, or pytest in deps | pytest |
| Rust | always available | cargo test |
| Go | always available | go test ./... |
| Ruby | Gemfile contains rspec or minitest | bundle exec rspec / bundle exec rake test |
| Java | pom.xml / build.gradle | mvn test / gradle test |
Linter detection:
| Config File | Linter | Command |
|---|---|---|
biome.json / biome.jsonc | Biome | npx biome check . |
.eslintrc* / eslint.config.* | ESLint | npx eslint . |
[tool.ruff] in pyproject.toml | Ruff | ruff check . |
Cargo.toml | Clippy | cargo clippy |
Report detected stack to user before generating.
Create the script at scripts/claude-session-start.sh (or .claude/hooks/session-start.sh if no scripts/ directory exists).
Use the Script Template from REFERENCE.md. Adapt it by:
.claude/settings.jsonRead existing .claude/settings.json if it exists. Merge the SessionStart hook — preserve all existing configuration.
If a SessionStart hook already exists, ask the user whether to:
Configuration to merge:
{
"hooks": {
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR/scripts/claude-session-start.sh\"",
"timeout": 120
}
]
}
]
}
}
Use timeout: 120 (2 minutes) for dependency installation. Adjust path if script is in .claude/hooks/ instead of scripts/.
chmod +x <script-path>.claude/ directory if needed for settings.jsonRun the generated script locally to confirm it executes without errors. Report results.
After generating the hook:
scripts/claude-session-start.sh
.claude/settings.json
--remote-only was NOT used, mention the flag for web-only behaviormatcher options: "startup" (new sessions), "resume" (resumed), "" (all events)| Matcher | Fires When |
|---|---|
"startup" | New session starts |
"resume" | Session is resumed |
"clear" | After /clear command |
"compact" | After context compaction |
"" (empty) | All SessionStart events |
| Context | Approach |
|---|---|
| Quick setup, skip verification | /hooks:session-start-hook --remote-only --no-verify |
| Full setup with verification | /hooks:session-start-hook |
| Web-only with tests | /hooks:session-start-hook --remote-only |
| Dependency install commands | Use --frozen-lockfile / ci variants for reproducibility |
| Test verification | Use --bail=1 / -x for fast failure |
| Linter verification | Use --max-diagnostics=0 / --quiet for pass/fail only |
| Item | Value |
|---|---|
| Script location | scripts/claude-session-start.sh or .claude/hooks/session-start.sh |
| Settings location | .claude/settings.json |
| Timeout | 120 seconds (adjustable) |
| Output format | JSON with hookSpecificOutput.additionalContext |
| Environment persistence | Via CLAUDE_ENV_FILE |
| Remote detection | CLAUDE_CODE_REMOTE=true |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
session-start, hook-generation, repo-setup, dependency-install
4 skills in this plugin
/hooks-configurationClaude Code hooks configuration and development. Use when the user mentions hooks, PreToolUse, PostToolUse, SessionStart, SubagentStart, PermissionRequest, or TaskCompleted./hooks-permission-request-hookGenerate a PermissionRequest hook with auto-approve/deny rules. Use when needing a safer alternative to --dangerouslySkipPermissions tailored to your project stack./hooks-session-end-issue-hookConfigure a Stop hook that surfaces unfinished todos at session end. Use when you want deferred work automatically flagged for GitHub issue creation.npx claudepluginhub laurigates/claude-plugins --plugin hooks-pluginOther plugins' skills for the same job