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

SHORT ANSWER

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.

01

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`
02

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.
03

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.

04

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 5
TRY IT

Start 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.
BOUNDARIES

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.
SOURCES

Evidence and sources

These links support the released behavior, public outcomes, or problem language described on this page.

Item budgetsBudget syntax, soft and hard behavior, and stopped items.Open evidence ↗Plan before you buildEntering and leaving the room on each host, shift-estimate, and check-items.Open evidence ↗
RELATED QUESTIONS

Continue from the question you have

estimate a shift from past receiptsRead the answer →see what each item costRead the answer →set a deadline and stall limitRead the answer →
FAQ

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.