Skip to content

Token Limits Configuration

waza tokens check enforces per-file token budgets so skills stay within the context window constraints required for submission.

Token limits are resolved in this order — the first source that provides limits wins:

PrioritySourceNotes
1.waza.yamltokens.limitsRecommended. Workspace-level config.
2.token-limits.json in the skill directoryLegacy fallback. Emits a deprecation warning.
3Built-in defaultsApplied when neither source is present.

Add a tokens section to your project’s .waza.yaml to manage all limits in one place:

tokens:
warningThreshold: 2500 # Print a warning when a file exceeds this many tokens
fallbackLimit: 2000 # Limit applied to files that match no pattern
limits:
defaults:
"SKILL.md": 500
"references/**/*.md": 1000
"*.md": 2000
overrides:
"README.md": 3000
FieldTypeDefaultDescription
warningThresholdinteger2500Token count at which a soft warning is shown
fallbackLimitinteger1000Limit for files that match no pattern
limits.defaultsmap(built-in)Glob patterns → token limits
limits.overridesmap{}Exact file paths → token limits (take precedence over defaults)

Both limits.defaults and limits.overrides are optional — you can set only one of them. If tokens.limits is present in .waza.yaml but neither map is set, .token-limits.json is not consulted as a fallback; .waza.yaml is the definitive source.

Skills that don’t use .waza.yaml can still configure limits in a .token-limits.json file placed inside the skill directory:

{
"description": "Optional human-readable description",
"defaults": {
"SKILL.md": 500,
"references/**/*.md": 1000,
"*.md": 2000
},
"overrides": {
"README.md": 3000
}
}
FieldRequiredTypeDescription
descriptionNostringIgnored by the CLI; for humans only
defaultsYesobjectGlob patterns → token limits
overridesNoobjectExact file paths → token limits

The same pattern matching rules apply to both .waza.yaml limits.defaults and .token-limits.json defaults.

Entries in overrides match by suffix — the pattern is compared against the end of the normalized file path:

overrides:
"README.md": 4000 # matches ./README.md and subdir/README.md
"docs/API.md": 3000 # matches ./docs/API.md and subdir/docs/API.md

Overrides are checked before defaults and always take precedence.

PatternMatches
*.mdAny .md file at any depth
SKILL.mdFiles named exactly SKILL.md in any directory
references/*.md.md files directly in references/
references/**/*.md.md files in subdirectories of references/
docs/**/*.md.md files in subdirectories of docs/
SyntaxMeaning
*Any characters except /
**Any characters including / (recursive)
/Directory separator; patterns containing / are anchored to the project root
.Literal dot (automatically escaped)

When multiple patterns in defaults match the same file, the most specific pattern wins:

  1. Exact match (no wildcards): +10 000 points
  2. Path depth: +100 points per / in the pattern
  3. Single wildcards (*): +10 points each
  4. Globstars (**): −50 points each
  5. Pattern length: +1 point per character

Example — resolving references/test-templates/jest.md:

PatternSpecificityResult
*.mdLowFallback
references/*.mdMediumNo match (file is nested)
references/**/*.mdMedium-highMatch
references/test-templates/*.mdHigherWins

When neither .waza.yaml nor .token-limits.json provides limits, these defaults apply:

{
"defaults": {
"SKILL.md": 500,
"references/**/*.md": 1000,
"docs/**/*.md": 1500,
"*.md": 2000
},
"overrides": {
"README.md": 3000,
"CONTRIBUTING.md": 2500
}
}

Given this .waza.yaml configuration:

tokens:
limits:
defaults:
"SKILL.md": 500
"references/*.md": 2000
"references/**/*.md": 2000
"references/test-templates/*.md": 1500
"*.md": 4000
overrides:
"README.md": 4000
FileMatching RuleLimit
SKILL.mdSKILL.md in defaults500
README.mdREADME.md in overrides4000
references/scoring.mdreferences/*.md2000
references/test-templates/jest.mdreferences/test-templates/*.md1500
assets/guide.md*.md4000
  1. Copy the defaults and overrides maps from .token-limits.json into .waza.yaml:

    tokens:
    limits:
    defaults:
    "SKILL.md": 500
    "*.md": 2000
    overrides:
    "README.md": 3000
  2. Delete (or keep for reference) .token-limits.json.

  3. Run waza tokens check — no more deprecation warning.