# Cron Cost Optimize

Audit a user's registered cron jobs and recommend a cheaper mode for each, a...

- Repository: https://github.com/kirodotdev/KiroCrew (4711 stars)
- Category: AI and agents
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add kirodotdev/KiroCrew --skill cron-cost-optimize -g -a claude-code -y`
Codex: `npx skills add kirodotdev/KiroCrew --skill cron-cost-optimize -g -a codex -y`
Cursor: `npx skills add kirodotdev/KiroCrew --skill cron-cost-optimize -g -a cursor -y`
Gemini CLI: `npx skills add kirodotdev/KiroCrew --skill cron-cost-optimize -g -a gemini-cli -y`

## Description

Audit a user's registered cron jobs and recommend a cheaper mode for each, a zero-token script/command job, or an agent job with minimal context. Use when the user asks why scheduled jobs cost so much, wants to cut cron token spend, or is porting crons into Kiro Crew. Read-only; never edits a job.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Optimize what registered cron jobs cost

A cron job that dispatches to the model pays for its whole injected context on
every wake, whether or not that wake had anything to do. Two cheaper modes exist
and neither reaches a job that was already registered without them.

| Mode | What it costs | What it gives up |
|---|---|---|
| `script` or `command` job | no model turn at all | all reasoning, and the carried previous result |
| agent job with `minimal_context` | a model turn on a small context | memory, lessons, steering, skills, prior session history |
| plain agent job | a model turn on the full context | nothing |

Your job in this skill is to move each of the user's jobs to the cheapest mode it
can safely use, and to leave alone the ones that genuinely reason.

## Run the scan first

The scan is deterministic, so it costs no inference. Run it before forming any
opinion.

It reads nothing from disk. Two steps, and the first one matters:

1. Call `cron_list` with `json` set to true. That is the only reader that can see
   what the scan needs. The job store is scoped to the jobs your session owns, and
   the run history is readable only by the gateway, so a script cannot fetch either
   itself.
2. Write that JSON to a file and pass it in. Do NOT put the document on the command
   line -- a prompt inside it containing backticks or `$(...)` would be executed by
   the shell.

```bash
python3 <this skill's dir>/scripts/cron_cost_scan.py --input <the file you wrote>
```

Resolve `<this skill's dir>` from wherever you loaded this SKILL.md, rather than
hardcoding a path. The data home moves with `KIROCREW_HOME`, so a hardcoded
`~/.kiro/crew/skills/...` is wrong for some users.

Useful flags:

- `--json` for machine-readable output when you need to fold the result into a table.
- `--min-runs N` to change how many recorded runs count as evidence. Default is 5.

To look at one job, narrow the `cron_list` call with its `ids` instead of filtering
afterwards.

The rest: https://github.com/kirodotdev/KiroCrew/blob/HEAD/src/kiro_crew/builtin_skills/cron-cost-optimize/SKILL.md
