Skip to content
Skills Library
AI & agents · Planning

context-window-budgeting-token-optimization

/context-window-budgeting-token-optimization

Use this skill when calculate and optimize token budgets across system prompts, retrieved context, and completions.

Licence
MIT
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use this skill when calculate and optimize token budgets across system prompts, retrieved context, and completions.

Original author description

Use this skill when calculate and optimize token budgets across system prompts, retrieved context, and completions.

How it works

  1. When to use
  2. Core principles
  3. Step-by-step workflow
  4. Specifics & examples
  5. Common mistakes & pitfalls
  6. Verification checklist
  7. Related skills
Original SKILL.md headings · 42 lines, 370 words
SKILL.md preview
---
name: context-window-budgeting-token-optimization
description: Use this skill when calculate and optimize token budgets across system prompts, retrieved context, and completions.
---
# Context Window Budgeting Token Optimization

## When to use
Use this skill when calculate and optimize token budgets across system prompts, retrieved context, and completions. This applies across software engineering lifecycles, team code reviews, production debugging, prompt design, and architectural documentation.

## Core principles
- **Clarity Over Cleverness**: Code, prompts, and technical documentation must prioritize clarity, predictability, and long-term maintainability over obscure shortcuts.
- **Evidence-Based Engineering**: Every decision, bug resolution, and architectural choice must be supported by empirical data, minimal reproductions, or benchmark traces.
- **Cognitive Load Minimization**: Design interfaces, APIs, and documents to minimize mental parsing overhead for future engineers and autonomous agents.
- **Continuous Feedback Loops**: Incorporate automated verification, peer reviews, and post-task retrospectives to drive iterative improvement.

## Step-by-step workflow
1. **Define the objective and constraints**: State the exact technical outcome, acceptance criteria, and operational boundaries.
2. **Gather baseline telemetry and context**: Inspect relevant codebases, stack traces, system architecture diagrams, or log files.
3. **Execute structured analysis or implementation**: Apply domain-specific techniques (e.g., minimal reproduction, refactoring transforms, prompt templates).
4. **Validate against automated test assertions**: Run unit tests, linters, or schema validation parsers to verify behavioral correctness.
5. **Document rationale and trade-offs**: Record the 'why' behind choices, documenting rejected alternatives and operational considerations.
6. **Conduct retrospective review**: Share findings with stakeholders or record lessons learned in the team knowledge base.

## Specifics & examples
- **Standard Engineering Artifact**:
  - Scope: Context Window Budgeting Token Optimization
  - Core Deliverable: Actionable, verifiable engineering guidance aligned with Prompt & context engineering.
  - Verification Rule: Tested against production workflows and peer-reviewed standards.
- **Primary Focus Area**: Prompt & context engineering principles designed to elevate engineering precision and team psychological safety.

## Common mistakes & pitfalls
- Jumping directly into speculative fixes or complex rewrites before isolating the root cause.
- Introducing premature abstractions that increase indirection and cognitive complexity.
- Failing to document context and architectural trade-offs for subsequent maintainers.

## Verification checklist
[ ] The technical deliverable or fix is validated with reproducible test assertions.
[ ] Changes preserve backwards compatibility and maintain existing contract invariants.
[ ] Documentation or commit logs clearly explain the rationale and trade-offs.

## Related skills
- system-prompt-architecture-persona-constraints
- few-shot-prompting-exemplar-selection-formatting
- chain-of-thought-reasoning-step-by-step-prompts
- structured-output-prompting-json-yaml-parsers

Versions

The database has no other skills named context-window-budgeting-token-optimization.

Database snapshot: 13.11.2026 · package version edb0dbb70098 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90context-optimization
    Use when optimizing token usage, KV cache efficiency, or context window management for LLM agents. Keywords: context optimization, KV cache, prompt caching, token budget, semantic pruning, lost-in-the-middle.
  • 100context-optimization
    This skill should be used when the user asks to "optimize context", "reduce token costs", "improve context efficiency", "implement KV-cache optimization", "partition context", or mentions context limits, observation masking, context budgeting, or extending effective context capacity.
  • 100agent-context-budget-management-strategies
    Use this skill when monitoring, budgeting, and optimizing context window tokens during complex, multi-turn technical workflows.
  • 100cc-context-budgeting
    Manage Claude Code's context window — token arithmetic, /compact strategy, anchor preservation, progressive loading, session analytics. Use this skill whenever a session gets long, context approaches limits, after /compact, when deciding what to load into CLAUDE.md vs leave in…
  • 90token-budget
    Design token budgets — system/user/assistant allocation, overflow handling, context compression. Use when asked "we are blowing the context window", "design a token budget", or "handle context overflow".
  • 100check-context
    Accurately check current context window and token usage. Use when the user asks about context usage, token consumption, or when monitoring context levels.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.