Repository navigation
docs(web-app): when a fresh session takes over from an autopilot's own - #41
Merged
Merged
Conversation
kalaspuff
pushed a commit
to hyperstructure/fctl
that referenced
this pull request
Nov 10, 2026
## Summary
An autopilot can now hand off to a fresh session once its own session's
context reaches a size people choose: 150K, 250K or 400K tokens, or one
of their own from 100K to 1M, besides the 12-hour shift it already had.
The first wake that finds its session between turns with that much
context starts a fresh one and stops the old one. The fresh session gets
its briefing as before, then why it takes over ("You take over from your
last session, shop#2: its context held 412K tokens, past the 400K…"),
then the wake's news, and goes on from its plan, its log and `fctl
autopilot brief`. This matters because each wake reads the whole
conversation again, and after an hour's rest none of it is cached. A
770K-token session pays for 770K uncached tokens at nearly every
check-in; a fresh one pays for its briefing.
So the old session's working knowledge isn't lost: once its context
reaches three quarters of the size, each wake message tells it that a
fresh session takes over at its next wake. It also asks it to write down
in its plan and log what it's in the middle of, what it waits for and
what it learned, while its cache is still warm. The briefing now says
when a fresh session takes over, and asks it to keep its context lean:
read what it needs of a session rather than whole transcripts, and hand
long reading to a subagent.
- People choose it in the autopilot's settings dialog (*A fresh session
takes over*), with `fctl autopilot set --handoff-at 250k|never`, or in
the API's `PUT /api/v1/projects/{id}/autopilot` (`handoff_at`, `0` for
none). The tab's *How it works* card and `fctl autopilot` say when it
hands off and how full its session is now.
- Migration 0058 adds `autopilots.handoff_at`. The control plane reads
the session's context from D1's session stats, and the wake's log entry
says when a full context started a fresh session.
- It builds on #506 (merged), whose token sizes it uses.
Verified with unit tests (Rust and web) and `cargo xtask check --quick`,
and in `cargo xtask dev` with fake-claude. I put the playground on
autopilot with `--handoff-at 100k`. With its session's recorded context
set to 80K, a wake told it in the same session that the handoff is near.
At 120K, the next wake started playground#4 with the takeover message,
stopped #2, and logged "Woke for someone waking it, session #3, in a
fresh session: the last one's context held 120K tokens".
How it works, before and after:


The settings dialog, before:

After, with a size of people's own:

The choices, in the dark theme:

On a phone:

Related:
- #506
- hyperstructure/design#41
## Worth confirming
- **Decision:** There's no default: autopilots hand off only after 12
hours until someone chooses a size. A default such as 250K would save
the most for everyone, but it would change how running autopilots work.
- **Decision:** The sizes offered (150K, 250K, 400K) are smaller than
the compaction choices in #506. A fresh autopilot session starts at
about 40K tokens (Claude Code's prompt, the briefing and the brief), and
its plan and log carry the work.
- **Decision:** Changing the handoff counts as changing how much the
autopilot works. Someone other than its owner who changes it takes it
over, unless the owner keeps it, as with its model.
- **Decision:** A session at work never hands off mid-turn; the first
wake after its turn does. A session that compacted back below the size
carries on.
- **Decision:** The briefing now also asks the autopilot to read only
what it needs of its sessions and to hand long reading to subagents.
This goes beyond the handoff itself, but it targets the same cost.
- **Assumption:** Claude Code keeps a subscription's prompt cache for an
hour (2.1.322 gives subscribers within their limits a 1-hour TTL), which
is what "uncached after an hour's rest" says.
[fctl session](https://app.fctl.sh/s/ses_01M73FHWT0DV6X1X2XQYKMHBVT)
<!-- FCTL_REVIEW_SUMMARY -->
---
> [!NOTE]
> **Medium risk.** It changes when an autopilot's session is stopped and
replaced, which every autopilot wake goes through, and adds a migration
for a new `handoff_at` column.
>
> **What it does.** Lets an autopilot hand off to a fresh session once
its current session's context passes a chosen size (150K, 250K, 400K or
a custom 100K to 1M tokens), besides the existing 12-hour limit. The old
session is warned at three quarters of the size to write down its state,
and the fresh one gets a briefing and the reason for the takeover. The
size is set in the settings dialog, with `fctl autopilot set
--handoff-at`, or in the API's `handoff_at`.
>
> **Migration 0058.** Adds the `autopilots.handoff_at` column, which
must be applied before the control plane that reads it is deployed.
>
> <sub>[fctl
review](https://app.fctl.sh/s/ses_01M73M2GGQYRXQF59D2TXJ78F2)'s first
look at
[`f9cb4b2`](f9cb4b2)
· 20 files, +716 −58 · [Review agent
settings](https://app.fctl.sh/p/fctl?tab=reviews)</sub>
<!-- /FCTL_REVIEW_SUMMARY -->
---------
Co-authored-by: fctl-sh[bot] <fctl-sh[bot]@users.noreply.github.com>
kalaspuff
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Describes when a fresh session takes over from an autopilot's own: the A fresh session takes over Select and Tokens field in its settings dialog, with their copy, and the line on the tab's How it works card that says when, and how full its session is now.
fctl session
Note
Low risk. It only changes a design doc, adding copy and behavior for a setting that the linked fctl pull request implements.
What it does. Documents the new autopilot setting for when a fresh session takes over from its own: the Select and Tokens field in the settings dialog, their copy, and the line on the How it works card that says when, and how full its session is now. It follows hyperstructure/fctl#508, which builds the feature.
fctl review's first look at
be61c91· 1 file, +11 −1 · Review agent settings