Documentation
Cap time and tokens per coding-agent item
Give each Claude Code, Codex, or Cursor item a soft and hard limit in working time, tokens, or both, and see what happens when an item reaches one.
Updated
How do I stop one item from eating the whole shift?
Add a Budget line to an item, or set one budget for every item that names none. A soft limit tells the agent once to start finishing; a hard limit allows only wrap-up from the next tool call, then closes the item as stopped with its work committed.
Write a budget
Each level is optional and takes a time, a token count, or both. Time is working time on the item across every session; tokens are input plus output.
- [ ] **2. Migrate the session store.**
- Verify: npm test -- session
- Budget: soft 30m / 1M tokens, hard 45m / 2M tokens
- Commit: `refactor: migrate the session store`Soft and hard limits
The two levels do different things.
- Soft: the next tool result tells the agent, once, to start finishing the item, and the shift log records when.
- Hard: from the next tool call only wrap-up is allowed: reading, git add and git commit, and writes to the receipts, punch list, and inbox. The agent commits the work in progress, writes the receipt, and closes the item as stopped.
- A response already being written finishes first; the limit acts between tool calls.
A stopped item
A stopped item is never ticked. The gate treats it as closed so the shift moves on, the morning receipt lists it among the decisions for you, and Archive keeps it live as open work. Reopening it is your edit.
Size budgets from your own history
The plan room and a terminal command read the time and tokens of every ticked receipt, live and archived, and print the median and range per item, a total, a suggested deadline, and a suggested Budget line. They are estimates from your history, never limits.
ns shift-estimate --items 5Start with a bounded prompt
This prompt names the outcome and preserves Nightshift’s review boundary. Paste it into the supported coding host from the project you want to change.
Suggest a Budget line for each item from my past receipts, then add soft and hard limits I approve.What this workflow does not claim
- A hard limit acts between tool calls, so a response already being written finishes first.
- A reading the host does not report never trips a limit.
Evidence and sources
These links support the released behavior, public outcomes, or problem language described on this page.
Frequently asked questions
Is an item budget a cap on the whole shift?
No. It bounds one item. The deadline and the stall limit bound the shift.
What if my host does not report tokens?
A reading the host does not give never trips a limit, so a time limit still works where token figures are missing.