Skip to content

ADR-0014: the Claude Code action runs issue sessions - #171

Open
Hafeok wants to merge 6 commits into
mainfrom
claude/claude-code-issue-sessions-3d7pmw
Open

Hafeok wants to merge 6 commits into
mainfrom
claude/claude-code-issue-sessions-3d7pmw

Conversation

@Hafeok

@Hafeok Hafeok commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Refs #170. This implements the plan, as approved with its answers and additions.

This PR changes a workflow, so it was written in a normal key-holding session, not by the action.

What changes

  • ADR-0014, Proposed, admits anthropics/claude-code-action@c0949c50a78c1ec8ce2647db36629b870e715d0c # v1.0.268.
    • Triggers: a run starts only from Hafeok, either the claude label or an issue comment starting @claude, and it also passes the action's own write-access check. Comments on pull requests don't start a run.
    • Signing: commits are signed with AGENT_SSH_SIGNING_KEY. bot_id/bot_name are 2194785/Hafeok, and the author and committer are set to Claude (Emil).
    • Authentication: CLAUDE_CODE_OAUTH_TOKEN, with the job token for GitHub, so there is no id-token permission.
    • Phases: a run plans first. A @claude comment revises the plan, @claude approved approves the newest one, and the run treats only text from Hafeok as instructions.
    • Limits: 180 minutes, one run per issue, three permissions, and no workflows permission.
    • Model names: Claude Code's default commit trailer names the model, per its settings reference. "attribution": { "commit": "", "pr": "" } turns it off, and no --model is passed.
  • .github/workflows/claude.yml, as the ADR states it. Run instructions go through --append-system-prompt, because a prompt input would switch the action out of tag mode.
  • claude-workflow, a new gate in gates.yml (eng/gates/claude-workflow.sh). selftest plants 14 cases, the brief's three among them, and each fails with its own finding.
  • AGENTS.md gains an "Issue sessions" section and a row in the gates table.
  • releases/v0.8.0-preview.3.yaml, with accepted-by left for Emil, and <Version> raised to 0.8.0-preview.3.
  • The record, docs/traceability/2026-11-06-issue-170-issue-sessions.md.

Checks

  • Each commit on its own, in a clean worktree: commits, adr-shape, adr-text, no-toolchain, claude-workflow (from the commit that adds it) and selftest all pass.
  • At 6c7965c: the build has 0 errors, and 43 tests pass. The linux-x64 AOT publish and smoke pass: product 0.8.0-preview.3 (commit 6c7965c…).
  • Signatures: GitHub reports every commit verified, attributed to Hafeok, under Claude (Emil) <claude+emil@okkels-klein.dk>.

For Emil

  • Before the first run: add the two secrets.
  • For every run: a run's pushes use the job token, which starts no workflow. Open each run's PR from the link the run posts, close and reopen it after a later push, and check that gates.yml ran on the head before approving.
  • The required checks: add claude-workflow to main's required checks if you want it required.
  • If Step 1: pin sdlc: edition 1, the lift ADR and the lift map #169 lands first: this PR takes the next free ADR number and preview version, and the record notes it.

Generated by Claude Code

Proposed. Admits anthropics/claude-code-action at v1.0.268, pinned by
SHA; runs start only from Hafeok's label or @claude comment on an issue,
behind the action's own write-access check; commits are signed with the
agent key as Claude (Emil), with Claude Code's attribution off; the
OAuth token, not an API key; plan first, revisions, and approval of the
newest plan; one repository, 180 minutes, one run per issue, no
workflows permission. The job token starts no gates, so Emil opens the
pull request and checks the gates ran on its head.

Refs #170

Signed-off-by: Emil Okkels Klein <emil@okkels-klein.dk>
Claude-Session: https://claude.ai/code/session_01NbWSYRYCm8wULG3wF2NvgE
Triggered by issues: labeled and issue_comment: created, with the job's
if: requiring Hafeok as the label's sender or the comment's author, a
comment on an issue, and the @claude prefix. Checkout and setup-dotnet
at the SHAs gates.yml pins; the action at c0949c50 (v1.0.268) in tag
mode, with the run's rules appended to its system prompt.

Refs #170

Signed-off-by: Emil Okkels Klein <emil@okkels-klein.dk>
Claude-Session: https://claude.ai/code/session_01NbWSYRYCm8wULG3wF2NvgE
eng/gates/claude-workflow.sh fails when claude.yml departs from
ADR-0014 D1 to D7. selftest plants an action pinned to a tag, a SHA
with no version, workflows: write, id-token: write, a job's own
permissions, each missing actor check, a check present only in a
comment, pull request comments admitted, a pull_request_target trigger,
allowed_bots, a prompt input, attribution left on, and no timeout.
Each fails with its finding; the clean file passes.

Refs #170

Signed-off-by: Emil Okkels Klein <emil@okkels-klein.dk>
Claude-Session: https://claude.ai/code/session_01NbWSYRYCm8wULG3wF2NvgE
How to start a run (the label, revisions, @claude approved, opening the
pull request and checking its gates), what a run may do, untrusted
issue text, and which issues must not get the label.

Refs #170

Signed-off-by: Emil Okkels Klein <emil@okkels-klein.dk>
Claude-Session: https://claude.ai/code/session_01NbWSYRYCm8wULG3wF2NvgE
The descriptor for ADR-0014 and claude.yml, with accepted-by left for
Emil, and the host's version to match. If #169 lands first, this
descriptor and the version are renumbered, as the ADR is.

Refs #170

Signed-off-by: Emil Okkels Klein <emil@okkels-klein.dk>
Claude-Session: https://claude.ai/code/session_01NbWSYRYCm8wULG3wF2NvgE
The brief and the approval, verbatim; what was read, at the action's
pinned commit; what the session found in the action's source and in
Claude Code's settings reference; the commits with GitHub's
verification under the Claude (Emil) identity; every commit checked on
its own; the build, tests and smoke at the head; the plants' findings;
and the deviations from the plan, with their reasons.

Refs #170

Signed-off-by: Emil Okkels Klein <emil@okkels-klein.dk>
Claude-Session: https://claude.ai/code/session_01NbWSYRYCm8wULG3wF2NvgE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant