Repository navigation
Description
Problem or Motivation
Claude Code cloud sessions (claude.ai/code) and the Copilot coding agent install no git hooks. Their commits and pushes thus skip every hook, and they will also skip the push gate of #4670.
- The end-of-file defect on
main(openspec/changes/archive/2026-11-02-3249-title-limit-round3/specs/roadmap-stage/spec.md, from 707775f in fix(roadmap): count the title summary like the CI check #3286) came from plan commit 54ccd34 of a claude.ai/code session. The file ends with two newlines today. - 16 commits since 2026-10-28 have a
Claude-Sessiontrailer. .github/workflows/copilot-setup-steps.ymlhas nopre-commit installstep.- Only the devcontainer installs the hooks, at each start (
src/devops_cli/commands/devcontainer.py).
Proposed Solution & Architectural Design
Claude Code. Add a SessionStart hook (matcher startup|resume) to .claude/settings.json and to src/devops_cli/templates/claude_settings.json.j2.
- The hook exits 0 when
CLAUDE_CODE_REMOTEis nottrue. This is the documented variable of a cloud session. The devcontainer already installs the hooks. - The hook exits 0 when
uvor.pre-commit-config.yamlis missing. - Else it runs
cd "$CLAUDE_PROJECT_DIR" && uv run pre-commit install.
Copilot. Add one step uv run pre-commit install after the tool install in copilot-setup-steps.yml. #4681 also changes this file.
Both are standard interfaces, and they block nothing.
Target Subsystem
AI agent harness settings (.claude/settings.json, src/devops_cli/templates/claude_settings.json.j2) and .github/workflows/copilot-setup-steps.yml.
Existing Tool Considered
Claude Code SessionStart hooks and pre-commit install. The Claude Code docs (code.claude.com/docs/en/cloud-environments) say that the SessionStart hooks of the repository run in local and cloud sessions, that pypi.org is in the Limited allow list, and that uv is installed. The change is configuration only. Cost (estimate): about 50,000 tokens and 1 hour to build, near 0 to keep.
Acceptance Criteria
- A test renders the template and finds the hook.
- In a temporary clone, the hook command with
CLAUDE_CODE_REMOTE=truewrites.git/hooks/pre-commitand.git/hooks/pre-push. When the variable is not set, it writes nothing and exits 0. - actionlint and zizmor pass on
copilot-setup-steps.yml. - In the 14 days after the merge, 0 commits on
mainwith aClaude-Sessiontrailer failpre-commit run --fileson their changed files.
Dependencies
None. Related: #4670 (the push hook that these sessions then run), #4681.
Source: #4771
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(agents)scope of the title gives the scope.It closes a quality gap on remote sessions but does not block a release or fix a live defect.It prevents unvalidated commits from remote agents reaching main, as shown by the cited end-of-file defect.The change is two configuration edits and one workflow step, estimated at one hour.Both ensure pre-commit is available, but #66 targets the devcontainer while the candidate targets remote cloud agent sessions.devops-cli-service commentedon Nov 12, 2026
Released in v0.120.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.120.0
devops-cli-service commentedon Nov 12, 2026
Live since 2026-11-12 16:17 UTC