context-engineering

context-engineering is a skill for Claude Code from krzysztofsurdy/code-virtuoso. It costs 75 tokens per session (3,790 once invoked), scanned A, original, MIT.

A context-engineering guide for controlling what an AI coding agent reads and remembers during a task. It covers concise rules, loading information only when needed, and storing progress outside the conversation.

In plain words
What is it for?
It is for shortening agent rule files, organizing project instructions, planning context compaction, and writing progress notes.
Why use it?
Long or unfocused instructions can crowd out useful code and make an agent forget important rules. This guide helps reduce that overload and limit drift during long sessions.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Part of the knowledge-virtuoso plugin — 18 skills shipped together

Good fit It is for shortening agent rule files, organizing project instructions, planning context compaction, and writing progress notes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/krzysztofsurdy/code-virtuoso/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 krzysztofsurdy/code-virtuoso --skill context-engineering
Clone the repo
git clone --depth 1 https://github.com/krzysztofsurdy/code-virtuoso

Made for: Claude Code.

Or install knowledge-virtuoso, the plugin that ships this one along with the rest of its 18 skills.

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/krzysztofsurdy/code-virtuoso/context-engineering/github.svg)](https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/context-engineering)
Your own site
<a href="https://agentmods.dev/skills/krzysztofsurdy/code-virtuoso/context-engineering"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/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/krzysztofsurdy/code-virtuoso/context-engineering"><img src="https://agentmods.dev/badge/skills/krzysztofsurdy/code-virtuoso/context-engineering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,790 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.00075 $0.03790
Opus 5.5 $0.00030 $0.01516
Sonnet 5.5 $0.00015 $0.00758
Haiku 4.5 $0.00007 $0.00379

Measured 2d ago against content hash 0d2acf17d5ec, 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 2d 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/knowledge/context-engineering/SKILL.md · 174 lines

How it starts

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

Context engineering

An agent's context window is a budget, not storage. Every token it reads competes for attention with every other token, and reliability falls as the window fills (context rot). The job is to give the agent the smallest set of high-signal tokens for the step it is on, and to load everything else only when needed.

Core Principles

Principle Meaning
Smallest high-signal set Each line in an always-loaded file must change behavior. If the agent would do the right thing without it, delete it.
Load by need, not by default Always-on files cost tokens on every turn. Path-scoped rules, skills and docs cost tokens only when used.
Instructions, not overviews Agents follow specific rules well. Repository tours and architecture summaries mostly add cost.
Point, do not paste Give a path or a command and let the agent read it. Pasted copies go stale.
Write state outside the window Progress that matters lives in a file, not in conversation history that compaction will summarize.
Enforce with tools, advise with text A rule that must hold every time belongs in a hook, linter or test. Text is guidance the agent may drop.
One source of truth Write each rule in one file. Project rules go in AGENTS.md, and tool files import it or hold only tool-specific lines.
Measure before adding Context files can lower success and raise cost. Add one only for a failure you have seen.

Evidence that more context can hurt

Source Finding
ETH Zurich and LogicStar, arXiv 2602.11988 (2026) Repository context files did not generally improve task success and raised inference cost by more than 20% on average, for both generated and developer-written files. Agents followed specific instructions, but repository overviews did not help. Useful for non-standard practices.
Vercel, AGENTS.md outperforms skills (2026-01-27) On framework-API tasks, a passive 8 KB docs index in AGENTS.md passed 100%. Skills left on default behavior passed 53% (same as no docs) because the agent never invoked them in 56% of cases.
Chroma, context rot Model reliability drops as input length grows, even on simple tasks.
Thoughtworks Radar vol. 34 (2026-04) Adopt context engineering and curated shared instructions. Caution on agent instruction bloat.

Read the full file on GitHub · 174 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago Changed · +1 lines 0d2acf17d5ec
  2. 3d ago Changed · +34 lines 26f18154f5f6
  3. 4d ago First seen · 139 lines · 75 tokens per session scan A 2221c8718a94

Subscribe to this mod's changes

context-engineering is a skill published in the GitHub repository krzysztofsurdy/code-virtuoso (36 stars, last pushed 2d ago), licensed MIT. It adds 75 tokens to every session and 3,790 once invoked, about $0.0003 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-10-22.