XFTC
XF Token Control · XFTC

Shows you what's draining your context — before you hit the wall.

Token drain is invisible until it's too late. MCP overhead compounds on every message. CLAUDE.md bloats quietly. Sub-agents spin up on expensive models when cheaper ones work fine. Context fills faster than you think. XFTC monitors every source of token cost in real time — and gives you the controls to stay in the window and on budget.

Connect with GitHub — it's free

What it does

1

Status bar — installed by XFTC, live in every session.

XFTC installs a status bar that's live at the bottom of every CC session — no setup required. It shows: Sonnet 4.6 | [████████░░] 63% | 118K / 200K tokens Model, context percentage, and exact token count vs. your window — always visible, always current. Installs automatically with XFTC.

2

60% threshold — snapshot + compact nudge.

When context reaches 60%, XFTC fires: snapshot your session with /xf-mem snapshot, then /compact. At 60% you still have a clean, complete transcript. The nudge is specific: run these two commands, in this order, now. This is the primary safety gate — take it seriously.

3

85% threshold — HIL block with go/no-go decision.

At 85%, XFTC blocks the next tool call and presents a go/no-go: (1) Snapshot + compact — recommended, (2) Snapshot only, (3) Compact only, (4) Continue anyway. You decide. Nothing proceeds until you answer. At 90%+ CC auto-compact runs and a clean snapshot cannot be guaranteed — 85% is the real last exit.

4

CLAUDE.md and MEMORY.md monitoring — notification and action.

CLAUDE.md over 200 lines? Every message burns more context loading instructions Claude Code has already internalized. XFTC flags it and presents fix options: run /dispatch-compact-md to move reference sections to ~/.claude/ref/, prune MEMORY.md if it's also bloated, or both. MEMORY.md with broken links or oversized entries gets its own action menu. Both checks fire once per session — with specific actions, not just warnings.

5

MCP overhead detection.

Every MCP server you have loaded adds tokens to every message — even servers you're not using. XFTC counts active vs. loaded servers and fires when the overhead is significant. Recommendation: /mcp disconnect unused servers. Fired once per session.

6

Sub-agent model enforcement.

When Claude Code spins up a sub-agent on an expensive model for a task a cheaper one handles fine, XFTC catches it at PreToolUse and blocks it. Model discipline is cost discipline. Reserve top-tier models for architecture and security audits — not grep operations and file reads.

7

Peak hours and cache timeout detection.

XFTC tracks whether you're working during peak API hours (8am–2pm ET weekdays) — when rate limits drain faster — and alerts you to defer large multi-agent runs. It also detects when your prompt cache has expired after a break, warning that full context is being reprocessed from scratch.

How it works

1

UserPromptSubmit fires on every message — XFTC checks CLAUDE.md size, MEMORY.md health, context fill %, MCP overhead, peak hours.

2

60% context: snapshot + compact nudge fires. Run /xf-mem snapshot then /compact.

3

85% context: enforcement block fires. Last safe exit — snapshot and compact now.

4

PreToolUse fires on every tool call — XFTC checks sub-agent model and verbose command patterns.

5

Stop fires at session end — last_stop_time recorded for cache timeout detection next session.

● ● ●
◎ XFTC context ~61% — snapshot + compact now to preserve full session
Run: /xf-mem snapshot then /compact
◎ XFTC ⚠️ context ~85% — LAST SAFE EXIT before auto-compact
At 90%+ CC auto-compact runs — snapshot cannot be guaranteed
◎ XFTC CLAUDE.md 287 lines (over 200 limit) — compact to reduce token load
◎ XFTC 3 MCP servers active (~4,200 tokens/message overhead)
Other modules