routine-opt

routine-opt is a skill for Claude Code from tonydzi/second-brain-starter-kit. It costs 76 tokens per session (4,887 once invoked), scanned A, original, MIT.

A workflow for measuring and reducing the cost of recurring agent tasks. It compares factors such as model choice, task breakdown, run frequency, and repeated context before applying changes.

In plain words
What is it for?
Use it to audit recurring routines, decide which changes may reduce their cost, and verify the result after those changes.
Why use it?
It helps find why recurring tasks consume many tokens and cost more than expected. Savings are checked with measurements rather than assumed.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths.

Part of the second-brain-skills plugin — 248 skills, 1 plugin shipped together

Good fit Use it to audit recurring routines, decide which changes may reduce their cost, and verify the result after those changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tonydzi/second-brain-starter-kit/routine-opt
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 tonydzi/second-brain-starter-kit --skill routine-opt
Clone the repo
git clone --depth 1 https://github.com/tonydzi/second-brain-starter-kit

Made for: Claude Code.

Or install second-brain-skills, the plugin that ships this one along with the rest of its 248 skills, 1 plugin.

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 routine-opt

README.md
[![agentmods](https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/routine-opt/github.svg)](https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/routine-opt)
Your own site
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/routine-opt"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/routine-opt/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 routine-opt

Your own site · 80×15
<a href="https://agentmods.dev/skills/tonydzi/second-brain-starter-kit/routine-opt"><img src="https://agentmods.dev/badge/skills/tonydzi/second-brain-starter-kit/routine-opt.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,887 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00076 $0.04887
Opus 5.5 $0.00030 $0.01955
Sonnet 5.5 $0.00015 $0.00977
Haiku 4.5 $0.00008 $0.00489

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

Security

Grade A, and why

routine-opt scanned grade A with 0 findings 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 11d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/routine-opt/SKILL.md · 234 lines

How it starts

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

/routine-opt — сделать парк рутин дешевле, не сломав его

Заказ Антона (голосом, 10.09.2026): «аудит всех рутин, часть на Sonnet, часть декомпозировать, запускать реже и дешевле».

Главный факт, с которого начинается любой прогон этого скилла (замер хаба 09.09.2026): цена прогона = ходы × носимый префикс, а не «дорогая модель». Одна рутина за один прогон уносила 155M токенов; носимый префикс сессии с полным набором коннекторов — 110–134k на каждый ход. Поэтому рычаг «модель» стоит в этом скилле последним, а не первым: он делит счёт, а первые три рычага его вычитают.

Шаг 0 — RECALL (не начинай с нуля)

python [путь владельца] "аудит рутин цена токенов модель декомпозиция"

Что уже решено и НЕ переоткрывается без новой улики:

  • оргмодель «рутины = сотрудники» (decision-2026-08-21-routine-org-model): менеджер = robot-audit-weekly;
  • вердикт панели 4 LLM (insight-panel-routines-model-consumption-2026-08-10): корень — отсутствие backpressure, перевод на дешёвую модель без него = «дешёвый мусор вместо дорогого»;
  • Sonnet-only для рутин сотрудников (Библия), узлы Антона живут по §6.2.

Шаг 1 — замер (0 токенов, обязателен)

python ~/.claude/scripts/routine_cost_audit.py --days 7 --out ~/.claude/state/routine_cost.json

Читаем колонку «за прогон», а не «за окно»: за окно дорога рутина, которая просто часто ходит, а чинить надо ту, у которой дорог ОДИН прогон. Прибор сам ставит вердикт-кандидат; он кандидат, а не приговор — решение за человеком.

⚠️ Грабля, пойманная 14.09 (LAPTOP-1): строка cron: once + enabled: false = ОДНОРАЗОВЫЙ СИД (переиспользованный слот /slot), а не рутина. Замер 06–13.09: все 13 «🔴 декомпозировать» были такими сидами (10.09 — 540M за день), а настоящие суточные рутины стоили 4–9M/прогон. Сиды не прореживаются и не декомпозируются — их цена = длина живой работы сида; рычаг там один: узкий носимый префикс (headless claude_run.py) и call_budget_gate. В таблице такие строки читай как «сид», иначе весь Шаг 2 уйдёт в правку того, что больше не запустится.

Read the full file on GitHub · 234 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. 11d ago Changed · -2 lines 450ba4be1e4c
  2. 14d ago Changed · +1 lines · -74 tokens per session 5785f7b0b169
  3. 16d ago Changed · +14 lines 1bbf15931e92
  4. 25d ago First seen · 221 lines · 150 tokens per session scan A b3f1cfddd344

Subscribe to this mod's changes

routine-opt is a skill published in the GitHub repository tonydzi/second-brain-starter-kit (9 stars, last pushed today), licensed MIT. It adds 76 tokens to every session and 4,887 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-24.

Related

Other skills, from other repositories

superbrain-distill

Internal SuperBrain skill — run by the detached capture child to distill a session-event delta into routed Obsidian notes. Not for direct user invocation.

m3talux/superbrain · 36 tokens

email-sorting

Customize and use a human-reviewed email sorting system for Gmail, Google Workspace, Outlook, Microsoft 365 or another connected mailbox. Use for first-time setup, folder or label recommendations from a read-only email sample, inbox triage, and applying approved sorting batches. Not for sending, replying to or…

AiAi-Mastermind/aiai-mastermind-tools-and-skills · 66 tokens

inbox

An inbox-management skill for scanning an LLM Wiki inbox, previewing pending files, choosing how to process them, and sending selected material through an import step.

johnfkoo951/cmds-llm-wiki · 43 tokens

canvas

Create, inspect, and update Obsidian JSON Canvas boards with text, file, link, group, and edge nodes. Use for canvas status, canvas lists, visual maps, zones, spatial layouts, adding vault notes or media to a .canvas file, and requests such as create canvas, add to canvas, or put this on the canvas.

AgriciDaniel/claude-obsidian · 72 tokens

wiki-retrieve

Build and query a vault-local contextual BM25 retrieval index with optional multilingual Nomic cosine reranking; use for retrieve, hybrid retrieval, BM25, rerank, contextual retrieval, chunk search, vault search, semantic search, find relevant passages, or retrieval diagnostics. Derived caches stay under .vault-meta…

AgriciDaniel/claude-obsidian · 81 tokens

obsidian-markdown

Explain, draft, or validate Obsidian Flavored Markdown syntax: properties, wikilinks, embeds, callouts, tags, comments, highlights, block references, math, and Mermaid. Use when the user explicitly requests Obsidian note formatting or syntax help, not for general Markdown or broad vault operations.

AgriciDaniel/claude-obsidian · 68 tokens