# Context engineering

> Context engineering is an open-source agent skill for developer tools. Curates what an AI coding agent sees, when, and how, to keep its output on track. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/addyosmani/agent-skills/tree/main/skills/context-engineering
- **Repository:** https://github.com/addyosmani/agent-skills
- **GitHub stars:** 122,545
- **License:** MIT
- **Skill name:** context-engineering
- **Collection:** https://github.com/addyosmani/agent-skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill guides an agent through setting up and managing its working context. It covers writing a persistent rules file such as CLAUDE.md, AGENTS.md or Cursor and Windsurf rule files, with sections for stack, commands, conventions and boundaries. It also explains how to load specs, source files and error output in layers, from always-on project rules down to the current iteration.

The material gives the agent concrete routines: reading target files and a similar existing pattern before editing, packing only task-relevant files into a session, keeping a project map for large codebases, and compressing or dropping stale exploration during long runs. It includes a restartable session handoff, recording scope, task status, changed files, verification results and open questions so a fresh session can resume safely. It also tells the agent to surface conflicts and missing requirements rather than guessing.

The skill is plain instructional markdown with no scripts. It references a shared agent-first CLI guide for search commands, and it expects the agent to work with files in the repository and, optionally, MCP servers such as Context7, GitHub or PostgreSQL.

## When your agent uses it

> 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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/addyosmani/agent-skills/tree/HEAD/skills/context-engineering)
- [License: MIT](https://github.com/addyosmani/agent-skills/tree/HEAD/skills/context-engineering)

## Features

- **Rules file setup:** Guidance for writing a persistent project rules file covering stack, commands, conventions and boundaries.
- **Layered context loading:** A hierarchy that orders context from always-loaded rules down to per-iteration error output.
- **Context budget management:** Advice on what to cut first, what to protect, and how to summarize exploration before dropping it.
- **Session handoff checklist:** Steps to persist scope, task status and verification results so a fresh session can resume.
- **Confusion surfacing:** Patterns for presenting spec conflicts and missing requirements as explicit options instead of guessing.
- **Context packing templates:** Reusable briefing and selective-include formats for giving the agent focused task context.

## Good for

- Set up a CLAUDE.md or AGENTS.md rules file for a new project
- Figure out which files to load before changing an endpoint
- Reset a session when the agent starts ignoring project conventions
- Summarize a long debugging session before continuing
- Prepare a handoff so a new session can pick up the next task

## Install

### Claude Code

This skill ships in the `agent-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add chrisalehman/bionic
/plugin install agent-skills@bionic
```

Or copy only this skill to `~/.claude/skills/context-engineering`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/context-engineering &&
cp -R "$tmp/skills/context-engineering" ~/.claude/skills/context-engineering &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/context-engineering` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/context-engineering` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/context-engineering &&
cp -R "$tmp/skills/context-engineering" ~/.agents/skills/context-engineering &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/context-engineering` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/context-engineering` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/context-engineering &&
cp -R "$tmp/skills/context-engineering" ~/.cursor/skills/context-engineering &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/context-engineering` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/addyosmani/agent-skills.git --path skills/context-engineering
```

Or copy the folder to `~/.gemini/skills/context-engineering` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/context-engineering`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/context-engineering &&
cp -R "$tmp/skills/context-engineering" ~/.copilot/skills/context-engineering &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/context-engineering` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/addyosmani/agent-skills.git
```

Then copy `agent-skills/skills/context-engineering` into your agent's skills folder as `context-engineering`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Context engineering apply?

It is meant for starting a new session, when output quality degrades, when switching between tasks, or when configuring rules files and context for a project.

### Does Context engineering run any scripts or need extra tools?

No scripts are included. It is instructional guidance, and it can reference MCP servers such as Context7, GitHub or PostgreSQL for richer context.

### Which rules files does Context engineering mention?

It names CLAUDE.md for Claude Code, .cursorrules or .cursor/rules for Cursor, .windsurfrules for Windsurf, .github/copilot-instructions.md for GitHub Copilot and AGENTS.md for OpenAI Codex.

### How do I install Context engineering in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/context-engineering to use it in all your projects, or to .claude/skills/context-engineering in one project. Or install the agent-skills plugin, which includes it: /plugin marketplace add chrisalehman/bionic, then /plugin install agent-skills@bionic.

### Does Context engineering run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Context engineering?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Context engineering?

The closest alternatives to Context engineering are Agents md authoring, Writing rules, Intent layer, Agentic os and Writing agents.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Agents md authoring](https://ai-powered.com/skills/agents-md-authoring): Agents md authoring is an open-source agent skill for developer tools.
- [Writing rules](https://ai-powered.com/skills/writing-rules-xiaolai): Writing rules is an open-source agent skill for developer tools.
- [Intent layer](https://ai-powered.com/skills/intent-layer): Intent layer is an open-source agent skill for developer tools.
- [Agentic os](https://ai-powered.com/skills/agentic-os-smartworldarafath): Agentic os is an open-source agent skill for developer tools.
- [Writing agents](https://ai-powered.com/skills/writing-agents-xiaolai): Writing agents is an open-source agent skill for developer tools.
- [Principle guard the context window](https://ai-powered.com/skills/principle-guard-the-context-window): Principle guard the context window is an open-source agent skill for developer tools.
- [Context strategy](https://ai-powered.com/skills/context-strategy): Context strategy is an open-source agent skill for developer tools.
- [Wiki agents md](https://ai-powered.com/skills/wiki-agents-md): Wiki agents md is an open-source agent skill for knowledge and memory.

---
Source: https://ai-powered.com/skills/context-engineering
