claude-cron-automation

claude-cron-automation is a skill for Claude Code, Codex from magic3007/dotfiles. It costs 150 tokens per session (1,653 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,653 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.01653
Opus 5 $0.00075 $0.00826
Sonnet 5 $0.00030 $0.00331
Haiku 4.5 $0.00015 $0.00165

Measured 9d ago against content hash dcd8cdf60a2b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 9d 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. 9d 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 yesterday), licensed MIT. It adds 150 tokens to every session and 1,653 once invoked, about $0.0007 per session on Opus 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

Other skills, from other repositories

dotfiles

Chezmoi dotfiles conventions and patterns. Use when modifying dotfiles, adding new managed files, working with chezmoi templates, or syncing agent skills and subagents through agentspec.

urmzd/dotfiles · 41 tokens

use-notion

Reference for using the Notion API via the notion-agent subagent. Use to expore and update Notion workspace content.

ooloth/dotfiles · 29 tokens

orchestrate-agents

Orchestrate multiple agent CLIs (Claude, Codex, Antigravity) via tmux with a shared fleet store, dispatching one guardian subagent per pane. Survey-first: inspects and adopts existing tmux sessions, windows, and agent panes before creating anything new. Use when running a multi-agent session, dispatching parallel…

urmzd/dotfiles · 83 tokens

assess-quality

Foundational quality framework: the five questions (readable, easy to start, expands without bloat, consistent, intentional) every other dev skill is judged against, plus the dual-audience and workshop principles. Use when onboarding to a project, defining a quality bar, setting an assessment checklist, or arbitrating…

urmzd/dotfiles · 120 tokens

create-oss-skill

Create well-formed Agent Skills following the agentskills.io specification. Scaffold directories, write SKILL.md files, bundle scripts, and structure instructions for progressive disclosure. Use when creating a new skill, reviewing skill structure, optimizing a skill description, or setting up evals for skill quality.

urmzd/dotfiles · 63 tokens

extend-oss-skills-to-claude

Extend standard agentskills.io skills with Claude Code-specific features. Invocation control, subagent execution, dynamic context injection, string substitutions, model/effort overrides, and deployment scoping. Use when adapting a portable skill for Claude Code, adding Claude-specific frontmatter, setting up subagent…

urmzd/dotfiles · 74 tokens