Repository navigation
docs(web-app): where a project's sessions compact, on its Agents page - #40
Merged
kalaspuff merged 1 commit intoNov 10, 2026
Merged
Conversation
kalaspuff
pushed a commit
to hyperstructure/fctl
that referenced
this pull request
Nov 10, 2026
…ar (#506) ## Summary A project now chooses the context size Claude compacts its sessions near: 250K, 400K or 600K tokens, a size of its own from 100K to 1M, or Claude's default (near the model's whole window, 967K of 1M for Opus 5.5). Each step of a session reads its whole context again, so long sessions that compact sooner spend less of the plan. It's on Settings → Agents (a new Context section, with a Tokens field for "Another size"), in `fctl projects set --compact-window 400k|default`, in `fctl projects show`, and in the API as `settings.compact_window`. The control plane passes it to sessions with the project's variables, as Claude Code's `CLAUDE_CODE_AUTO_COMPACT_WINDOW`, so agents and hosts one version behind pass it to Claude too. That variable takes precedence over Claude's settings, a repository's included. Claude Code 2.1.322 accepts it as probed with `get_context_usage`: 250K compacts at 217K, 400K at 367K, sizes below 100K read as 100K, and sizes above the model's window are capped at it. The session's Work section then shows the context against that window. Review agents take their project's choice. An update that leaves the field out, from an older CLI or web tab, keeps what was stored. Verified with unit tests (Rust and web) and `cargo xtask check --quick`, and in `cargo xtask dev`: the CLI set it, the API refused 50K and kept it on an update without the field, and the session's Claude process had `CLAUDE_CODE_AUTO_COMPACT_WINDOW=300000`. Settings → Agents, before:  After, with a size of the project's own:  The choices, in the dark theme:  On a phone:  The design docs' description of the Agents page: - hyperstructure/design#40 The autopilot's handoff to a fresh session, stacked on this one: - #508 ## Worth confirming - **Decision:** The setting is Claude Code's auto-compact window, which Claude compacts about 33K tokens before (367K for 400K), rather than an exact threshold that fctl would turn into a window. Claude's buffer may change between versions, and the session page shows the exact point. - **Decision:** The bounds are 100K to 1M tokens, which is what Claude Code itself takes. "Claude's default" stands in for the "max (1M)" option, since it is the model's whole window. - **Decision:** A project variable `CLAUDE_CODE_AUTO_COMPACT_WINDOW` still applies where the project leaves the setting at Claude's default. Where both are set, the setting wins. [fctl session](https://app.fctl.sh/s/ses_01M73FHWT0DV6X1X2XQYKMHBVT) <!-- FCTL_REVIEW_SUMMARY --> --- > [!NOTE] > **Medium risk.** It adds a project setting that changes the environment every session of a project gets (`CLAUDE_CODE_AUTO_COMPACT_WINDOW`) and extends the stored settings, API, CLI and web app; it only takes effect where a project chooses a size. > > **What it does.** Adds `compact_window` to project settings so a project can choose the context size, from 100K to 1M tokens, that Claude compacts its sessions near. The control plane passes it to sessions as `CLAUDE_CODE_AUTO_COMPACT_WINDOW`, review agents take it too, and it is set from a new Context section in Settings → Agents or with `fctl projects set --compact-window`. An update that leaves the field out keeps the stored value, and the API refuses sizes outside the bounds. > > **Precedence over project variables.** Where a project chooses a size, it overrides a project variable of the same name; where it leaves Claude's default, such a variable still applies. > > <sub>[fctl review](https://app.fctl.sh/s/ses_01M73KQCWDZB7W9WSVJ2R73Q2E)'s first look at [`8893c4d`](8893c4d) · 19 files, +621 −16 · [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
kalaspuff
deleted the
fctl/1131-it-would-be-great-to-define-at-what-cont
branch
November 10, 2026 20:57
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 the Context section on a project's Settings → Agents page: its "Compact near" choices, the Tokens field for a size of the project's own, what its sentence says, and the gist "· compacts near 400K" in the list of Settings' pages on a phone.
fctl session
Note
Low risk. Documentation only: one file in docs/web-app describing a settings section.
What it does. Documents the new Context section on a project's Settings Agents page: the "Compact near" choices, the Tokens field for a custom size, what the section's sentence says, and the "compacts near 400K" hint in the phone page list. It also adds Context to the list of Agents sections.
fctl review's first look at
04eed43· 1 file, +5 −3 · Review agent settings