claude-cron-automation

claude-cron-automation is a skill for Claude Code, Codex from magic3007/dotfiles. It costs 150 tokens per session (1,657 once invoked), scanned B, original, MIT.

A guide for scheduling Claude Code commands with the Unix cron scheduler, which runs scripts automatically at set times.

In plain words
What is it for?
Use it to schedule daily or weekly analysis, reports, diagnostics, or custom Claude Code prompts, including jobs that send results through supported reminders.
Why use it?
It addresses cron's limited environment, including missing programs, shell setup, and API credentials needed by non-interactive jobs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit Use it to schedule daily or weekly analysis, reports, diagnostics, or custom Claude Code prompts, including jobs that send results through supported reminders.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/magic3007/dotfiles/claude-cron-automation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add magic3007/dotfiles --skill claude-cron-automation
Clone the repo
git clone --depth 1 https://github.com/magic3007/dotfiles

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for claude-cron-automation

README.md
[![agentmods](https://agentmods.dev/badge/skills/magic3007/dotfiles/claude-cron-automation/github.svg)](https://agentmods.dev/skills/magic3007/dotfiles/claude-cron-automation)
Your own site
<a href="https://agentmods.dev/skills/magic3007/dotfiles/claude-cron-automation"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/claude-cron-automation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for claude-cron-automation

Your own site · 80×15
<a href="https://agentmods.dev/skills/magic3007/dotfiles/claude-cron-automation"><img src="https://agentmods.dev/badge/skills/magic3007/dotfiles/claude-cron-automation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,657 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00150 $0.01657
Opus 5.5 $0.00060 $0.00663
Sonnet 5.5 $0.00030 $0.00331
Haiku 4.5 $0.00015 $0.00166

Measured 4d ago against content hash be69f40c84b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

claude-cron-automation scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

2. Check the log: `tail -f ~/.claude/logs/<script>.log`
claude/skills/claude-cron-automation/SKILL.md · 169 lines

How it starts

The opening of the file, as written. The whole thing — 169 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude Code Cron Automation

Problem

Running Claude Code in cron requires solving three challenges that don't apply to interactive sessions:

  1. cron's minimal PATH doesn't include nvm/node or user binaries
  2. Shell aliases and functions (like dsccpro) are unavailable
  3. Third-party API backends need explicit environment variables

Context / Trigger Conditions

  • Setting up automated daily/weekly Claude Code tasks via cron
  • claude -p non-interactive mode with API backends other than Anthropic
  • /insights, /doctor, or custom prompts need to run on a schedule
  • cron environment lacks DEEPSEEK_API_KEY, node, or wechat-reminder in PATH
  • Need to deliver results via wechat-reminder (Feishu/WeChat)

Solution

1. Crontab Entry Pattern

Always use zsh -l (login shell) to source the user's full environment:

7 22 * * * /bin/zsh -l '/absolute/path/to/script.sh'

The -l flag ensures .zshenv, .zprofile, and .zshrc are sourced, making API keys and PATH available.

2. Script Self-Setup (Defense in Depth)

Even with zsh -l, include a self-setup section in the script for robustness:

#!/bin/zsh
set -euo pipefail

# Auto-discover nvm/node (covers cron's minimal PATH)
for nvm_dir in "$HOME/.nvm" "/usr/local/nvm"; do
    if [[ -s "$nvm_dir/nvm.sh" ]]; then
        export NVM_DIR="$nvm_dir"
        break
    fi
done

NODE_BIN="$HOME/.nvm/versions/node/$(ls "$HOME/.nvm/versions/node/" 2>/dev/null | sort -V | tail -1 || echo '')/bin"
export PATH="$NODE_BIN:$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin:$PATH"

# Verify essentials
command -v claude >/dev/null 2>&1 || { echo "claude not found"; exit 1; }

3. Third-Party API Env Vars (Non-Interactive)

Shell aliases like dsccpro don't work in scripts. Use the raw env var pattern that _claude_with_api expands to:

# DeepSeek API (replaces dsccpro alias)
REPORT=$(
    env -u ANTHROPIC_API_KEY \
        ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic" \
        ANTHROPIC_AUTH_TOKEN="${DEEPSEEK_API_KEY}" \
        API_TIMEOUT_MS=600000 \
        ANTHROPIC_MODEL="deepseek-v4-pro[1m]" \
        ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-pro[1m]" \
        ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4-pro[1m]" \
        ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-pro[1m]" \
        ANTHROPIC_SMALL_FAST_MODEL="deepseek-v4-pro[1m]" \
        CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4-pro[1m]" \
        CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \
        CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 \
        claude -p "$PROMPT" \
            --print \
            --output-format text \
            --dangerously-skip-permissions \
            --add-dir "$HOME/.claude/projects" \
            --add-dir "$HOME/.claude/usage-data" \
            2>&1
)

Read the full file on GitHub · 169 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed be69f40c84b4
  2. 3mo ago First seen · 169 lines · 150 tokens per session scan B dcd8cdf60a2b

Subscribe to this mod's changes

claude-cron-automation is a skill published in the GitHub repository magic3007/dotfiles (11 stars, last pushed 5d ago), licensed MIT. It adds 150 tokens to every session and 1,657 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

claude-cron-automation compared with skills from other repositories

claude-cron-automation next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
claude-cron-automationmagic3007/dotfilesSkill115d agoMITB150Claude Code, Codex
dotfilesurmzd/dotfilesSkill64d agoApache-2.0A67Claude Code
use-thingsooloth/dotfilesSkill24todaynoneA65Claude Code
achieve-goalooloth/dotfilesSkill24todaynoneA103Claude Code
use-slackooloth/dotfilesSkill24todaynoneA61Claude Code, Codex
wrap-up-sessionooloth/dotfilesSkill24todaynoneA50Claude Code, Codex
rexooloth/dotfilesSkill24todaynoneA30Claude Code, Codex