mcpbeat Sign in

Context Engineering Skill for Claude

>- Master context engineering for AI agent systems. Use when designing agent architectures, debugging context failures, optimizing token usage, implementing memory systems, building multi-agent coordination, evaluating agent performance, or developing LLM-powered pipelines. Covers context fundamentals, degradation patterns, optimization techniques (compaction, masking, caching), compression strategies, memory architectures, multi-agent patterns, LLM-as-Judge evaluation, tool design, and project development.

13k tokens
context cost
the whole folder, loaded on every use
17
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
2189
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/mrgoonie/claudekit-skills --skill context-engineering

What comes with it

46 669 bytes besides the instruction
references/context-compression.md
references/context-degradation.md
references/context-fundamentals.md
references/context-optimization.md
references/evaluation.md
references/memory-systems.md
references/multi-agent-patterns.md
references/project-development.md
references/tool-design.md
scripts/compression_evaluator.py
scripts/context_analyzer.py
tests/01-basic-context-optimization.md
tests/02-debug-lost-in-middle.md
tests/03-multi-agent-coordination.md
tests/04-edge-case-context-poisoning.md
tests/05-advanced-memory-architecture.md

The instruction itself

9 sections, as written by the author

Context Engineering

Context engineering curates the smallest high-signal token set for LLM tasks. The goal: maximize reasoning quality while minimizing token usage.

When to Activate

  • Designing/debugging agent systems
  • Context limits constrain performance
  • Optimizing cost/latency
  • Building multi-agent coordination
  • Implementing memory systems
  • Evaluating agent performance
  • Developing LLM-powered pipelines

Core Principles

  • Context quality > quantity - High-signal tokens beat exhaustive content
  • Attention is finite - U-shaped curve favors beginning/end positions
  • Progressive disclosure - Load information just-in-time
  • Isolation prevents degradation - Partition work across sub-agents
  • Measure before optimizing - Know your baseline

Quick Reference

| Topic | When to Use | Reference |

|-------|-------------|-----------|

| Fundamentals | Understanding context anatomy, attention mechanics | context-fundamentals.md |

| Degradation | Debugging failures, lost-in-middle, poisoning | context-degradation.md |

| Optimization | Compaction, masking, caching, partitioning | context-optimization.md |

| Compression | Long sessions, summarization strategies | context-compression.md |

| Memory | Cross-session persistence, knowledge graphs | memory-systems.md |

| Multi-Agent | Coordination patterns, context isolation | multi-agent-patterns.md |

| Evaluation | Testing agents, LLM-as-Judge, metrics | evaluation.md |

| Tool Design | Tool consolidation, description engineering | tool-design.md |

| Pipelines | Project development, batch processing | project-development.md |

Key Metrics

  • Token utilization: Warning at 70%, trigger optimization at 80%
  • Token variance: Explains 80% of agent performance variance
  • Multi-agent cost: ~15x single agent baseline
  • Compaction target: 50-70% reduction, <5% quality loss
  • Cache hit target: 70%+ for stable workloads

Four-Bucket Strategy

  • Write: Save context externally (scratchpads, files)
  • Select: Pull only relevant context (retrieval, filtering)
  • Compress: Reduce tokens while preserving info (summarization)
  • Isolate: Split across sub-agents (partitioning)

Anti-Patterns

  • Exhaustive context over curated context
  • Critical info in middle positions
  • No compaction triggers before limits
  • Single agent for parallelizable tasks
  • Tools without clear descriptions

Guidelines

  • Place critical info at beginning/end of context
  • Implement compaction at 70-80% utilization
  • Use sub-agents for context isolation, not role-play
  • Design tools with 4-question framework (what, when, inputs, returns)
  • Optimize for tokens-per-task, not tokens-per-request
  • Validate with probe-based evaluation
  • Monitor KV-cache hit rates in production
  • Start minimal, add complexity only when proven necessary

Scripts

  • context_analyzer.py - Context health analysis, degradation detection
  • compression_evaluator.py - Compression quality evaluation

Other skills for the same job

different authors, same section of the catalogue
Skill Creator
by anthropics
vendor ×10

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

56k tokens scripts
Skill Creator
by vercel-labs
vendor ×10

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

12k tokens scripts
Skill Creator
by JayZeeDesign
×9

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

10k tokens scripts
Template Skill
by JayZeeDesign
×7

Replace with description of the skill and when Claude should use it.

35 tokens
Dispatching Parallel Agents
by ZhanlinCui
×5

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

2k tokens
Skill Development
by anthropics
vendor ×4

This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.

9k tokens
Find Skills
by sanity-io
vendor ×4

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

1k tokens
Writing Skills
by ZhanlinCui
×4

Use when creating new skills, editing existing skills, or verifying skills work before deployment

26k tokens scripts

How to use it

Copy the folder

Take mrgoonie/context-engineering from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.