kodebeat / papers / ai

Surviving a session limit without losing the session

A PTY wrapper that waits out the session limit and resumes.

Runs the Claude Code CLI inside a PTY, parses the reset time from the limit banner, sleeps until then and resumes the same session. A transparent wrapper: real window size and resize handling, so the TUI behaves normally and Ctrl-C still works inside claude. Standard library only, nothing to install.

What is in it

  • The problem — what goes unanswered without it, and who notices first.
  • Why the obvious alternative falls short — stated plainly, including where it is the better choice.
  • How it works — the method, not a feature list.
  • Concrete use cases — with console output quoted from the repository, never reconstructed.
  • The methodology behind any number it emits — every term shown, so the figure survives a question.
  • What it deliberately does not do — the section most papers leave out.

Part of the AI infrastructure theme.

Get the PDF

One email with the download link, and this paper already selected. No follow-up sequence.

Send it to me