claude-code - ✅(Solved) Fix [Feature Request] Periodic silent execution primitive for autonomous agents [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45017Fetched 2026-04-09 08:15:17
View on GitHub
Comments
1
Participants
2
Timeline
15
Reactions
0
Author
Timeline (top)
referenced ×5labeled ×3cross-referenced ×2mentioned ×2

Root Cause

Architectural separation between two classes of execution:

  • Agent turns (rendered) — `CronCreate`, `/loop`, user prompts, manual tool calls
  • Hook executions (silent) — SessionStart, UserPromptSubmit, Stop, PostToolUse, async hooks, status line

Periodic scheduling lives in the first class; silent execution with `additionalContext` injection lives in the second. There is no bridge.

Fix Action

Fix / Workaround

  1. Schedule a polling cron in an interactive Claude Code session: ``` CronCreate({ cron: "*/5 * * * *", prompt: "check dispatches", recurring: true }) ```
  2. Leave the session idle for one hour without typing.
  3. Observe ~12 visible `Running scheduled task → Bash(...) → output` blocks accumulate in the transcript.

Workarounds attempted and their failure modes:

  • Multi-agent frameworks (the-agency, https://github.com/the-agency-ai/the-agency) where agents coordinate via a SQLite-backed inter-session communication protocol. Agents need to notice incoming dispatches from other agents within ~5 minutes so they can respond to directives, reviews, and escalations while the principal is away.
  • Background sync agents keeping a local state file aligned with a remote (databases, issue trackers, git remotes).
  • Monitoring agents watching logs, CI runs, or deploy status.
  • Long-running autonomous patterns where the agent is observer rather than prompt-responder.

PR fix notes

PR #53: Day 33 R1: agency-issue v1, release-plan v1, dispatch loop convention, iscp-check delta suppression, 6 seeds

Description (problem / solution / changelog)

Day 33 R1

Seven commits (one Day 32 carry-over + six Day 33 commits) shipping:

  • agency-issue v1 — new skill + tool for filing/viewing/commenting on/closing GitHub issues against the-agency framework. Two-way channel (unlike /feedback). Smoke-tested via #52.
  • release-plan v1 — new tool that analyzes branch state and proposes a release plan. Auto-detects day{N}-release-{M} branch, pairs tool+skill+tests into feature commits, excludes scratch. Bootstrap intent realized: this PR was assembled by release-plan itself.
  • Dispatch loop convention — two-loop pattern (5m silent fast-path + 30m visible nag) is now canonical for every agent. Documented in claude/CLAUDE-THEAGENCY.md, HANDOFF-BOOTSTRAP.md, and captain CLAUDE-CAPTAIN.md.
  • iscp-check v1.1.0 — delta suppression for hook notifications. ~95% reduction in notification noise during interactive sessions.
  • 6 new workstream seeds — fleet awareness, agency-issue, release-plan, silent-tool-calls (filed externally), granola, agent-mail-service.
  • Coordination artifacts — 16 dispatches sent today, 4 archived handoff rotations, principal reports directory migrated to usr/jordan/reports/.

Bugs caught and fixed during the bootstrap

  1. .git/config had bare = true — broke every git command in the repo. Fixed.
  2. claude/tools/git-commit referenced $PROJECT_ROOT without setting it — caused "unbound variable" errors. Fixed in the release-plan/git-commit commit.
  3. tests/tools/iscp-check.bats version assertion was stale (1.0.1 → 1.1.0). Fixed in the iscp-check commit.

External work captured this session

  • Filed Anthropic Claude Code feedback for periodic-silent execution primitive: feedback ID 8dd67e96-63ea-4a22-b687-d26a1b2d0add, GitHub issue anthropics/claude-code#45017. Tracked in usr/jordan/reports/.
  • Smoke-tested agency-issue by filing the v1 design itself as #52.

Test plan

  • agency-issue --version works
  • agency-issue --help works
  • agency-issue file files an issue and writes a report (verified via #52)
  • agency-issue list returns open issues
  • agency-issue view <id> shows body + comments
  • agency-issue comment <id> adds a comment (verified on #52)
  • release-plan --version works
  • release-plan --help works
  • release-plan generates a plan and switches to the right branch
  • iscp-check --force emits notification regardless of state
  • iscp-check (no flag) suppresses repeat notifications when count unchanged
  • BATS tests passing for iscp-check (after version assertion update)
  • Skills auto-discovered in Claude Code session (agency-issue visible in skill list — verified during build)

Notes

  • Day 33 R2 is planned to ship later today with whatever else surfaces this session.
  • The release-plan tool's heuristic does NOT yet pair config-block changes (e.g., agency.yaml issues: block) with their feature commit. This was manually folded for R1. Future improvement.
  • A meta-question is open: should we have a tool/skill for PR creation, pushing, and merging? Captured for triage.

🤖 Generated with Claude Code

Changed files

  • .claude/settings.json (modified, +1/-1)
  • .claude/skills/agency-issue/SKILL.md (added, +153/-0)
  • claude/CLAUDE-THEAGENCY.md (modified, +27/-0)
  • claude/config/agency.yaml (modified, +8/-0)
  • claude/config/settings-template.json (modified, +1/-1)
  • claude/templates/HANDOFF-BOOTSTRAP.md (modified, +6/-1)
  • claude/tools/agency-issue (added, +476/-0)
  • claude/tools/git-commit (modified, +13/-0)
  • claude/tools/iscp-check (modified, +42/-2)
  • claude/tools/release-plan (added, +425/-0)
  • claude/workstreams/agency/seeds/seed-agency-issue-skill-20260408.md (added, +304/-0)
  • claude/workstreams/agency/seeds/seed-fleet-awareness-20260408.md (added, +190/-0)
  • claude/workstreams/agency/seeds/seed-granola-workflow-20260407.md (added, +94/-0)
  • claude/workstreams/agency/seeds/seed-release-plan-tool-20260408.md (added, +83/-0)
  • claude/workstreams/agency/seeds/seed-silent-periodic-tool-calls-20260408.md (added, +161/-0)
  • claude/workstreams/gtm/seeds/seed-agent-mail-service-20260407.md (added, +109/-0)
  • tests/tools/iscp-check.bats (modified, +1/-1)
  • usr/jordan/captain/CLAUDE-CAPTAIN.md (modified, +35/-1)
  • usr/jordan/captain/captain-handoff.md (modified, +117/-121)
  • usr/jordan/captain/dispatches/directive-agent-create-scaffolding-bake-the-two-dispatch-loo-20260408-1142.md (added, +66/-0)
  • usr/jordan/captain/dispatches/directive-day-33-work-queue-4-items-plan-mode-required-in-or-20260407-1808.md (added, +63/-0)
  • usr/jordan/captain/dispatches/directive-hookify-rule-rename-verb-noun-noun-verb-convention-20260408-1142.md (added, +59/-0)
  • usr/jordan/captain/dispatches/directive-new-work-peer-to-peer-cross-repo-dispatches-auto-c-20260408-1055.md (added, +110/-0)
  • usr/jordan/captain/dispatches/directive-worktree-naming-convention-workstream-agent-collap-20260408-1101.md (added, +63/-0)
  • usr/jordan/captain/dispatches/dispatch-downgrade-157-not-p0-sparse-worktree-but-git-commi-20260407-1902.md (added, +45/-0)
  • usr/jordan/captain/dispatches/dispatch-hypothesis-on-157-mdpal-worktree-creation-not-git--20260407-1852.md (added, +36/-0)
  • usr/jordan/captain/dispatches/dispatch-p0-git-commit-bug-in-worktrees-please-verify-if-yo-20260407-1852.md (added, +14/-0)
  • usr/jordan/captain/dispatches/dispatch-p0-lifted-stand-down-on-git-commit-verification-wa-20260407-1902.md (added, +14/-0)
  • usr/jordan/captain/dispatches/dispatch-re-161-acknowledged-devex-resumes-side-issues-capt-20260407-1902.md (added, +14/-0)
  • usr/jordan/captain/dispatches/dispatch-re-git-commit-bug-escalated-to-devex-workaround-ap-20260407-1851.md (added, +14/-0)
  • usr/jordan/captain/dispatches/escalation-urgent-git-commit-wipes-worktree-index-blocks-all--20260407-1851.md (added, +54/-0)
  • usr/jordan/captain/dispatches/review-response-item-1-plan-approved-execute-20260407-1817.md (added, +36/-0)
  • usr/jordan/captain/dispatches/review-response-item-3-option-a-accept-main-as-is-20260407-1817.md (added, +22/-0)
  • usr/jordan/captain/dispatches/review-response-received-5-phases-shipped-here-s-your-next-dispatc-20260407-1609.md (added, +53/-0)
  • usr/jordan/captain/history/handoff-20260407-160326.md (added, +73/-0)
  • usr/jordan/captain/history/handoff-20260407-161411.md (added, +146/-0)
  • usr/jordan/captain/history/handoff-20260407-161412.md (added, +146/-0)
  • usr/jordan/captain/history/handoff-20260407-190052.md (added, +146/-0)
  • usr/jordan/reports/REPORTS-INDEX.md (added, +34/-0)
  • usr/jordan/reports/report-agency-issue-agency-issue-v1-new-skill-for-two-way-github-issue-20260408.md (added, +79/-0)
  • usr/jordan/reports/report-silent-periodic-tool-calls-20260408.md (added, +44/-0)

PR #54: Day 33 R2: iscp-check --statusline mode, status line mail indicator, PR lifecycle seed

Description (problem / solution / changelog)

Day 33 R2

Three commits on top of R1:

  • iscp-check --statusline mode + integration into claude/tools/statusline.sh. Partial fix for the autonomous-polling gap while the Anthropic feature request (GH anthropics/claude-code#45017) is pending. Status line is the one silent periodic mechanism that exists today — shows mail count in the footer bar without touching the transcript.
  • PR lifecycle tool seed — captures the design for a future /pr skill (push/create/merge) following the same "captain manually does X, should be a tool" pattern as agency-issue and release-plan. Implementation on hold per principal (upstream work relevant).
  • Coordination artifacts — #169 (worktree naming collapse rule answer to devex), #170 (iscp heads-up on the --statusline extension).

Expected effect

When iscp, devex, mdpal-app, mdpal-cli merge this and R1 into their worktrees, they get:

  • Silent notification delta suppression (from R1)
  • Mail count in the footer bar
  • No more "You have N dispatch(es)" repeats on every Stop

Test plan

  • iscp-check --statusline outputs compact one-liner when mail present
  • iscp-check --statusline silent when zero
  • iscp-check default mode still delta-suppressed
  • iscp-check --force still works
  • BATS tests all pass (13/13)
  • statusline.sh renders with mail indicator when present
  • statusline.sh renders without mail indicator when clean
  • Live verification after merge: footer shows 📬 indicator in running sessions

🤖 Generated with Claude Code

Changed files

  • claude/tools/agency-issue (modified, +19/-8)
  • claude/tools/iscp-check (modified, +51/-10)
  • claude/tools/nit-add (modified, +9/-11)
  • claude/tools/nit-resolve (modified, +7/-9)
  • claude/tools/release-plan (modified, +66/-0)
  • claude/tools/statusline.sh (modified, +19/-1)
  • claude/workstreams/agency/seeds/seed-pr-lifecycle-tool-20260408.md (added, +79/-0)
  • tests/tools/agency-issue.bats (added, +165/-0)
  • tests/tools/release-plan.bats (added, +261/-0)
  • usr/jordan/captain/captain-handoff.md (modified, +78/-105)
  • usr/jordan/captain/dispatches/dispatch-iscp-check-extended-with-statusline-mode-minor-add-20260408-1859.md (added, +60/-0)
  • usr/jordan/captain/dispatches/review-response-re-166-worktree-naming-collapse-rule-is-b-prefix-c-20260408-1853.md (added, +54/-0)
  • usr/jordan/captain/history/handoff-20260408-202114.md (added, +142/-0)
  • usr/jordan/captain/logs/captains-log-20260408.md (added, +40/-0)
RAW_BUFFERClick to expand / collapse

Related Anthropic Feedback ID: 8dd67e96-63ea-4a22-b687-d26a1b2d0add

Problem

Claude Code has no mechanism to execute periodic tool calls silently — without rendering them in the terminal transcript. CronCreate and /loop are the only periodic mechanisms, and every fire produces a visible ⎿ Bash(command) + output block plus a "Running scheduled task" marker. For autonomous-agent infrastructure that needs to self-poll external state between user turns, this scales linearly with polling frequency — at 5-minute intervals, an 8-hour interactive session produces ~100 visible "no-op" renders.

Hooks, by contrast, already run silently and already inject into agent context via additionalContext. The primitive we need is not a new "silent mode" for agent turns — it's a periodic trigger that fires a hook-style execution. Today, the periodic mechanisms (CronCreate, /loop) fire agent turns, and the silent mechanisms (hooks) are event-driven only. Nothing combines silent + periodic + agent-context-aware.

Steps to Reproduce

  1. Schedule a polling cron in an interactive Claude Code session: ``` CronCreate({ cron: "*/5 * * * *", prompt: "check dispatches", recurring: true }) ```
  2. Leave the session idle for one hour without typing.
  3. Observe ~12 visible `Running scheduled task → Bash(...) → output` blocks accumulate in the transcript.

Expected: Silent periodic execution with agent context updated if state changed. Actual: Every fire renders, polluting the interactive session.

Diagnostic Evidence

Catalog of existing Claude Code mechanisms and their coverage (verified via two independent rounds of documentation and settings-schema review):

MechanismSilentPeriodicInjects agent context
SessionStart / UserPromptSubmit / Stop hooks❌ (event-driven)✅ (`additionalContext`)
Async hooks (`"async": true`)Partial
Status line command (`statusLine: {type: "command"}`)✅ (UI tick)❌ (footer only)
Subagent execution internalsReturns-only
`CronCreate` / `/loop`
`Bash(run_in_background: true)` detached loopPartial❌ (file-gated)

No row combines silent + periodic + agent-context-aware. That combination is the gap.

Workarounds attempted and their failure modes:

  1. Delta-suppression in a hook — works for notification, but the hook only fires on user events. Fails in autonomous operation.
  2. Empty-output bash tool — the `Bash(command)` line still renders even with empty stdout. Rendering is triggered by the tool call itself, not its output.
  3. Status line polling — silent and periodic, but status line output renders only in the footer UI; it does not inject into the agent's next-turn context. Good for display, not for notification.
  4. Background detached bash loop (`while true; do … sleep 300; done &`) — polling runs silently after initial spawn, but the agent's turn still needs a hook event to read the state file and act. Hook-gated notification lag defeats the autonomous-operation purpose.
  5. Async hooks — silent, but not periodic.

Root Cause

Architectural separation between two classes of execution:

  • Agent turns (rendered) — `CronCreate`, `/loop`, user prompts, manual tool calls
  • Hook executions (silent) — SessionStart, UserPromptSubmit, Stop, PostToolUse, async hooks, status line

Periodic scheduling lives in the first class; silent execution with `additionalContext` injection lives in the second. There is no bridge.

Requested Behavior

Any one of the following would close the gap. Ranked by what appears to be the smallest change to existing architecture:

Option 1 (preferred) — `Periodic` hook type in `settings.json`

```json { "hooks": { "Periodic": [ { "interval": "5m", "command": ".claude/tools/mail-check" } ] } } ```

Timer-based hook with the same silent execution and `additionalContext` injection as existing event-driven hooks. Reuses all existing hook infrastructure (JSON output contract, silent stdout/stderr handling, `additionalContext` injection). Minimal new surface area — hook-based analogue of cron jobs.

Option 2 — `hook:` parameter on `CronCreate`

```typescript CronCreate({ cron: "*/5 * * * *", hook: ".claude/tools/mail-check", recurring: true, }) ```

Rather than scheduling a `prompt` (which fires a visible agent turn), let `CronCreate` schedule a hook-style command. The fire runs as a hook — silent by design, same `additionalContext` plumbing. No new hook type needed; only a new scheduler variant. Potentially the cleanest implementation.

Open question: does the existing scheduler have the plumbing to invoke a hook-style command instead of a turn? If yes, Option 2 is almost certainly the smaller change. If no, Option 1 is the simpler path.

Option 3 (fallback)

Document the status line command as the canonical silent periodic polling path for display-only use cases, and be explicit in the docs that it cannot inject agent context. This doesn't close the gap, but it surfaces the partial solution for users building status indicators.

Why This Matters

The Claude Code docs emphasize autonomous operation, scheduled tasks, and hooks as composable building blocks. The missing primitive is periodic silent self-awareness — the ability for an agent to observe external state between user turns without producing visual noise in the interactive session.

Concrete use cases already blocked by this gap:

  • Multi-agent frameworks (the-agency, https://github.com/the-agency-ai/the-agency) where agents coordinate via a SQLite-backed inter-session communication protocol. Agents need to notice incoming dispatches from other agents within ~5 minutes so they can respond to directives, reviews, and escalations while the principal is away.
  • Background sync agents keeping a local state file aligned with a remote (databases, issue trackers, git remotes).
  • Monitoring agents watching logs, CI runs, or deploy status.
  • Long-running autonomous patterns where the agent is observer rather than prompt-responder.

A native solution unblocks an entire class of agent infrastructure that the Claude Code platform is uniquely positioned to enable. We have shipped what we can in userspace — hook delta suppression, background pollers, status line indicators — but we cannot close the silent + periodic + agent-context-aware gap from outside the harness.


Reporter: Jordan Dea-Mattson (@jordandm, @jordan-of) Framework: https://github.com/the-agency-ai/the-agency Environment: macOS 26 (Tahoe), Ghostty terminal Anthropic Feedback ID: 8dd67e96-63ea-4a22-b687-d26a1b2d0add

extent analysis

TL;DR

To fix the issue, implement a periodic trigger that fires a hook-style execution, either by introducing a Periodic hook type in settings.json or by adding a hook parameter to CronCreate.

Guidance

  1. Introduce a Periodic hook type: Add a new hook type to settings.json that allows for periodic execution of silent commands with additionalContext injection.
  2. Modify CronCreate to support hook-style commands: Update CronCreate to accept a hook parameter, which would schedule a hook-style command instead of a visible agent turn.
  3. Verify the solution: Test the new periodic trigger by scheduling a silent command and checking that it executes without rendering in the terminal transcript.
  4. Evaluate the impact on existing use cases: Assess how the new solution affects existing autonomous operation, scheduled tasks, and hooks, and update documentation accordingly.

Example

{
  "hooks": {
    "Periodic": [
      { "interval": "5m", "command": ".claude/tools/mail-check" }
    ]
  }
}

Or, as an alternative:

CronCreate({
  cron: "*/5 * * * *",
  hook: ".claude/tools/mail-check",
  recurring: true,
})

Notes

The solution requires careful consideration of the existing architecture and the potential impact on other features. It is essential to evaluate the trade-offs between introducing a new hook type and modifying the existing CronCreate mechanism.

Recommendation

Apply a workaround by introducing a Periodic hook type in settings.json, as it seems to be the smallest change to the existing architecture. This approach allows for silent periodic execution with additionalContext injection, addressing the core issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - ✅(Solved) Fix [Feature Request] Periodic silent execution primitive for autonomous agents [2 pull requests, 1 comments, 2 participants]