
The challenge
Waiting on an AI agent creates many short breaks that usually end up on a phone instead of anywhere useful.
The approach
Built a Claude Code mod in TypeScript and TSX that draws one card at a time in the band above the prompt. Eight event hooks read only tool names, file extensions and the first word of shell commands to pick a topic; pure planner functions choose the next card and schedule reviews with a five-box Leitner system; and for topics beyond the shipped packs, Haiku writes new cards in the background, which must pass the same validator as hand-written ones.
The outcome
Short facts and yes/no questions about the work in front of you, hidden the moment Claude asks for permission, with missed cards brought back the next day. Ships 108 hand-written cards for JavaScript, Python and Git, generates cards for 14 more topics, and is published in the Claude Code plugin directory.
How Holdtime is put together
A Claude Code mod that runs inside Claude’s own window. Event hooks read only enough to pick a topic, pure planner functions choose and schedule cards, and a background request to Haiku tops up a shared library for topics the shipped packs do not cover.
- hand-written cards in three packs
- 108
- more topics with generated cards
- 14
- Leitner boxes, 1 to 16 days
- 5
- tests, no model called
- 68
01 · Claude Code
client
Claude Code session
client
Band above the prompt
ui.render
02 · Mod hooks
gateway
Event hooks
TypeScript · TSX
8 events
03 · Logic
service
Planner
topic, next card, Leitner boxes
service
Library pool
refill policy
04 · Cards & storage
database
Shipped packs
108 cards
database
Plugin store
progress, daily count, library
third-party
Claude Haiku
writes new cards
8 connections
- Claude Code session→Event hookstool name, extension
- Event hooks→Planner
- Planner→Shipped packs
- Planner→Plugin storeprogress
- Event hooks→Library poolbelow 6 ready
- Library pool→Claude Haikutopic name only · optional
- Library pool→Plugin storelibrary, max 240
- Event hooks→Band above the promptrender card
Request flow · Claude runs cargo test
- 1The tool.call hook reads the first word, cargo, bumps the Rust weight and passes the call through untouched.
- 2No pack covers Rust, so when fewer than six Rust cards are ready the pool asks Haiku for a batch in the background.
- 3Replies go through the same validator as shipped cards; anything malformed is dropped unread and the rest join the shared library.
- 4The planner picks the next due card and the band draws it above the prompt until Claude needs you.
Design decisions
- Claude always comes first
- The permission and notification hooks only hide the card and return next(e): they never allow, deny or alter anything.
- One bar for every card
- Shipped and generated cards pass the same isValidCard check, so the tests and the runtime filter agree on what a card is.
- Never blank
- The shipped packs fill in whenever the library is empty, the request fails or the machine is offline.
- Pure logic, tested directly
- Topic choice, scheduling and refill policy are plain functions; the band test answers the model call with a canned reply.
Trade-offs & known limits
- Card writing uses the user’s own Claude plan; turning it off limits cards to the three shipped topics.
- The store has no atomic increment, so two sessions answering at the same moment can lose one from the daily count; the daily goal is a soft cap, so that is accepted.
Have something similar in mind?
I'm open for freelance and contract work — let's talk about what you're building.