Context Engineering skill for Claude Code: give the agent the right context
Makes your agent set up rules files and manage what it sees, so output stays accurate in long sessions.
- Installs
- 66.3K
- on skills.sh
- Stars
- 112.6K
- on GitHub
- Updated
- Nov 2026
- last repo commit
context-engineering makes the agent deliberately curate what it reads: a rules file, the right spec section, the files it will edit, and only the error output that matters. It loads at the start of a session, when output quality drops, when you switch tasks or when you set up rules files for a project.
It covers five context levels, how to hand work over between sessions, a context budget (what to cut first and what to protect) and how to handle conflicting or missing requirements. It bundles no scripts.
Good for
- Developers whose agent ignores project conventions
- Anyone starting a project for AI-assisted work
- People whose long sessions get worse over time
Install context-engineering
Claude Code
- 1
Copy this prompt.
Install the context-engineering skill in Claude Code. Run this command: npx skills add https://github.com/addyosmani/agent-skills --skill context-engineering Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.
Sections in SKILL.md
- Overview
- When to Use
- The Context Hierarchy
- Level 1: Rules Files
- Tech Stack
- Commands
- Code Conventions
- Boundaries
- Patterns
- Level 2: Specs and Architecture
- Level 3: Relevant Source Files
- Level 4: Error Output
- Level 5: Conversation Management
- Restartable Session Boundaries
- Context Packing Strategies
- The Brain Dump
Key facts
- Author
- addyosmani (repo owner)
- Installs on skills.sh
- 66,268 (Nov 2, 2026)
- GitHub stars
- 112,555 on the agent-skills repo (Nov 2, 2026)
- License
- MIT
- Last commit
- 2026-11-01
- What installs
- 1 file: SKILL.md
What it includes
Five levels from rules files to conversation management
Rules files, specs, source files, error output, then the conversation itself.
Context hierarchyCreate CLAUDE.md or the equivalent for your tool
Lists the equivalents: .cursorrules, .windsurfrules, .github/copilot-instructions.md and AGENTS.md.
Write ·
Rules filesTrusted, verify-first and untrusted sources
Instruction-like text in config, data or external docs is surfaced to you, not followed.
Trust levels for loaded filesWhat to save before starting a fresh session
Scope, task status, changed files, verification results and open questions.
Restartable session boundariesBrain dump, selective include and hierarchical summary
Three ways to give the agent what it needs without flooding it.
Context packingWhat to cut first, what to protect and how to order for recency
Compact well before the host limit; put task-critical content last.
Context budget managementSuggests Context7, Chrome DevTools, PostgreSQL, Filesystem and GitHub servers
A table of servers and what each provides.
Network ·
MCP integrationsSurface conflicts and gaps instead of guessing; plan inline first
If the spec is silent and no precedent exists, stop and ask.
Confusion managementContext starvation, flooding, stale context and silent confusion
A table of problems and fixes.
Anti-patterns
From the official docs
Permissions
Low risk
It can add rules files to your project and suggests connecting extra servers. Review any file it writes and any server you connect.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It may write rules files into your project
It describes creating CLAUDE.md and similar files. Read what the agent writes there before you commit it.
It names MCP servers you might add
Each server has its own access to your data. Check what a server can reach before you connect it.
Questions
What does context-engineering do?
It makes Claude manage what it knows about your project: persistent rules files, the right spec section, relevant source files and trimmed error output. The goal is fewer invented APIs and ignored conventions.
How do I install context-engineering?
Use the install box above. The README also lists npx skills add addyosmani/agent-skills --skill context-engineering for one skill, and a Claude Code plugin for the whole pack (/plugin marketplace add addyosmani/agent-skills, then /plugin install agent-skills@addy-agent-skills). A one-skill install copies only skills/context-engineering/ and not the repo-level references folder; the README says the skill still works.
Does it create a CLAUDE.md for me?
It includes a template for a rules file and the equivalents for other tools. Whether the agent writes one depends on what you ask; review it before you commit it.
Does it install MCP servers?
No. It lists MCP servers such as Context7, Chrome DevTools, PostgreSQL, Filesystem and GitHub as sources of richer context, but it defines no install step.
Is it safe to run?
It is a text file of instructions and bundles no scripts. It can lead the agent to write rules files in your project, so review them before committing.
Does it work in Codex, Cursor or other tools?
The README documents Codex (codex plugin marketplace add addyosmani/agent-skills, then codex plugin add agent-skills@agent-skills, Codex CLI v0.122 or newer), Cursor (copy skills into .cursor/skills/), Gemini CLI, Windsurf, OpenCode, GitHub Copilot, Kiro and others. It says the skills are plain Markdown that work with any agent that accepts instruction files. It does not mention the Claude app.
Information
updated Nov 2, 2026
- Repository
- addyosmani/agent-skills
- Folder
skills/context-engineering
Sources
Docs, issue trackers and discussions this page is built from.
Show all 2Hide
- context-engineering SKILL.md · github.com
- addyosmani/agent-skills README · github.com