Repository navigation
Description
Sessions run on each person's own Claude subscription, and organizations give their people Claude Team or Enterprise seats for it. A workspace's admins can't see who in it has Claude connected, which plan their sessions run on, whose connection stopped working or whose long-lived token runs out next month: they learn it when someone's sessions fail. fctl can't warn anyone either: it never learns that a long-lived token stopped working, and the expiry it records for one is a guess it shows nowhere.
How it works now
- What fctl keeps.
claude_credentials(crates/fctl-control/migrations/0001_init.sql, then0029,0043,0068):kind(setup_tokenoroauth),label,account_email,subscription_type,rate_limit_tier,status(activeorinvalid),expires_at,created_at,last_used_at,on_runners,provisioned(an admin token set it). People see their own in Settings → Claude andfctl claude status. A person's sessions in a workspace run on the one they chose for it (workspace_members.credential_id), else their default, else their newest active one (api::sessions::credential_for). - The plan. Only a full login records
subscription_typeandrate_limit_tier, from its sign-in (FleetDO'sstore_login). A long-lived token is kept with theuser:inferencescope and no plan; the app tells only Ultra apart, by the limits its sessions report (fctl_domain::usage::is_ultra,web/src/lib/usage.ts). - Expiry. docs/security.md says a long-lived token works until a year after
claude setup-tokenmade it. fctl can't tell when that was: it recordsexpires_ata year after the token was connected (api::claude::add_token,api::provision::set_claude). An admin token that sets the same token again moves it a year on and deletes its usage readings (api::provision::replace_claude), so a provisioning job that sets it on every run keeps it a year away. A token kept on runners has none (hosts report when they saved it,RunnerClaudeToken.saved_at); a login's is its access token's, renewed within hours (spec::refresh). Neither Settings → Claude norfctl claude statusshows it. - Ended. A login turns
invalidwhen Claude refuses to renew it (spec::refresh), and Settings marks it as needing reconnecting (web/src/lib/settings.ts). A long-lived token is never renewed, so fctl never finds one ended (EndedLogininweb/src/components/claude/connect.tsxsays so): sessions on a revoked or expired token fail with Claude's error while it reads active. - Last used.
last_used_atis when a run last took the credential, or its host asked for it again (spec::claude_credential), whether Claude accepted it or not. - Usage limits.
claude_usagekeeps each limit's latest reading per credential (crates/fctl-control/migrations/0008_claude_usage.sql,crate::usage::record). A session that reaches one pauses (BillingGuard::LimitReachedinfctl_domain::events, aPausednotification, thesession.pausedwebhook); nothing counts how often a person's sessions do. - What admins see. The People tab shows admins who has two-factor sign-in (
WorkspaceMember.two_factor), nothing of Claude. With an admin token,GET /api/v1/admin/users/{user}gives the token an admin token set (AdminUser.claude: label, status, default, dates, no expiry), andAdminClaudeToken's doc comment (crates/fctl-proto/src/api.rs) says "Their own Claude connections are theirs alone". Admin tokens set and remove that token (PUTandDELETE /api/v1/admin/users/{user}/claude, docs/organizations.md#people-from-your-directory) on self-hosted instances that take them. - Telling people. Email is optional (
crates/fctl-control/src/email.rs,Features.email): invitations, resets, notices such as a new Claude connection (api::claude::connected_notice). Web Push is about sessions (fctl_domain::notify::Kind). - Subscriptions only. fctl refuses API keys (
fctl_domain::claude::setup_token_problem) and stops sessions that would bill an API account or paid extra usage (fctl_domain::events::billing_guard): an organization that wants one bill gives its people Team or Enterprise seats.
What should happen
- fctl knows when Claude last accepted each connection, and marks a long-lived token Claude refuses as ended. (feat: show admins who has Claude connected and whose token runs out #640)
- fctl keeps a long-lived token's expiry as well as it can be known, and shows it to its person. (feat: show admins who has Claude connected and whose token runs out #640)
- fctl counts, for 30 days, how often sessions on each connection paused on a usage limit. (feat: show admins who has Claude connected and whose token runs out #640)
- A workspace's admins see, on its People tab and with the CLI, each member's connection there: kind, plan, state, Claude's last answer, expiry and limit pauses, never the token. (feat: show admins who has Claude connected and whose token runs out #640)
- People and their admins hear before a token runs out, and as soon as one stops working: in the app, and by email where the instance sends it. (feat: show admins who has Claude connected and whose token runs out #640)
- The view points to where seats are set; docs/, docs/llms.txt and fctl-site's privacy policy say what admins see. (feat: show admins who has Claude connected and whose token runs out #640, docs(legal): say what workspace admins see of members' Claude seats fctl-site#139, docs(web-app): describe Claude on the People tab and a token's expiry design#77)
Recording. claude_credentials.answered_at, set as usage::record stores a reading and as a run's first answer from Claude arrives, since both mean Claude accepted the token. fctl-agent recognizes Claude's authentication error and reports it (a new optional field), and the control plane marks the connection invalid, as it does a login it can't renew, once more than one session saw it, so that an outage doesn't. Setting the same token again keeps its expiry (the control plane compares it with the one it holds), and AddClaudeTokenRequest takes an optional made_at; otherwise the year from connecting stays, and copy says "around". Limit pauses get a row each (connection, window, when), deleted after 30 days.
For admins. GET /api/v1/workspaces/{id}/claude (its admins): each member and the connection credential_for finds for them there, with its kind and who set it, plan where known, state (works, ended, never used), answered_at, expiry and whether it's estimated, limit pauses in 7 and 30 days, and whether their sessions are paused now. Never the token, its account's email or a label its person gave it. AdminUser.claude gains the expiry.
Warnings. The hourly job finds connections whose expiry is within 30 days, then 7, and tells their person once at each (claude_credentials.warned_at): an amber line under it in Settings → Claude, the mark Settings already shows an ended login, a card on the Agent Floor in the last week, and email where the instance has it. Admins see it on the People tab. An ended connection is told at once, the same ways.
Design and UX
An admin should see at a glance whether everyone in Acme can run sessions this week and next, and know exactly what to do about each person who can't, without ever seeing anyone's token, while each person knows what their admins see.
- Where. Acme's People tab, for admins, beside the two-factor facts they see there. Not a tab: admins see nine already.
- The summary, above the list: "11 of 12 people have Claude connected for Acme · 2 tokens run out within a month · 1 stopped working", then pills that narrow the list, with counts, those at zero left out: Everyone, No Claude, Runs out soon, Stopped working, Pausing on limits.
- Each row gains a facts line under the address: "Long-lived token, set by an admin token · Team · Claude answered 2h ago · runs out around Dec 14" (the date amber within 30 days); "Claude login · Max · answered 5m ago"; "Token on her runners · plan unknown · answered yesterday"; "No Claude connection for Acme: her sessions here can't start" in amber; "Claude refused it on Nov 20: her sessions here can't run" in red.
- Opening it (in place; a sheet on a phone) says it whole: "Grace's sessions in Acme run on a long-lived token an admin token set on Dec 14, 2025, on a Team plan. Claude last answered it 2 hours ago. It runs out around Dec 14, 2026, a year after it was set: fctl can't read the date from the token. Her sessions paused on usage limits 6 times this week, the last on the weekly limit." Then the way out: where the instance takes admin tokens, "Set her a new one with an admin token, from a token claude setup-token printed:" and a CodeBox,
fctl admin users set grace@acme.dev --claude-token - --claude-label "Acme seat"; elsewhere, "Grace connects a new token in Settings → Claude: fctl has told her too." [Copy the link to her Settings → Claude]. Frequent pauses say "Her plan's limits are short for this work: a Max or Ultra seat has more." - First visit, while nobody has Claude connected for Acme: "Claude for everyone in Acme", the lead "Acme's sessions run on each person's own Claude subscription: 3 of its 12 people have connected one. You see whether their sessions can run and when their tokens run out, never the tokens.", and two example rows as a preview.
- The person's side. Within 30 days, under the connection in Settings → Claude: "Runs out around Dec 14. Make a new one with claude setup-token and paste it here before then, or your sessions stop." [Connect a new token]. The workspace's Settings → You says: "Acme's admins see what kind of Claude connection your sessions here run on, its plan, when Claude last answered it and when it runs out: never the token or the account." The email: "Your Claude token for fctl runs out around Dec 14", how to make a new one, the link.
- States. Loading: the facts lines as skeletons, never "No Claude connection" first. Failed: "Claude connections didn't load: … Try again", the people still listed. An empty pill: "Nobody's token runs out within a month." Members see none of it about others.
- CLI.
fctl workspaces members -w acme --claude, with--expiring 30d,--problemsand--json;fctl claude statusadds "runs out around Dec 14".
$ fctl workspaces members -w acme --claude
NAME CLAUDE PLAN ANSWERED RUNS OUT LIMIT PAUSES (7D)
Ada Lovelace login Max 5m ago - 0
Grace Hopper token, set by admin token Team 2h ago ~Dec 14 (21d) 6
Linus Lee none - - - -
1 person has no Claude connection for Acme: their sessions here can't start.
Building it:
- Follow hyperstructure/design's docs:
docs/principles.md;docs/web-app/explaining.mdfor pages that set something up (a headline that names the outcome, a lead built from this place's facts, a preview of the result, one primary action, and who can act);docs/web-app/kit.mdfor controls. - Design every state before building it: the first visit, loading, errors and refusals, waiting, partial setups and long lists.
- Say what happens, plainly, and never leave someone at a disabled control without saying who can act.
- Prototype the main screens with realistic data (
cargo xtask demo's world) and review them before building the rest. - Check both themes, a phone's width, the keyboard, screen readers and reduced motion, and show screenshots in each pull request.
- Give the CLI the same care: readable output,
--json, and errors that say what to do next. - Add or update the pages of hyperstructure/design's docs for each new component, with the reasons behind its choices.
Compatibility
- D1 migrations:
claude_credentials.answered_atandwarned_at, and a table of limit pauses. - Protocol: optional fields on
ClaudeCredentialInfo,AdminClaudeTokenandAddClaudeTokenRequest, a new type for the workspace's list, and fctl-agent's report of a refused token as an optional field; thencargo xtask gen. Agents one version behind report nothing new, and their sessions on a refused token fail as today. Detecting refusals needs a release; the rest a deploy, with the CLI's flags in the next release. - Email goes out only where the instance has it; Email notifications when a session waits for you or fails #49 covers email about sessions.
- Docs: docs/organizations.md (People from your directory, Oversight), docs/security.md#access, docs/cli.md, docs/api.md, docs/architecture.md#claude-credentials and docs/llms.txt.
- fctl-site's
legal/privacy.md: workspace admins see facts about members' Claude connections; fctl keeps when Claude last accepted each one and 30 days of limit pauses; it emails people before their token runs out.
Decisions for a person
- How much admins see of a connection its person made, which
AdminClaudeToken's doc keeps theirs alone: kind, plan, state and expiry as proposed, or only whether their sessions can run. - Whether admins see usage-limit pauses, or only that a member's sessions are paused now.
- Whether admins get email about tokens that run out or stopped working, each or as a weekly digest.
- Whether Admin → People shows the same for the whole instance, where seats are set with admin tokens.
- How many refusals mark a long-lived token ended, and whether fctl checks a token that hasn't run in a while.
Refs #49
Session: https://app.fctl.sh/s/ses_01M8450BECFP8DN88R0ZP0N0MS
Activity
fix: keep a replaced token's refusals and a pasted token's date from …
docs(web-app): the facts line's shade and words as the app draws them
feat(control): export what fctl keeps of each Claude connection
docs(legal): say every fact admins see, the emails and their basis
docs(legal): state the same rule for what admins see in both places
docs(legal): name the lower level by the facts it keeps
fctl-sh commentedon Nov 24, 2026
Done in #640 (merged as 41ec80b), with hyperstructure/fctl-site#139 (privacy policy) and hyperstructure/design#77 (design docs).
GET /api/v1/workspaces/{id}/claudeand/api/v1/admin/claude) and the web app (People tab, workspace and instance settings, Settings → Claude, Agent Floor). The docs and the privacy policy are live on fctl.sh.fctl workspaces members --claude,fctl admin claude, the new--claude-*flags offctl workspaces setandfctl admin set,--made-at/--claude-made-at, and the expiry lines infctl claude status. Agents and hosts need no update: the control plane reads Claude's refusals from the events sessions already send.The decisions this issue left open are settings (Claude seats, ADR 0098): how much workspace admins see (details by default, readiness or nothing, capped by the instance), whether they see limit pauses (on), email to admins (weekly by default, each, or off), Admin → People showing everyone's (off), and refusals that end a token (2, 1 to 5). fctl doesn't check tokens that haven't run.