Sleep Optimizer

Sleep Optimizer is a skill for Claude Code, Codex from SkillMedev/health-and-longevity. It costs 154 tokens per session (1,729 once invoked), scanned A, original, MIT.

A personalized sleep plan built from information about a person’s schedule, habits, energy patterns, and possible warning signs. It sets a consistent wake time, a suitable sleep window, light exposure, bedroom conditions, evening rules, and a wind-down routine.

In plain words
What is it for?
Use it when someone has trouble falling asleep, wakes during the night, or has an irregular schedule. It also screens for warning signs such as possible sleep apnea before suggesting routine changes.
Why use it?
Sleep problems are often approached by forcing an earlier bedtime while wake times keep changing. This creates a stable daily anchor and changes one factor at a time so its effect can be observed.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when someone has trouble falling asleep, wakes during the night, or has an irregular schedule. It also screens for warning signs such as possible sleep apnea before suggesting routine changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skillmedev/health-and-longevity/sleep-optimizer
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 SkillMedev/health-and-longevity --skill sleep-optimizer
Clone the repo
git clone --depth 1 https://github.com/SkillMedev/health-and-longevity

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 Sleep Optimizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillmedev/health-and-longevity/sleep-optimizer/github.svg)](https://agentmods.dev/skills/skillmedev/health-and-longevity/sleep-optimizer)
Your own site
<a href="https://agentmods.dev/skills/skillmedev/health-and-longevity/sleep-optimizer"><img src="https://agentmods.dev/badge/skills/skillmedev/health-and-longevity/sleep-optimizer/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 Sleep Optimizer

Your own site · 80×15
<a href="https://agentmods.dev/skills/skillmedev/health-and-longevity/sleep-optimizer"><img src="https://agentmods.dev/badge/skills/skillmedev/health-and-longevity/sleep-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 154 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,729 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.00154 $0.01729
Opus 5 $0.00077 $0.00864
Sonnet 5 $0.00031 $0.00346
Haiku 4.5 $0.00015 $0.00173

Measured 9d ago against content hash c8cbf6e5ac43, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

Sleep Optimizer 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 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.

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/sleep-optimizer/SKILL.md · 95 lines

How it starts

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

Sleep Optimizer

Most people try to fix sleep from the wrong end - chasing an earlier bedtime with willpower while their wake time drifts by hours across the week. Wake-time consistency is the single strongest lever, and everything else in the protocol hangs off it. This skill builds a complete protocol: fixed wake time, light plan, environment, input rules, and a scripted wind-down - then changes one variable at a time so the user can tell what worked.

Operating procedure

Steps run in this order because the wake anchor must exist before the bedtime, light plan, and wind-down can be scheduled against it.

Step 1: Assess the baseline

Collect: typical bedtime and wake time, weekday versus weekend (the gap between them is the social-jetlag number to shrink); time to fall asleep and number of night wakings; caffeine dose and timing, alcohol frequency, and evening screen habits; energy dips and peaks across the day; work constraints (fixed start time, shift work); and bed partner factors (snoring, different schedules). Screen the red flags in Escalation before optimizing anything - protocol work cannot fix apnea.

Step 2: Identify chronotype

Classify as early (lark), intermediate, or late (owl) from the natural wake time on unconstrained days. Align the target schedule with the chronotype where life allows rather than forcing an unnatural one - a forced 5am schedule on a strong owl fails within weeks. Label the classification a guess if the user has no unconstrained days to judge from.

Step 3: Fix the wake time and derive the bedtime

Pick one wake time and hold it every day including weekends, within ±30 minutes - this consistency window is the non-negotiable core of the protocol. Count back 7.5-9 hours to set the target bedtime. If the current schedule is far off, shift in 15-30 minute steps every few days rather than one heroic jump.

Step 4: Build the light plan

Morning: 10-30 minutes of bright, preferably outdoor light within an hour of waking to anchor the circadian clock (through a window is a weak substitute; overcast outdoor light still works). Evening: dim household lights and cut blue-heavy screens 1-2 hours before bed. Bedroom: fully dark - blackout curtains or an eye mask.

Read the full file on GitHub · 95 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 · 95 lines · 154 tokens per session scan A c8cbf6e5ac43

Subscribe to this mod's changes

Sleep Optimizer is a skill published in the GitHub repository SkillMedev/health-and-longevity (1 stars, last pushed 2mo ago), licensed MIT. It adds 154 tokens to every session and 1,729 once invoked, about $0.0008 per session on Opus 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-08-31.

Related

Other skills, from other repositories

garmin-connect

Garmin Connect CLI for activities, health, body composition, workouts, devices, gear, goals, and more.

bpauli/gccli · 27 tokens

garmin-trainer

Adaptive 12-week training plan generator using Garmin Connect data. Creates structured workouts and schedules them on your Garmin calendar. Use this skill whenever the user asks about training plans, workout scheduling, race preparation, building fitness for upcoming events, or wants to generate/update their training…

bpauli/gccli · 85 tokens

icuvisor-training

Use when answering endurance training questions with icuvisor MCP tools and intervals.icu data. Keeps answers grounded in tool results, handles athlete-local dates, stale data, subjective scales, safe writes, and workout/calendar workflows.

ricardocabral/icuvisor · 48 tokens

verify

Run the checks that have to pass before a FreeReps commit lands — Go build, vet, tests and golangci-lint, the frontend type check and build, and the document contract check. Triggers — "verify", "prüf das durch", "vor dem commit", "läuft das durch", "check before committing", "run the checks", "does CI pass". Not for…

meltforce/FreeReps · 97 tokens

health

Personal health knowledge graph — local-first ingest of Garmin (Apple Health, Whoop, Oura, CGM in v2+) traces into SQLite, projected to Obsidian daily-note frontmatter, synthesized into validated longevity-proxy metrics (HRV-CV, CTL/ATL/TSB, VO2max arc). Hex architecture so new sources drop in as adapters. NOT a…

broomva/skills · 86 tokens

apple-health

Unofficial Apple Health export MCP for AI agents. Prefer MCP tools if connected; otherwise the package CLI. Use when the user wants Apple Health data or actions through an agent.

davidmosiah/apple-health-mcp · 39 tokens