context-engineering

context-engineering is a skill for Claude Code from komluk/scaffolding. It costs 62 tokens per session (1,221 once invoked), scanned A, original, MIT.

A method for choosing and organizing the information given to Claude Code, an AI coding assistant, so it can work within its context window. The context window is the amount of project and conversation information the assistant can consider at once.

In plain words
What is it for?
Use it when a conversation approaches context limits, when preparing prompts, after major refactoring, when switching tasks, or when the supplied project information feels outdated. It covers trimming, measuring, and prioritizing project instructions and documentation.
Why use it?
It helps prevent important details from being crowded out by old, repeated, or irrelevant material. This can improve task accuracy and control the amount of context used.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions Claude Code.

Part of the scaffolding plugin — 39 skills, 9 commands, 13 agents shipped together

Good fit Use it when a conversation approaches context limits, when preparing prompts, after major refactoring, when switching tasks, or when the supplied project information feels outdated. It covers trimming, measuring, and prioritizing project instructions and documentation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/komluk/scaffolding/context-engineering
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add komluk/scaffolding --skill context-engineering
Clone the repo
git clone --depth 1 https://github.com/komluk/scaffolding

Made for: Claude Code.

Or install scaffolding, the plugin that ships this one along with the rest of its 39 skills, 9 commands, 13 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/komluk/scaffolding/context-engineering/github.svg)](https://agentmods.dev/skills/komluk/scaffolding/context-engineering)
Your own site
<a href="https://agentmods.dev/skills/komluk/scaffolding/context-engineering"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/context-engineering/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-engineering

Your own site · 80×15
<a href="https://agentmods.dev/skills/komluk/scaffolding/context-engineering"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/context-engineering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,221 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.01221
Opus 5.5 $0.00025 $0.00488
Sonnet 5.5 $0.00012 $0.00244
Haiku 4.5 $0.00006 $0.00122

Measured 1mo ago against content hash 3d8a34f271ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

context-engineering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/context-engineering/SKILL.md · 199 lines

How it starts

The opening of the file, as written. The whole thing — 199 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context Engineering Skill

Optimizes Claude Code context for better performance and accuracy.

Tracked files in repo: !git ls-files 2>/dev/null | wc -l || true

Auto-Invoke Triggers

  • Every 50 messages in conversation
  • After major refactoring
  • When context feels stale
  • Task switching
  • User requests /context command

Context Principles

Active Curation

  • Keep only relevant information
  • Remove completed task details
  • Archive outdated patterns
  • Focus on current work

Signal-to-Noise Ratio

High Signal Low Signal
Current APIs Old experiments
Active patterns Completed tasks
Recent decisions Historical context
Project structure Implementation details

Token Budget

File Limit Purpose
CLAUDE.md < 2000 tokens Quick reference
Agent docs < 500 per agent Role definition
Skills < 300 per skill Methodology

Context Analysis Process

Step 1: Measure Current State

## Context Analysis

### Token Counts
- CLAUDE.md: XXX tokens
- Agent docs: XXX tokens total
- Skills: XXX tokens total
- Total: XXXX tokens

### Staleness Check
- [ ] Last updated: [date]
- [ ] References current project state
- [ ] No deprecated APIs/patterns

Step 2: Identify Issues

### Issues Found

#### Stale Content
- Section X: Outdated [reason]
- Section Y: No longer relevant

#### Redundant Content
- Duplicated in files A and B
- Can consolidate X and Y

#### Missing Content
- Current API not documented
- New pattern not captured

Step 3: Optimization Actions

### Optimization Plan

1. **Archive**: Move section X to knowledge-core.md
2. **Remove**: Delete duplicate Y
3. **Update**: Refresh API documentation
4. **Add**: Document new pattern Z

CLAUDE.md Structure

Optimal structure for quick reference:

# Project Name

[One-line description]

## Quick Reference
| Action | Command |
|--------|---------|
| Run | command |
| Test | command |
| Build | command |

## Agent System
[Link to detailed docs]

## Tech Stack
- Frontend: [stack]
- Backend: [stack]

## Project Structure
[Key directories only]

## Key Rules
1. [Critical rule]
2. [Critical rule]

Read the full file on GitHub · 199 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 199 lines · 62 tokens per session scan A 3d8a34f271ef

Subscribe to this mod's changes

context-engineering is a skill published in the GitHub repository komluk/scaffolding (15 stars, last pushed yesterday), licensed MIT. It adds 62 tokens to every session and 1,221 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

ai-workflow-architect

Designs AI systems, automations, and agent workflows for a business — identifying which manual work is worth automating, how to structure the system, which tools fit, and what could go wrong. Use this to automate part of an operation, design an agent or MCP workflow, reduce repetitive manual work, connect tools into a…

cbrock84/headcount · 89 tokens

build-dotnet-agent-service

Build a local-first F# or C# Semantic Kernel agent service with explicit tools, model capability checks, evaluation fixtures, and draft-before-write promotion.

gaelic-ghost/socket · 36 tokens

prompt-cookbook

Build a prompt cookbook for one company's actual vertical and roles rather than generic examples. Each recipe names the job it does, who runs it, the prompt itself, what good output looks like, and how to tell when it went wrong. Written for people who have never written a prompt and will not read documentation about…

enalbenerraw/blanewarrene · 69 tokens

skill-meta-prompt

Craft better prompts using proven optimization techniques — use when your prompt needs refinement.

nyldn/claude-octopus · 19 tokens

flux-txt2img

Build Flux txt2img workflows with Flux.1 Dev (SRPO), Flux 2 Klein 9B, Turbo LoRAs, FluxGuidance, and DualCLIPLoader patterns.

artokun/comfyui-mcp · 44 tokens

prompt-engineering

ComfyUI prompt engineering knowledge covering CLIP text encoding syntax, weight modifiers, model-specific prompting strategies, and best practices.

artokun/comfyui-mcp · 28 tokens