본문으로 건너뛰기
cccskills
무료GitHub에 공개

session-start-hook

Prepare a repository for Claude Code on the web by creating a startup hook that installs project dependencies. Register the hook and check that it runs successfully, along with a sample test and code quality check.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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.

설치 방법 보기

이럴 때 유용합니다

  • Prepare a repository for Claude Code on the web
  • Install dependencies when a web session starts
  • Check that tests and code quality tools can run
  • Configure environment variables for web sessions

포함된 파일(1)

  • SKILL.md4.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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)

{
  "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. Claude code on the web)

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

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

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):

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

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.

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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

3d-object

무료

Create a 3D object with three.js, inspect it from every angle in an interactive viewer, and download it as OBJ + MTL or GLB for use in other 3D applications.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Create a 3D object and inspect it from every angle
  • Export a model for further editing in Blender
  • Review an object's silhouette and materials
asgeirtj/system_prompts_leaks7만2026년 10월 16일 업데이트

Maintain a private task list with deadlines, next steps, waiting parties, and blockers. Update progress and dependencies, merge duplicate items, and archive closed tasks so ongoing commitments stay clear and easy to follow.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Record tasks and commitments with deadlines
  • Track pending replies and reasons work cannot proceed
  • Update task dependencies when prerequisites are completed
asgeirtj/system_prompts_leaks7만2026년 10월 16일 업데이트

agents

무료

Coordinate a task from a verifiable goal through completion. Handle work directly or split independent tasks across separate agent sessions, track progress, verify results, and arrange pull request merging when included in the goal.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Split independent tasks across agents
  • Check progress across ongoing tasks
  • Resume a previously started project
asgeirtj/system_prompts_leaks7만2026년 10월 16일 업데이트

Create animated HTML pages with smooth scene transitions and playback controls. An editable timeline lets users adjust scene lengths and speeds, with fixed landscape or portrait layouts prepared for video export.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Create an animated product walkthrough
  • Explain a message through moving text and graphics
  • Build a portrait animation for video export
asgeirtj/system_prompts_leaks7만2026년 10월 16일 업데이트

Review synced Apple Health records, including steps, heart rate, sleep, and workouts. Retrieve daily summaries or detailed samples for a chosen period, and check sync status and missing data before interpreting the results.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Review daily steps and heart rate over time
  • Check sleep stages, duration, and awakenings
  • Review workout duration, distance, and calories
asgeirtj/system_prompts_leaks7만2026년 10월 16일 업데이트

Create and edit Word documents and templates, reorganize text, replace images, and work with tracked changes or comments. Apply proper headings and lists, then render every page to check its appearance before delivery.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Create a structured Word document
  • Reorganize content in an existing document
  • Replace images or text in a document
asgeirtj/system_prompts_leaks7만2026년 10월 16일 업데이트

asgeirtj의 스킬 모두 보기

이 스킬의 문제 신고