context-engineering

context-engineering is a skill for Claude Code from arturseo-geo/claude-code-skills. It costs 150 tokens per session (2,468 once invoked), scanned A, original, MIT.

A guide for managing the amount of conversation and project detail Claude Code can keep in memory. It explains context windows, automatic summarisation, and settings that control when summarisation happens.

In plain words
What is it for?
Use it when a session runs out of room, automatic compaction happens, context becomes less accurate, or you need to adjust compaction timing.
Why use it?
Long coding sessions can cause early details, exact errors, or decisions to be compressed and partly lost. This helps diagnose and reduce that loss of context.

Skill for Claude Code

Written for Claude Code: UserPromptSubmit hook event. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit Use it when a session runs out of room, automatic compaction happens, context becomes less accurate, or you need to adjust compaction timing.

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

Made for: Claude Code.

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/arturseo-geo/claude-code-skills/context-engineering.svg)](https://agentmods.dev/skills/arturseo-geo/claude-code-skills/context-engineering)
Your own site
<a href="https://agentmods.dev/skills/arturseo-geo/claude-code-skills/context-engineering"><img src="https://agentmods.dev/badge/skills/arturseo-geo/claude-code-skills/context-engineering.svg" alt="Measured on agentmods" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,468 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.00150 $0.02468
Opus 5 $0.00075 $0.01234
Sonnet 5 $0.00030 $0.00494
Haiku 4.5 $0.00015 $0.00247

Measured 8d ago against content hash 938fa6582554, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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 · 280 lines

How it starts

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

Context Engineering Skill

How Claude Code's Context Window Works

Claude Code's 200k context window is split across fixed overhead and your conversation:

Slot Typical size Notes
System prompt ~2.7k tokens Fixed
System tools ~16.8k tokens Fixed — all built-in tools
Custom agents ~1.3k tokens Per agent file loaded
Memory files (CLAUDE.md etc.) ~7.4k tokens Grows with your config
Skills (metadata) ~0.5–1k tokens ~100 tokens per skill description
Messages (conversation) Grows → triggers compaction Your actual work
Autocompact buffer 33k tokens Hardcoded — cannot be changed

Working limit: compaction fires at ~167k tokens (200k minus 33k buffer). When it fires, your precise early context (variable names, exact errors, decisions) gets lossy-summarised.


Autocompaction Control

# Default: fires at ~83.5% capacity
# Override to trigger earlier (more frequent, less data loss per event)
export CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=70

# Or later (longer sessions, more data lost when it fires)
export CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=90

Set in .claude/settings.json to persist:

{
  "env": {
    "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "70"
  }
}

Strategic compaction: run /compact manually at logical checkpoints (end of a feature, after a big refactor) instead of waiting for auto-fire. This gives you control over what gets summarised vs lost.

Focused compaction: guide what gets preserved:

/compact focus on the auth refactor decisions and the API contract

For the full autocompaction deep dive (triggers, thresholds, anti-patterns), read references/autocompaction.md.


Reducing Static Context Overhead

CLAUDE.md diet

Every line in CLAUDE.md loads every session. Keep it under 100 lines and under 500 tokens.

The Router Pattern — turn CLAUDE.md into a routing table, not a manual:

## Project: myapp
Stack: Next.js 15, Prisma, PostgreSQL
Use pnpm. API routes in src/app/api/.

| Keywords | Skill |
|---|---|
| deploy, release, CI | deploy |
| test, coverage | testing |
| schema, migration | database |

Read the full file on GitHub · 280 lines

Files

What ships with it

4 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. 8d ago First seen · 280 lines · 150 tokens per session scan A 938fa6582554

Subscribe to this mod's changes

context-engineering is a skill published in the GitHub repository arturseo-geo/claude-code-skills (11 stars, last pushed 5mo ago), licensed MIT. It adds 150 tokens to every session and 2,468 once invoked, about $0.0007 per session on Opus 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

continuous-learning-v2

Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.

sangrokjung/claude-forge · 33 tokens

memory-hygiene

Keep agent-written memory files from rotting. Audits /.claude/projects/ /memory/ for facts the tree now contradicts — stale version pins, passed sequence facts, vanished paths — plus MEMORY.md index drift, and enforces the memory format contract at write time. Use when the user says "audit my memory", "memory is…

alexmond/alexmskills · 103 tokens

learn-on-failure

Save a learning to project memory. Invoke automatically (without the user asking) whenever a task required more than one fix cycle to resolve — e.g. a test failed and needed a second attempt, a compile error required a correction, an API behaved unexpectedly, or an assumption proved wrong mid-task. Also invoke when…

alexmond/alexmskills · 100 tokens

letter-hooker

Erweitert automation-self-care um Letter Hooks, Preflight-Bootloader, Dokument-Traversierungsregeln und selbstheilende Prompt-Kontext- Anreicherung für KI-Agenten und CLIs ohne native, ereignisgetriebene JSON-Lifecycle-Hooks (wie Antigravity / Gemini CLI). Nutzen, wenn ein Agent Preflight-Regeln injizieren, vor…

ellmos-ai/skills · 129 tokens

hive.note-taking

Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.

aden-hive/hive · 30 tokens

security-compliance

Guides security professionals in implementing defense-in-depth security architectures, achieving compliance with industry frameworks (SOC2, ISO27001, GDPR, HIPAA), conducting threat modeling and risk assessments, managing security operations and incident response, and embedding security throughout the SDLC.

sangrokjung/claude-forge · 56 tokens