Skip to content

Commit d15e8a6

Browse files
committed
ci: SessionStart hook to auto-provision Agda toolchain on the web
Adds .claude/hooks/session-start.sh (+ .claude/settings.json registration) so Claude Code on the web auto-runs the idempotent scripts/provision-agda.sh at session start, making 'agda proofs/agda/All.agda' / Smoke.agda typecheck without manual setup. Web-only (guards on CLAUDE_CODE_REMOTE); synchronous so the toolchain is ready before the agent loop. .gitignore: switch '.claude/' to '.claude/*' with negations so the shared hook + settings are tracked while personal Claude config stays ignored. https://claude.ai/code/session_01VwbFNQJw23tW8tqM7utWku
1 parent 9edb6e3 commit d15e8a6

3 files changed

Lines changed: 34 additions & 1 deletion

File tree

.claude/hooks/session-start.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: MPL-2.0
3+
# SessionStart hook: provision the Agda proof-checker toolchain so Claude Code
4+
# on the web can typecheck this repo (agda proofs/agda/All.agda, Smoke.agda).
5+
#
6+
# Thin wrapper around scripts/provision-agda.sh (idempotent). Web-only; local
7+
# developers manage their own toolchain. Synchronous so the toolchain is ready
8+
# before the agent loop starts.
9+
set -euo pipefail
10+
11+
# Only provision in the remote (web) environment.
12+
if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
13+
exit 0
14+
fi
15+
16+
exec bash "${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}/scripts/provision-agda.sh"

.claude/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"hooks": [
6+
{
7+
"type": "command",
8+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh"
9+
}
10+
]
11+
}
12+
]
13+
}
14+
}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
*.agdai
22
_build/
3-
.claude/
3+
# Ignore personal Claude config but share the SessionStart toolchain hook.
4+
.claude/*
5+
!.claude/hooks/
6+
!.claude/settings.json
47
.agda/
58

69
# direnv / nix local cache

0 commit comments

Comments
 (0)