agentleFS
lucasyhzhu-debuglucasyhzhu-debug/claude-skills/skills/fresh/SKILL.md

fresh

Skill0 starsChanged 3 months agoMITView on GitHub

Use when the user wants a prompt, plan, or message to execute exactly when the next Claude 5-hour usage-limit window resets — e.g. "/fresh <prompt|file> [--clear]", "run this at my next reset", "start the plan when my limit resets", "queue this for when usage resets". Also when rate-limited and wanting work to auto-start the moment quota returns.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Obedience-Corp/fresh★ 4same name
    2. rayketcham-lab/qn-claude-web★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the argument is an existing file, the prompt becomes: Execute the instructions in <absolute path>.

    line 21
  2. Very specific:

    If the prompt is inline text, write it to tmp/fresh-prompt.md in the project.

    line 64
  3. Very specific:

    Write a runner — never inline the command in /TR (schtasks quoting breaks):

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fresh — execute a prompt at the next 5h usage reset

Overview

Detect the next 5-hour usage-window reset and fire a prompt at it, so a long run gets a full fresh quota window. Two modes:

  • Default (same session): one-shot CronCreate injects the prompt into the current session. Context is preserved.
  • --clear (fresh session): Windows Task Scheduler launches a brand-new headless claude -p session at reset. Fresh context window + fresh quota. Survives closing this session. Resumable afterwards.

Usage

/fresh <prompt text | path/to/prompt.md> [--clear] [--at HH:MM] [--now]

If the argument is an existing file, the prompt becomes: Execute the instructions in <absolute path>. If it looks like a path but doesn't exist, stop and ask — don't schedule against a missing file or silently treat it as literal text.

Step 1 — Find the reset time

node "$HOME/.claude/skills/fresh/resolve-reset.cjs"   # Windows: node "%USERPROFILE%\.claude\skills\fresh\resolve-reset.cjs"

Prints one JSON line: {reset_utc, reset_local, source, utilization_pct}. Use reset_local directly — the resolver already converted from UTC. The source field tells you how much to trust it:

sourceMeaningConfidence
statusline-cacheThe exact value the 5h usage line under the REPL shows (Anthropic's /api/oauth/usage → five_hour.resets_at, already fetched, cached 60 s).Authoritative. Trust it.
oauth-liveSame endpoint, fetched live.Authoritative. Trust it.
ccusage-heuristic-EARLYFallback. ccusage floors the block start down to the UTC hour, so its endTime is a lower bound — the real reset is 0–59 min LATER. Both authoritative sources were unavailable (you're likely rate-limited right now — a 429 on the live endpoint).Low. Do NOT schedule against this blindly — see below.

Why this changed: the old skill used ccusage's endTime as the reset. Because ccusage floors the window start to the hour, that value fires early — landing the prompt in the old, exhausted window. The 5h line under the REPL is accurate because it reads five_hour.resets_at; the resolver reads the same source (via the status line's cache, falling back to the live endpoint).

  • --at HH:MM given → skip the resolver, use that (local time).
  • source: ccusage-heuristic-EARLY → don't trust the bare value. Ask the user to read the 5h reset shown under their REPL (or /usage) and pass it as --at — that's the authoritative number the agent can't see when both sources are degraded. If they decline, schedule at ceil(reset to next :00) + 2 min (round UP to the next hour) — overshooting starts you slightly late in a fresh window; undershooting burns the old one.
  • error (no source) → ask the user for the reset time (/usage) and proceed as if --at.
  • No active block / utilization_pct ~0 (user idle >5h): there is no "next reset" — a new window starts with the next message. Run the prompt now (or confirm with the user if it wasn't --now). --now always means run immediately. With --clear, "now" = execute the runner directly (cmd /c tmp\fresh-run.cmd), no schtasks — fresh-session semantics still apply.
  • Sanity check: for the authoritative sources, the value already matches the 5h line — no eyeball needed. For the heuristic fallback, always confirm with the user.

Always schedule at reset + 2 minutes. This is load-bearing: one-shot crons can fire up to ~90 s EARLY, which would land the message in the old, exhausted window. +2 min also keeps you off :00/:30 jitter points.

Step 2a — Default mode (same session)

CronCreate one-shot, pinned to the date (load via ToolSearch if deferred):

CronCreate({
  cron: "2 H DoM Mon *",        // local time, reset hour, +2 min
  prompt: "<the user's prompt>",
  recurring: false,
  durable: true                  // reset may be hours away; survive a restart
})

Tell the user: fires only while the REPL is open and idle — leave the session running.

Step 2b — --clear mode (fresh session)

  1. If the prompt is inline text, write it to tmp/fresh-prompt.md in the project.
  2. Write a runner — never inline the command in /TR (schtasks quoting breaks):
@echo off
cd /d "<project dir>"
type "<abs prompt file>" | claude -p --permission-mode acceptEdits > "tmp\fresh-run.log" 2>&1

Save as tmp\fresh-run.cmd.

  1. Schedule it:
schtasks /Create /TN ClaudeFresh /F /SC ONCE /SD MM/DD/YYYY /ST HH:02 /TR "cmd /c \"<abs path>\tmp\fresh-run.cmd\""
  1. Tell the user:
    • Output streams to tmp/fresh-run.log; continue interactively later with claude --resume (newest session).
    • acceptEdits is the default; if the plan needs unattended Bash/git, offer --dangerously-skip-permissions as their explicit call.
    • One-shot schtasks don't self-delete: schtasks /Delete /TN ClaudeFresh /F afterwards.
    • Machine must be awake at fire time.

(Non-Windows: same flow, schedule the runner with at / launchd instead of schtasks.)

Quick reference

SituationAction
source authoritative (statusline-cache/oauth-live)Schedule at reset_local + 2 min
source: ccusage-heuristic-EARLYAsk user for the 5h-line//usage reset → --at; else round up to next :00 + 2 min
No active block / utilization ~0Run now — next message starts a fresh window
--clearRunner .cmd + schtasks → new claude -p session
DefaultCronCreate one-shot, durable: true
Prompt is a fileReference the file path, don't inline contents

Common mistakes

  • Trusting ccusage's endTime as the reset → it floors the block start to the UTC hour, so it fires up to 59 min EARLY into the old, exhausted window. This was the root cause of the original "fires before reset" bug. Use the resolver; the authoritative source is five_hour.resets_at (what the 5h REPL line shows).
  • Scheduling at exactly :00 → early-fire jitter burns the old window. Always +2 min.
  • reset_local is already local — the resolver converts. Don't double-convert.
  • Inline schtasks /TR command with nested quotes → silently broken task. Use the runner file.
  • claude -p without a permission mode → stalls on first edit approval in a headless run.
  • CronCreate without durable: true → job dies if the session restarts before reset.
  • Fixed task/file names → a second /fresh --clear silently clobbers the first (/F forces). Suffix everything with the <id>.
  • Fabricating a reset time when no block is active → there isn't one; the next message defines it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.