session-limit

Reviewed at commit 4294cb9

Warn the model mid-turn as the 5-hour or 7-day limit nears

Made by
Ben Drucker
What we checked

When your 5-hour usage block reaches 90, 95 or 100 percent, or the 7-day limit reaches 95 percent, it adds a short message to the conversation telling Claude to save effort or wrap up and wait for the reset. It reads only your rate-limit figures, makes no network calls and keeps a small record of which warnings it already gave.

Review details

Static review of the source at the pinned commit; not run. Whole plugin reviewed again because the diff against the previous review was too large for a delta review. Declares a dependency on mod-events. Registers session.start, session.end and session.measure hooks. On a rateLimits change it compares percentUsed per limit kind (five_hour, seven_day) with fixed thresholds, and when a new band is crossed it calls $.session.append with a user-type message built from fixed text and the reset time; the 100% message tells Claude to schedule a wake-up if the reset is within 55 minutes, otherwise to tell the user to return, and to start no new work. The optional userConfig overage flag (default off) adds a sentence that further requests spend overage credits. The last announced band per limit is kept with $.state and cleared on /clear and /resume; a refused append is retried on the next measurement. A line is logged with $.ui.log and events go to $.modEvents.emit (crossings, ok flag, error), which mod-events writes to a local log. No fetch, process, file, env or settings access. The unresolved ../types import is a type-only declaration file (types/index.d.ts, 218 bytes) in the clone, not code. No npm dependencies.

What it uses
  • Reads your prompts: no
  • Sees tool calls: no
  • Blocks or changes tool calls: no
  • Reads or writes files: no
  • Runs programs on your machine: no
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: yes
  • Shows something on screen: yes
Hooked events
Made this mod? Add a badge to your README

modsforClaude badge for session-limit

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/session-limit.svg)](https://modsforclaude.com/mods/session-limit/)

← All mods