Skip to content

claude-wake

claude-wake #16

Workflow file for this run

# Wake workflow for Sigma at home (cn-sigma).
#
# Trigger: opening an issue whose title contains "claude-wake", and four
# scheduled crons at :12 :27 :42 :57 (staggered against cnos's :08 :23
# :38 :53 so the two wakes don't race the channel and no two bodies
# fire the same minute — combined ~7.5 min effective cadence at the
# channel level).
#
# Authority: CLAUDE_CODE_OAUTH_TOKEN (operator's Claude Pro/Max
# subscription token, generated via `claude setup-token`, stored as a
# repo secret). Same value the operator uses at cnos.
#
# Substrate: anthropics/claude-code-action@v1 — auth path verified
# end-to-end in cnos#435..#438; OIDC permission + token format both
# pinned in cnos commit a42b3d35 and round-4 green (cnos#438).
#
# Composition: "Activate and attach as <agent-home-url>" — invokes the
# two peer skills in cnos.core/skills/agent/{activate,attach}/SKILL.md.
# At cn-sigma's body, PWD origin matches the prompt URL → attach skill
# detects mode = home. Home procedure iterates over each registered
# activation in state/activations.md (currently cnos, bumpt), walks
# each foreign log from last_read_foreign_log to hub HEAD, writes one
# per-activation thread entry, and advances each cursor.
name: claude-wake
on:
issues:
types: [opened]
schedule:
# Four independently-scheduled hourly crons. Each cron line is
# scheduled separately by GH; partial slot drops don't open a full
# hour-long gap. Combined effect ~4 wakes/hour expected; with even
# 75% drop rate we still get ~1 wake/hour guaranteed. Minutes chosen
# complementary to cnos (:08/:23/:38/:53) — no two bodies fire the
# same minute, channel race-free, ~7.5 min effective cadence at the
# channel level. Per cnos directive 2026-06-02T21:57Z; RCA at
# 2026-06-02T20:35Z (off-peak avoids :00/:30 congestion).
- cron: '12 * * * *'
- cron: '27 * * * *'
- cron: '42 * * * *'
- cron: '57 * * * *'
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
# Serialize wakes — never run two in parallel. Concurrent wakes would
# race on the writer-surfaces (threads/activations/{name}/) and
# state/activations.md cursor advances, producing duplicate entries or
# push conflicts. cancel-in-progress: false queues new triggers behind
# any in-flight wake.
concurrency:
group: claude-wake
cancel-in-progress: false
jobs:
wake:
if: ${{ github.event_name == 'schedule' || contains(github.event.issue.title, 'claude-wake') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
show_full_output: true
prompt: |
Activate and attach as https://github.com/usurobor/cn-sigma.