startup-hook-skill

startup-hook-skill is a skill for Claude Code from asgeirtj/system_prompts_leaks. It costs 52 tokens per session (1,940 once invoked), scanned B, original, CC0-1.0.

A startup-hook workflow for Claude Code on the web. A startup hook is a script that runs when a remote coding session begins, allowing the repository to prepare its environment before work continues.

In plain words
What is it for?
Use it to create a SessionStart hook that installs project dependencies, prepares test and lint commands, and persists environment settings for the session. It can distinguish remote web sessions from other ways a session starts.
Why use it?
It prevents web sessions from starting without installed dependencies or the environment variables needed by tests and linters. It also documents the trade-off when setup runs in the background and may not finish before the agent starts using it.

Skill for Claude Code

Written for Claude Code: $CLAUDE_PROJECT_DIR variable. Also seen: reads .claude/ paths; mentions Claude Code.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is CLAUDE_CODE_REMOTE=true ./.claude/hooks/session-start.sh.

Good fit Use it to create a SessionStart hook that installs project dependencies, prepares test and lint commands, and persists environment settings for the session. It can distinguish remote web sessions from other ways a session starts.

Compare 6 skills from other repositories ↓
About the project

System Prompts Leaks is a collection of captured system instructions used to guide AI chatbots and coding agents before they receive user messages. It serves researchers and developers studying how different AI assistants are directed.

asgeirtj/system_prompts_leaks · 73,683 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/asgeirtj/system_prompts_leaks
agentmods
npx agentmods add skills/asgeirtj/system_prompts_leaks/session-start-hook

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for startup-hook-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/asgeirtj/system_prompts_leaks/session-start-hook/github.svg)](https://agentmods.dev/skills/asgeirtj/system_prompts_leaks/session-start-hook)
Your own site
<a href="https://agentmods.dev/skills/asgeirtj/system_prompts_leaks/session-start-hook"><img src="https://agentmods.dev/badge/skills/asgeirtj/system_prompts_leaks/session-start-hook/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for startup-hook-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/asgeirtj/system_prompts_leaks/session-start-hook"><img src="https://agentmods.dev/badge/skills/asgeirtj/system_prompts_leaks/session-start-hook.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,940 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.01940
Opus 5.5 $0.00021 $0.00776
Sonnet 5.5 $0.00010 $0.00388
Haiku 4.5 $0.00005 $0.00194

Measured 15d ago against content hash a7ea9670135d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

startup-hook-skill scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat > .claude/hooks/session-start.sh << 'EOF'
Anthropic/claude-code/skills/session-start-hook/SKILL.md · 186 lines

How it starts

The opening of the file, as written. The whole thing — 186 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Startup Hook Skill for Claude Code cloud sessions

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

If the user asked to set up an environment rather than for a hook, stop here and commit nothing.
Use get_environment, then create_environment or update_environment as it says, if you have them.
Otherwise tell the user to set it up in the environment's settings.

Hook Basics

Input (via stdin)

{
  "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

#!/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. a Claude Code cloud session)

Use $CLAUDE_ENV_FILE to persist variables for the session:

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

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

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

Read the full file on GitHub · 186 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 15d ago Changed · +32 lines a7ea9670135d
  2. 2mo ago First seen · 154 lines · 52 tokens per session scan B 7f4d1f07db82

Subscribe to this mod's changes

startup-hook-skill is a skill published in the GitHub repository asgeirtj/system_prompts_leaks (73,683 stars, last pushed yesterday), licensed CC0-1.0. It adds 52 tokens to every session and 1,940 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-01.

Related

startup-hook-skill compared with skills from other repositories

startup-hook-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
startup-hook-skillasgeirtj/system_prompts_leaksSkill74kyesterdayCC0-1.0B52Claude Code
mapsNousResearch/hermes-agentSkill267ktodayMITA20Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14ktodayCC0-1.0A113Claude Code, Codex