#6801: docs: add token optimization guidance for isolated cron sessions
docs
Cluster:
Cron Job Enhancements
## Summary
Adds documentation to help users optimize token usage when scheduling recurring tasks with cron jobs.
**Key additions:**
1. **Token optimization section** in `cron-vs-heartbeat.md` explaining:
- Main session jobs load full conversation history (50-100K+ tokens)
- Isolated sessions start fresh (10-20K tokens)
- 80%+ token savings for standalone reports
2. **Payload type clarification**: Isolated sessions require `--message` (agentTurn), not `--system-event`
3. **Troubleshooting entry** in `cron-jobs.md` for the common "agentTurn required" error with fix
## Why this matters
Users often default to `--session main` for all cron jobs without realizing the token cost. Standalone reports (weather, summaries, event listings) that do not need conversation history can run isolated and save significant tokens per run.
The CLI already enforces the payload type requirement, but the error message alone does not explain *why* or what the alternative is. This PR makes the pattern discoverable before users hit the error.
## Test plan
- [x] Verified links work with Mintlify anchor format
- [x] Examples are generic (no PII)
- [x] Matches existing doc style
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds documentation to reduce token usage for scheduled automation by clarifying when to use `--session main` vs `--session isolated`, and by explaining the required payload type (`--message`/`agentTurn` for isolated sessions). It also adds a troubleshooting entry in `cron-jobs.md` for the common “payload.kind=agentTurn” error and links readers to the new token optimization section in `cron-vs-heartbeat.md`.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge; it’s a docs-only change with a minor anchor/heading robustness concern.
- Changes are limited to Markdown documentation and align with existing guidance about main vs isolated cron sessions; the main risk is Mintlify anchor stability due to a quoted heading in Troubleshooting, which could make future deep-links brittle.
- docs/automation/cron-jobs.md (Troubleshooting heading anchor robustness)
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#15294: fix(cron): reset token counters when creating new isolated session
by Elarwei001 · 2026-02-13
79.5%
#8307: fix(cron): improve tool description with reliable reminder guidance
by vishaltandale00 · 2026-02-03
78.2%
#23562: feat: add sessionFreshness config for isolated cron jobs (#23539)
by MunemHashmi · 2026-02-22
76.7%
#21014: fix(cron): suppress main-session summary for HEARTBEAT_OK responses
by nickjlamb · 2026-02-19
75.1%
#6522: fix(cron): deliver original message when agent response is heartbea...
by sidmohan0 · 2026-02-01
74.3%
#8097: fix: auto-convert one-shot reminders for reliable delivery
by Gerrald12312 · 2026-02-03
74.0%
#3196: docs: clarify auth-profiles.json format for Claude Max setup-tokens
by aadeina · 2026-01-28
74.0%
#6315: fix(cron): persist isolated sessions (fixes #6217) - attempt 2
by ChaitanyaSai-Meka · 2026-02-01
73.9%
#9521: fix: restrict bootstrap files for cron agentTurn sessions
by ComputClaw · 2026-02-05
73.8%
#23501: fix(cron): force new session ID for isolated cron jobs (#23470)
by stakeswky · 2026-02-22
73.6%