import type { Profile } from '../profiles/index.js'; /** * Token budget for the set of profile rules auto-loaded into base context via `.claude/rules/`. * * Claude Code reads EVERY `.md` under `.claude/rules/` into base context at session start, so the * always-load set is a direct, unavoidable tax on the 200K window before any work begins (GH-373). * ~16K estimated tokens (≈64KB) keeps the primary role guidance available without consuming the * large base-context share observed in multi-profile native sessions. Everything else is read by * path on delegation (on-demand). */ export declare const CLAUDE_ALWAYS_LOAD_TOKEN_BUDGET = 16000; export declare const CLAUDE_ALWAYS_LOAD_BYTE_BUDGET: number; export type AlwaysLoadSplit = { /** Profiles auto-loaded into `.claude/rules/` (within the token budget). */ alwaysLoad: Profile[]; /** Profiles read by path from `.setup-agents/rules/` on delegation (everything else). */ onDemand: Profile[]; }; /** * Chooses which selected profiles are auto-loaded into `.claude/rules/` by a TOKEN BUDGET rather * than the binary `claudeAlwaysImport` flag (GH-373 follow-up). * * Selection (priority order = `claudeAlwaysImport` profiles first, then the rest in given order): * (1) `claudeAlwaysImport` profiles (developer, ta) are considered FIRST — they remain the priority primary roles when selected. * (2) Profiles are admitted in priority order until the next one would exceed the budget, then selection stops — a prefix of the priority order. We never skip an over-budget profile to admit a later smaller one, which would surprise the user with an out-of-order always-load set. * (3) At least ONE profile is always-loaded whenever any profile is selected, so the main agent always has a role profile in context — even if the first profile alone exceeds the budget (better in-context than the agent blind to its own role). * * Everything not selected for always-load is returned as `onDemand`. */ export declare function selectAlwaysLoadProfiles(profiles: Profile[], version: string, byteBudget?: number): AlwaysLoadSplit;