Files
astral-sh-uv/scripts/hooks/session-start-web.sh
T
Zanie Blue 1c5cab0e58 Share Claude and Codex hook scripts (#19755)
## Summary

- add repo-local Codex hooks matching the existing Claude hooks
- move the hook implementations into `scripts/hooks` so both agents
share one implementation
- handle Codex `apply_patch` payloads in the post-edit formatter
- keep other repo-local `.codex` state ignored while tracking
`.codex/hooks.json`

## Validation

- `python3 -m json.tool .claude/settings.json`
- `python3 -m json.tool .codex/hooks.json`
- `bash -n scripts/hooks/session-start.sh`
- `bash -n scripts/hooks/session-start-web.sh`
- exercised `uv run scripts/hooks/post-edit-format.py` with Claude
`Write` and Codex `apply_patch` payloads
2026-06-09 17:39:08 +00:00

17 lines
411 B
Bash

#!/bin/bash
set -euo pipefail
# Install `gh`
if ! command -v gh &> /dev/null; then
apt-get update -qq
apt-get install -y -qq gh
fi
# Install clippy and rustfmt for the active toolchain.
rustup component add clippy rustfmt
# Set GH_REPO so `gh` works even when the git remote points to a local proxy
if [ -n "${CLAUDE_ENV_FILE:-}" ]; then
echo 'export GH_REPO=astral-sh/uv' >> "$CLAUDE_ENV_FILE"
fi