diagnose-cron-timeout
Skill2 starsChanged 24 days agoMITView on GitHub
Decide whether a scheduled claude_code cron that ended "timed out" with an empty trace was cut at its time cap while still working, or truly hung, by reading the run's session transcript and any foreground subagent transcript. Read-only.
In this repository57 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- advisorSkill
- agent-dispatchSkill
- arenaSkill
- audit-pypi-model-packageSkill
- branching-workflowSkill
- code-reviewSkill
- criticSkill
- cron-child-oauth-auditSkill
- daily-forestSkill
- deep-researchSkill
- dreamingSkill
- eod-summarySkill
- filingSkill
- forest-synthesisSkill
- goalsSkill
- graph-hygieneSkill
- ideaSkill
- inline-tagsSkill
- intel-analyzerSkill
- longformSkill
- loop-experimentSkill
- loop-librarySkill
- meta-memory-reviewSkill
- office-hoursSkill
- open-loopsSkill
- plan-ceo-reviewSkill
- plan-design-reviewSkill
- prdSkill
- progressive-disclosureSkill
- reality-feedback-createSkill
- reality-review-weeklySkill
- recallSkill
- reconcile-extractionSkill
- redactSkill
- repo-auditSkill
- research-digestSkill
- review-gateSkill
- run-long-job-detachedSkill
- saveSkill
- scopeSkill
- self-auditSkill
- shadow-test-local-classifierSkill
- signal-scorerSkill
- skill-auditSkill
- skill-chainingSkill
- spawn-agent-in-tenantSkill
- spawn-tenantSkill
- split-log-rows-by-session-kindSkill
- subagent-delegationSkill
- telegram-dump-routerSkill
- telegram-reply-toolSkill
- verify-stackSkill
- wave-planSkill
- weekly-retroSkill
The file
Files
Cron timeout: cap-kill or hang?
Use when the scheduler's execution_log shows status=error with output like "Claude Code session timed out (partial trace: <name>.out.log)". Read-only procedure, no daemon changes. The scheduler tables (schedules, execution_log) are the ones the scheduler MCP exposes (docs/mcp-layer.md); the paths below are placeholders for wherever your scheduler keeps its database and trace files.
Steps
- Read the row. Take
schedule_name,started_at,completed_atandtask_config.timeout_secondsfrom the scheduler database. Open it read-only:sqlite3.connect("file:<scheduler.db>?mode=ro", uri=True)from Python works even where thesqlite3CLI is not installed. A run time equal totimeout_seconds(for example exactly 25.0 min against a 1500 s cap) is a cap-kill, not a crash. - Ignore the empty trace. A
<traces>/<name>.out.logof 0 bytes is expected:claude --printwrites stdout once, at exit. It says nothing about where the run stalled. - Find the session transcript:
find ~/.claude/projects/<project-key> -maxdepth 1 -name '*.jsonl' -newermt "<start>" ! -newermt "<end>". A cron run is the one whose first user prompt is your cron prompt preamble and whose rows carryentrypoint: sdk-cli. The<project-key>is the working directory path with/replaced by-, so it differs per machine. - Read the last
tool_usein that transcript and its timestamp.- A Write or Bash call shortly before the kill: the run was working and ran out of budget mid-step.
- A foreground
Agentcall (run_in_background: false) as the last parent row: go to step 5.
- Open the subagent transcripts:
<session-id>/subagents/agent-*.jsonl(the.meta.jsonnext to each names its task). Compare its last timestamp with the kill time and count its tool calls by name. Active within about a minute of the kill: budget exhaustion. Idle for minutes before the kill: a real hang in that tool call. - Put the run in context before proposing a fix. Take the last N durations for the same schedule from
execution_log(median against the cap), and name what scales the slow step (new-item count, article count, channel count). - Record it in an Infra dossier for cron misses (
memory/Infra/<cron-misses>.md) with the session ids and the verdict. Fixes (raisetimeout_secondsand verify by reading it back, cap the slow step, split it into its own schedule) are CONFIRM-gated.
Tools
Bash (find, python3 with sqlite3 read-only), Read. No Claude, chat or scheduler write calls.
Output
A one-line verdict per run (cap-kill mid-write, cap-kill with a live subagent, or hang) plus the median-against-cap margin, appended to the dossier.
Caveat
Step 3 depends on the transcript still existing. Transcripts and trace files are usually pruned on different schedules, so check both before concluding a run left no record.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

