Agent skill

Session Start Hook

by asgeirtj in asgeirtj/system_prompts_leaks

Creating and developing startup hooks for Claude Code on the web.

CC0-1.0Auto-check passedDevelopment

Install Session Start Hook

skills CLI
$ npx skills add asgeirtj/system_prompts_leaks --skill session-start-hook -a claude-code

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

GitHub CLI
$ gh skill install asgeirtj/system_prompts_leaks session-start-hook --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/asgeirtj/system_prompts_leaks.git skills-src && mkdir -p .claude/skills && cp -r skills-src/Anthropic/claude-code/skills/session-start-hook .claude/skills/session-start-hook && 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
session-start-hook
GitHub stars
69k
Used in
1 other repo
Token cost
~1.2k tokens
SKILL.md length
541 words
Files
1
Skills in repo
121
Repo updated
First seen
Licence
CC0-1.0

At a glance

Creating and developing startup hooks for Claude Code on the web.

  • Works in 8 steps: Analyze Dependencies → Design Hook → Create Hook File → …
  • The user wants to set up a repository for Claude Code on the web
  • SKILL.md covers Hook Basics, Workflow and Wrap up
  • Calls npm

What it does

Session Start Hook is an agent skill from asgeirtj/system_prompts_leaks. Creating and developing startup hooks for Claude Code on the web. Use when the user wants to set up a repository for Claude Code on the web, create a SessionStart hook to ensure their project can run tests and linters during web sessions.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Linting and formatting. It works with npm. The repository describes itself as: Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro… The licence is CC0-1.0.

When your agent uses it

  • The user wants to set up a repository for Claude Code on the web
  • Create a SessionStart hook to ensure their project can run tests and linters during web sessions

Example prompts

  • “/session-start-hook”

Requirements

  • Node.js

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Analyze Dependencies
  2. Design Hook
  3. Create Hook File
  4. Register in Settings
  5. Validate Hook
  6. Validate Linter
  7. Validate Test
  8. Commit and push

What it can do on your machine

Read from SKILL.md and the folder at commit dd45aa5. 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

    Shell commands in SKILL.md call:

    • npm

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

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

Context cost

Session Start Hook loads about 1.2k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 541 words of instructions outside code blocks.

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

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

The full file from asgeirtj/system_prompts_leaks at commit dd45aa5, republished under its CC0-1.0 licence (© asgeirtj). 541 words, ~1,226 tokens.

Download SKILL.mdSave it as .claude/skills/session-start-hook/SKILL.md (or your agent's skills folder).
name
session-start-hook
description
Creating and developing startup hooks for Claude Code on the web. Use when the user wants to set up a repository for Claude Code on the web, create a SessionStart hook to ensure their project can run tests and linters during web sessions.

Startup Hook Skill for Claude Code on the web

Create SessionStart hooks that install dependencies so tests and linters work in Claude Code on the web sessions.

Hook Basics

Input (via stdin)
json
{
  "session_id": "abc123",
  "source": "startup|resume|clear|compact",
  "transcript_path": "/path/to/transcript.jsonl",
  "permission_mode": "default",
  "hook_event_name": "SessionStart",
  "cwd": "/workspace/repo"
}
Async Mode
bash
#!/bin/bash
set -euo pipefail

echo '{"async": true, "asyncTimeout": 300000}'

npm install

The hook runs in background while the session starts. Using async mode reduces latency, but introduces a race condition where the agent loop might depend on something that is being done in the startup hook before it completed.

Environment Variables

Available environment variables:

  • $CLAUDE_PROJECT_DIR - Repository root path
  • $CLAUDE_ENV_FILE - Path to write environment variables
  • $CLAUDE_CODE_REMOTE - If running in a remote environment (i.e. Claude code on the web)

Use $CLAUDE_ENV_FILE to persist variables for the session:

bash
echo 'export PYTHONPATH="."' >> "$CLAUDE_ENV_FILE"

Use $CLAUDE_CODE_REMOTE to only run a script in a remote env:

bash
if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
  exit 0
fi

Workflow

Make a todo list for all the tasks in this workflow and work on them one after another

1. Analyze Dependencies

Find dependency manifests and analyze them. Examples:

  • package.json / package-lock.json → npm
  • pyproject.toml / requirements.txt → pip/Poetry
  • Cargo.toml → cargo
  • go.mod → go
  • Gemfile → bundler

Additionally, read though any documentation (i.e. README.md or similar) to see if you can get additional context on how the environment setup works

2. Design Hook

Create a script that installs dependencies.

Key principles:

  • Don't use async mode in the first iteration. Only switch to it if the user asks for it
  • Write the hook only for the web unless user asks otherwise (see $CLAUDE_CODE_REMOTE)
  • The container state gets cached after the hook completes, prefer dependency install methods that take advantage of that (i.e. prefer npm install over npm ci)
  • Be idempotent (safe to run multiple times)
  • Non-interactive (no user input)
3. Create Hook File
bash
mkdir -p .claude/hooks
cat > .claude/hooks/session-start.sh << 'EOF'
#!/bin/bash
set -euo pipefail

echo '{"async": true, "asyncTimeout": 300000}'
# Install dependencies here
EOF

chmod +x .claude/hooks/session-start.sh
4. Register in Settings

Add to .claude/settings.json (create if doesn't exist):

json
{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
          }
        ]
      }
    ]
  }
}

If .claude/settings.json exists, merge the hooks configuration.

5. Validate Hook

Run the hook script directly:

bash
CLAUDE_CODE_REMOTE=true ./.claude/hooks/session-start.sh

IMPORTANT: Verify dependencies are installed and script completes successfully.

6. Validate Linter

IMPORTANT: Figure out what the right command is to run the linters and run it for an example file. No need to lint the whole project. If there are any issues, update the startup script accordingly and re-test.

Show full SKILL.md (200 more words)Show less
7. Validate Test

IMPORTANT: Figure out what the right command is to run the tests and run it for one test. No need to run the whole test suite. If there are any issues, update the startup script accordingly and re-test.

8. Commit and push

Make a commit and push it to the remote branch

Wrap up

We're all done. In your last message to the user, Provide a detailed summary to the user with the format below:

  • Summary of the changes made
  • Validation results
    1. ✅/‼️ Session hook execution (include details if it failed)
    2. ✅/‼️ linter execution (include details if it failed)
    3. ✅/‼️ test execution (include details if it failed)
  • Hook execution mode: Syncronous
    • inform user that hook is running syncronous and the below trade-offs. Let them know that we can change it to async if they prefer faster session startup.
      • Pros: Guarantees dependencies are installed before your session starts, preventing race conditions where Claude might try to run tests or linters before they're ready
      • Cons: Your remote session will only start once the session start hook is completed
  • inform user that once they merge the session start hook into their repo's default branch, all future sessions will use it.

© asgeirtj, CC0-1.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in Anthropic/claude-code/skills/session-start-hook of asgeirtj/system_prompts_leaks.

Open the folder on GitHubat commit dd45aa5

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in asgeirtj/system_prompts_leaks, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Session Start Hook 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.

Session Start Hook compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Session Start Hook this skillasgeirtj/system_prompts_leaks69k1 repos~1.2kAutomated safety check: PassCC0-1.0
Install Anti-Slop Oxlint Rulesdmmulroy/anti-slop5.3k1 repos~2.2kAutomated safety check: PassMIT
Setup Pre Commitfossasia/eventyay-interpretation1.6k13 repos~565Automated safety check: PassApache-2.0
Releasehyhmrright/brooks-lint1.5k—~1.2kAutomated safety check: PassMIT
Prepare Rslint npm Releaseweb-infra-dev/rslint460—~1.5kAutomated safety check: PassMIT
Create Saleor Packagesaleor/apps162—~608Automated safety check: PassCustom licence

Similar skills

  • Installs, updates or migrates the vendored anti-slop Oxlint plugin in a repository, keeping local rule changes and the plugin's license and provenance files.

    5.3k GitHub starsUsed in 1 repo~2.2k tokens
    DevelopmentAuto-check passed
  • Setup Pre Commit

    fossasia/eventyay-interpretation

    Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo.

    1.6k GitHub starsUsed in 13 repos~565 tokens
    DevelopmentAuto-check passed
  • Release

    hyhmrright/brooks-lint

    Cut a brooks-lint release: set the version in package.json, propagate it across all four plugin manifests and every version-bearing text file (README badges, docs site metadata), write the CHANGELOG…

    1.5k GitHub stars~1.2k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Prepare Rslint npm Release

    web-infra-dev/rslint

    Prepare a stable release PR for the unified rslint npm packages by updating package versions and rule/TypeScript release metadata.

    460 GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Scaffold a new shared package in the saleor-apps monorepo under ./packages/.

    162 GitHub stars~608 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Dev

    Automattic/wordpress-activitypub

    Development workflows for WordPress ActivityPub plugin including wp-env setup, testing commands, linting, and build processes.

    582 GitHub stars~1.1k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from asgeirtj/system_prompts_leaks

All 121 skills in this repo
  • Fleet Manager for Agent Sessions

    asgeirtj/system_prompts_leaks

    Shows one digest of coding-agent sessions across your connected machines and lets you open, read, steer, approve, stop and close them, over Herdr, tmux or MSP.

    69k GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Muse Code Product Doctor

    asgeirtj/system_prompts_leaks

    Diagnoses a Muse Code installation's own failures from binary and session evidence, instead of treating the report as an ordinary repository bug.

    69k GitHub stars~3.5k tokensUpdated yesterday
    Auto-check passed
  • Agents Project Coordinator

    asgeirtj/system_prompts_leaks

    Runs a goal as a project in which the agent coordinates separate agent threads, judging when to split the work, and interviews you first when nothing can be verified.

    69k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Muse Plugin Creator

    asgeirtj/system_prompts_leaks

    Creates and validates a new native Muse plugin package in the current workspace, limited to five capability families, and leaves installation to you.

    69k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Figma Design Inspector

    asgeirtj/system_prompts_leaks

    Inspects Figma designs through the figma CLI and Figma's MCP server to read variants, spacing, tokens and layouts and to extract assets for implementation.

    69k GitHub stars~936 tokensUpdated yesterday
    Auto-check passed
  • Morning Brief Renderer

    asgeirtj/system_prompts_leaks

    Renders a calm, single-page HTML morning brief from your connected calendar, email and chat, or sets it up to run automatically on weekdays.

    69k GitHub stars~4.5k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Session Start Hook

What does Session Start Hook do?

Creating and developing startup hooks for Claude Code on the web. Session Start Hook is an agent skill from asgeirtj/system_prompts_leaks. Creating and developing startup hooks for Claude Code on the web.

When should I use Session Start Hook?

Session Start Hook fits situations like: the user wants to set up a repository for Claude Code on the web; create a SessionStart hook to ensure their project can run tests and linters during web sessions.

How do I install Session Start Hook in Claude Code?

Run `npx skills add asgeirtj/system_prompts_leaks --skill session-start-hook -a claude-code`. Or copy the skill folder (Anthropic/claude-code/skills/session-start-hook in asgeirtj/system_prompts_leaks) into .claude/skills/session-start-hook in your project. Claude Code loads it when a task matches its description.

How do I install Session Start Hook in Codex?

Run `npx skills add asgeirtj/system_prompts_leaks --skill session-start-hook -a codex`. Or copy the skill folder (Anthropic/claude-code/skills/session-start-hook in asgeirtj/system_prompts_leaks) into .agents/skills/session-start-hook in your project. Codex loads it when a task matches its description.

Can I use Session Start Hook 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 asgeirtj/system_prompts_leaks --skill session-start-hook -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/session-start-hook, .gemini/skills/session-start-hook, .github/skills/session-start-hook and .opencode/skills/session-start-hook in your project.

What does Session Start Hook need to run?

Going by SKILL.md and its folder, Session Start Hook needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does Session Start Hook access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Session Start Hook 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 Session Start Hook use?

Session Start Hook is published under the CC0-1.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Session Start Hook use?

About 1.2k tokens (SKILL.md is roughly 4.9k 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 Session Start Hook?

Skills that share tags, products or a category with Session Start Hook: Install Anti-Slop Oxlint Rules (dmmulroy/anti-slop, 5.3k stars), Setup Pre Commit (fossasia/eventyay-interpretation, 1.6k stars), Release (hyhmrright/brooks-lint, 1.5k stars) and Prepare Rslint npm Release (web-infra-dev/rslint, 460 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Session Start Hook?

asgeirtj (a GitHub user) maintains it in asgeirtj/system_prompts_leaks, which has 69,095 GitHub stars. The repository holds 121 skills in this directory. The repository was last updated on October 7, 2026.

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