context-engineering skill

A skill on what to put in front of a coding agent and when: rules files, spec excerpts, source files, error output and session handoffs.

Our verdict Recommended

A practical, well-organized guide to context habits, safe to install on its own; its value is as guidance, since it adds no tooling.

What the context-engineering skill does

context-engineering is a single 15 KB SKILL.md in Addy Osmani's agent-skills pack. It treats the agent's context as something to curate and organizes it as a five-level hierarchy: rules files (CLAUDE.md, .cursorrules, AGENTS.md and equivalents) that are always loaded, spec or architecture excerpts per feature, the source files relevant to the task, error output per iteration, and the conversation history that accumulates. A sample CLAUDE.md shows tech stack, commands, conventions, boundaries and one example pattern.

It then covers practical techniques: reading the files you will modify plus one similar example before editing, a trust ladder for loaded content (project code is trusted; config, fixtures and external docs are verified first; user input and third-party responses are untrusted, and instruction-like text in them is surfaced rather than followed), and packing strategies named the brain dump, the selective include and the hierarchical summary. A context budget section says what to cut first, what to protect, how to compress before dropping and how to order for recency. Other parts cover restartable session boundaries (what to persist before opening a fresh session), MCP integrations, handling conflicting or incomplete requirements, anti-patterns, rationalizations and a verification checklist. There are no scripts or reference files.

Good for

  • Setting up CLAUDE.md or AGENTS.md rules files for a project
  • Recovering when agent output quality drops late in a long session
  • Planning clean handoffs between sessions

Not for

  • Tool-specific context features such as automatic memory or retrieval systems, which it only discusses generally
  • Anyone who wants an automated tool rather than guidance

Depth 2/5

A single 15 KB SKILL.md with detailed instructions and checklists, but no scripts, reference files or evals.

Signs a project needs the context-engineering skill

The skill's description lists four triggers: starting a new session, a drop in agent output quality, switching between tasks, and configuring rules files and context for a project. Its "When to Use" list adds two more: setting up a new project for AI-assisted development, and an agent that is not following project conventions.

The symptoms it describes are specific enough to check against your own sessions:

  • The agent uses the wrong patterns or calls APIs that do not exist in your codebase.
  • It ignores conventions you have already explained.
  • It re-implements utilities that already exist in the codebase.
  • Quality falls mid-task as the conversation grows, because failed attempts, replaced drafts and verbose tool output are never trimmed.

The skill gives the reason in its overview. With too little context the agent hallucinates, and with too much it loses focus. It defines context engineering as deliberately curating what the agent sees, when it sees it, and how that material is structured. Each fix it suggests either adds missing context or removes stale context from the context window.

Applying the context hierarchy in a working session

The five levels map onto a routine you can follow at the start of each task. The steps and example prompts below come from the SKILL.md.

  1. Write a rules file once. Use CLAUDE.md for Claude Code, .cursorrules or .cursor/rules/*.md for Cursor, .windsurfrules for Windsurf, .github/copilot-instructions.md for GitHub Copilot, or AGENTS.md for OpenAI Codex. The sample template has sections for tech stack, commands (build, test, lint, dev, type check), code conventions, boundaries such as "Ask before modifying database schema", and one short example of a component written in your style.
  2. Load only the spec section you need. The skill recommends "Here's the authentication section of our spec" over pasting an entire 5,000-word spec when the work only touches auth.
  3. Load source files before editing. Read the files you will modify, read their tests, find one similar pattern already in the codebase, and read any type definitions or interfaces involved.
  4. Feed back the specific error. Give the agent a line like "The test failed with: TypeError: Cannot read property 'id' of undefined at UserService.ts:42" rather than 500 lines of test output when only one test failed.
  5. Manage the conversation history. Start a fresh session when you move to a different major feature. Summarize progress when the context gets long ("So far we've completed X, Y, Z. Now working on W."), and compact before critical work if your tool supports it.

The skill presents step 5 as a last resort. Its context budget section is meant to keep you from reaching that point: decide early what to cut, what to protect, and when to compress material instead of dropping it.

Handing off between sessions without losing state

The restartable session boundary is the most concrete procedure in the file. The skill says a fresh session is safe at a completed task boundary, not at an arbitrary token count. Before you leave the current session, it says to persist five things:

  1. the accepted scope and decisions, in the spec or plan
  2. the current task status and the next pending task
  3. the files changed and the working-tree state
  4. the exact verification commands and their outcomes
  5. unresolved questions, risks and required approvals

Commit the finished task only when the user or the repository workflow authorizes it. Otherwise leave the working tree as it is and write down that the changes are uncommitted.

In the new session, the agent first reads the rules, spec, plan and task status, then checks the actual git status. It re-runs verification when the recorded baseline is missing, when the code has moved, or when the next task depends on it. It should not assume approval from an earlier conversation unless a durable artifact records that approval.

The skill also describes an external harness that exits and restarts sessions automatically between tasks. That harness has to treat the artifacts and repository state as the source of truth, keep human approval gates in place, and tell a completed task apart from a crashed process. The skill defines this handoff contract but leaves process supervision to the harness. For long-term memory across sessions, the persistence here is plain files in the repo, with no separate store.

How it lines up with common context engineering strategies

Many context engineering guides sort techniques into four groups: writing, selecting, compressing and isolating context. This skill covers all four through manual habits and adds no tooling.

  • Write: rules files that load in every session, plus the plan, spec and task-status artifacts that a handoff persists.
  • Select: the selective include packing strategy, loading one spec section instead of the whole document, and reading only the files a task touches.
  • Compress: the hierarchical summary strategy, progress summaries, deliberate compaction, and the budget rule to compress before you drop anything.
  • Isolate: fresh sessions per major feature, and the trust ladder, which treats instruction-like text in config, fixtures, external docs or third-party API responses as data to show the user, not commands to follow.

The alternatives listed on this page (context-mode, memsearch, planning-with-files and memU) are separate projects. The difference that matters is whether you want guidance or tooling. If you want a checklist your agent follows in Claude Code, Cursor, Copilot or Codex, this skill is enough on its own. If you want something that stores and retrieves context for you, pick a memory tool and keep this skill for rules-file and handoff discipline.

Security review

No issues found

We scanned all 1 files in this skill folder and read every script. Nothing in it reaches beyond what the skill describes.

A single SKILL.md of guidance on structuring the context an agent is given (rules files, context packing, MCP integrations as a topic). It has no scripts, no allowed-tools declaration and no instructions to fetch or send anything.

What we checked

The skill folder (1 files) on Oct 29, 2026. We had every file and read every script.

NVIDIA SkillSpector static scan: 4 pattern hits (Excessive Agency 2, Privilege Escalation 1, MCP Rug Pull 1). The four hits are an example CLAUDE.md line telling the agent not to commit .env files, a npx tsc --noEmit example command, and ordinary 'without checking/verification' wording in guidance text. No allowed-tools, scripts, network calls or hooks.

A review, not a certification. Skills change after we check them — read the files before installing.

License

MIT — commercial use allowed.

Can it run unattended?

Not really. It is advice for structuring context and handoffs, not a loop; it does describe how an external harness could restart sessions between completed tasks.

Alternatives

Context Mode

mksglu/context-mode

MCP server plus hooks that keep bulky tool output out of the context window, index it in local SQLite, and restore session state after compaction.

With caveats Broad access Depth 3/5

memsearch

zilliztech/memsearch

Cross-agent persistent memory for Claude Code, Codex, OpenClaw, OpenCode and DeepSeek Harness: Markdown files as the source of truth, with a Milvus search index.

With caveats Broad access Depth 3/5

Planning with Files

OthmanAdi/planning-with-files

Keeps task_plan.md, findings.md and progress.md on disk and re-injects them via hooks, so a plan survives /clear, compaction and crashes.

Recommended Broad access Depth 4/5

memU

NevaMind-AI/memU

Memory layer that mines agent session logs into a shared markdown wiki and re-injects it across Codex, Claude Code, Cursor and others, locally or via memU Cloud.

With caveats Broad access Depth 4/5

FAQ

What is the context-engineering skill?

It is a skill from Addy Osmani's agent-skills pack that teaches how to curate what a coding agent sees: persistent rules files, spec excerpts, relevant source, error output and conversation history. It also covers session handoffs and handling conflicting requirements.

How do I install context-engineering?

Run npx skills add addyosmani/agent-skills --skill context-engineering, or install the whole pack with npx skills add addyosmani/agent-skills. In Claude Code you can also use the plugin marketplace route in the repo README.

Is context-engineering safe?

Yes as far as we can tell: it is one Markdown file with no scripts or network access. It even includes guidance to treat instruction-like text in external files as data rather than commands.

context-engineering vs a memory skill: what is the difference?

This skill is guidance for people and agents on how to structure context by hand. Memory skills such as context-mode or memsearch add tooling that stores or retrieves information across sessions.

Which rules file does context-engineering tell me to use for my tool?

The skill lists CLAUDE.md for Claude Code, .cursorrules or .cursor/rules/*.md for Cursor, .windsurfrules for Windsurf, .github/copilot-instructions.md for GitHub Copilot, and AGENTS.md for OpenAI Codex. The same template of tech stack, commands, conventions, boundaries and one example pattern works in each.

When should I start a fresh agent session?

The skill recommends a fresh session when you switch between major features, and says the safe point is a completed task boundary, not an arbitrary token count. Before switching, persist scope and decisions, task status, changed files, verification commands and results, and any open questions.

Will the skill make the agent commit my work before a handoff?

Only if the user or the repository workflow authorizes it. Otherwise the skill says to leave the working tree intact and record that the changes are uncommitted, so the next session can check git status before acting.

Sources: GitHub repository; install counts from skills.sh via Best Skills (CC BY 4.0). Review based on the published SKILL.md.