@felixgeelhaar/cclint
Version:
Catch CLAUDE.md drift before Claude misbehaves. Lints CLAUDE.md, skills, subagents, and hooks for Claude Code projects.
68 lines • 3.04 kB
TypeScript
/**
* Single source of truth for Claude model knowledge used by lint rules.
*
* @remarks
* Model knowledge drifts as Anthropic ships new versions. Rather than pin an
* exhaustive, quickly-stale allow-list of exact ids, this module prefers
* *shape validation* (does the id look like a real Claude model?) plus a soft
* advisory that asks the user to verify against the current model list. That
* way a brand-new version (e.g. a future `claude-opus-4-9`) is accepted
* without a code change, while obviously-wrong ids are still flagged.
*
* When re-verifying, check Anthropic's model docs and bump {@link LAST_VERIFIED}:
* https://docs.anthropic.com/en/docs/about-claude/models/overview
*
* @category Rules
*/
/**
* Date this model knowledge was last checked against Anthropic's model list.
*
* @remarks
* A freshness test asserts this exists so future maintainers are prompted to
* re-verify the families/aliases below rather than trusting them indefinitely.
*/
export declare const LAST_VERIFIED = "2026-07-11";
/** Current Claude model families (as of {@link LAST_VERIFIED}). */
export declare const MODEL_FAMILIES: readonly ["opus", "sonnet", "haiku", "fable"];
export type ModelFamily = (typeof MODEL_FAMILIES)[number];
/**
* Bare aliases accepted in subagent frontmatter `model:` fields.
*
* @remarks
* Every family doubles as a bare alias, plus `inherit` (use the parent
* session's model).
*/
export declare const MODEL_ALIASES: readonly ["opus", "sonnet", "haiku", "fable", "inherit"];
/**
* Shape validation for fully-qualified model ids, e.g. `claude-opus-4-8`,
* `claude-sonnet-5`. Intentionally shape-based rather than an exhaustive list
* so new versions drift in gracefully.
*/
export declare const MODEL_SHAPE_PATTERN: RegExp;
/**
* Extended shape that also tolerates an optional publish-date suffix
* (`-20251001`) and a `-latest` alias suffix, both of which appear in
* Anthropic's public model ids.
*/
export declare const MODEL_SHAPE_PATTERN_EXTENDED: RegExp;
/**
* Legacy Claude 3.x ids — still valid identifiers but deprecated by Anthropic.
*/
export declare const LEGACY_MODEL_PATTERN: RegExp;
/**
* A small set of currently-recommended model ids, used only for advisory
* messages. This is NOT an allow-list — keep it short and current.
*/
export declare const RECOMMENDED_MODELS: readonly ["claude-opus-4-8", "claude-sonnet-5", "claude-haiku-4-5"];
/** Human-readable list of {@link RECOMMENDED_MODELS} for advisory strings. */
export declare const RECOMMENDED_MODELS_TEXT: string;
/** True if `model` is a recognized bare alias (case-insensitive). */
export declare function isModelAlias(model: string): boolean;
/**
* True if `model` looks like a valid fully-qualified Claude model id,
* including optional date/`-latest` suffixes.
*/
export declare function isKnownModelShape(model: string): boolean;
/** True if `model` is a deprecated Claude 3.x identifier. */
export declare function isLegacyModel(model: string): boolean;
//# sourceMappingURL=claude-models.d.ts.map