Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .claude/hooks/session-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# SessionStart hook for Claude Code on the web: bootstrap Aikido Safe Chain and
# install dependencies through its shims, as .devcontainer and .cursor do.
#
# Hook stdout is injected into the session, so the install log goes to stderr.
# Shim PATH is written by setup-cloud-environment.sh before that script can fail
# (CLAUDE_ENV_FILE). Do not append it here after the bootstrap: a failed hook
# would then leave the package managers unshimmed.
set -euo pipefail

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

cd "$CLAUDE_PROJECT_DIR"

bash ./scripts/setup-cloud-environment.sh >&2
15 changes: 15 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"SessionStart": [
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude compaction from the bootstrap hook

This group has no matcher, so Claude runs the full bootstrap after each remote-session compaction, not only when the VM starts. Claude lists compact as a SessionStart source and says to keep these hooks fast (SessionStart documentation). The script downloads the installer and runs pnpm install, so long sessions can pause for up to 600 seconds at each automatic compaction. Add a matcher that excludes compact, or make this path return quickly after successful setup.

Useful? React with 👍 / 👎.

"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/session-start.sh",
"timeout": 600
}
]
}
]
}
}
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "Node.js",
"image": "mcr.microsoft.com/devcontainers/javascript-node:5.2.1-24-trixie@sha256:7a81958053c4e3b5b20fa122f7a422d32dd0eebe87a6726f7b14483585ea60fd",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:4": {
"moby": false
}
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ out
# Lock Files
yarn.lock

# AI
.claude
# AI (keep the shared Claude Code settings and hooks; ignore local state)
.claude/*
!.claude/settings.json
!.claude/hooks/

# Dist
dist
Expand Down
4 changes: 2 additions & 2 deletions DEFENSE_IN_DEPTH.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Profile: npm library · public
- [x] `DEFENSE_IN_DEPTH.md` present (this file) — PR #1698

## 2. CODEOWNERS and cloud bootstrap
- [ ] `.github/CODEOWNERS` covers `/.github/`, `/.vscode/`, `/.cursor/`, `/.devcontainer/`, `/.claude/`, `/.codex/`, `/scripts/` with owners the maintainer names (PR #1734 pending)
- [ ] Codespaces, Cursor Cloud Agents, and Claude Code on the web bootstrap Aikido Safe Chain via scripts/setup-cloud-environment.sh (--ci shims, frozen lockfile); Claude Code runs it from `.claude/hooks/session-start.sh` (web sessions only, install log on stderr, 600s timeout) and `.gitignore` keeps `.claude/settings.json` and `.claude/hooks/` tracked
- [x] `.github/CODEOWNERS` covers `/.github/`, `/.vscode/`, `/.cursor/`, `/.devcontainer/`, `/.claude/`, `/.codex/`, `/scripts/` with owners the maintainer names — PR #1734
- [ ] Codespaces, Cursor Cloud Agents, and Claude Code on the web bootstrap Aikido Safe Chain via scripts/setup-cloud-environment.sh (--ci shims, frozen lockfile); Claude Code runs it from `.claude/hooks/session-start.sh` (web sessions only, install log on stderr, 600s timeout) and `.gitignore` keeps `.claude/settings.json` and `.claude/hooks/` tracked (PR #1735 pending)
- [ ] Codex cloud environments use Manual setup with `bash ./scripts/setup-cloud-environment.sh` as the setup and maintenance script (manual)
- [ ] Claude Code on the web environments allow `malware-list.aikido.dev` (Custom network access plus the default package-manager list) (manual)
- [x] Dev Container `image` pinned by digest (`name:<tag>@sha256:<digest>`; not a floating tag) — PR #1718
Expand Down
Loading