Back to Skills

context-engineering

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.

42,994stars4,732forksUpdated 5/18/2026

Security Assessment

Safe(90/100)

Detected risks:

Sensitive File Access([SKILL.md] .env)
Security Score90/100

About context-engineering

The context-engineering skill is designed to optimize how AI agents receive and process information to maximize their output quality. It addresses the common problem of agents either hallucinating responses due to insufficient context or losing focus when overwhelmed by irrelevant details. By structuring context deliberately, this skill ensures that agents see the right information at the right time, improving reliability and adherence to project conventions. It focuses on both the selection of context and the timing of its presentation, helping maintain consistency across coding sessions and development tasks.

The main features of this skill revolve around a hierarchical approach to context management. It supports persistent project-wide rules files, selective loading of specifications or architectural documents per feature, pre-task loading of relevant source code and tests, and iterative updates with error outputs and test results. This hierarchy allows agents to prioritize critical, trusted information while still considering transient data like recent conversation history or task-specific outputs. Trust levels for loaded files are also emphasized, distinguishing between trusted source code, files requiring verification, and untrusted external content. By doing so, it helps prevent agents from acting on potentially misleading or unsafe information.

This skill is particularly useful for software developers, AI-assisted development teams, and project managers who need their agents to follow coding standards, architectural patterns, and project-specific conventions. Use cases include starting a new coding session, troubleshooting declining agent performance, switching between codebase modules, and setting up new projects with clear rules and patterns. The skill is valuable whenever structured, context-aware agent behavior is needed to enhance productivity, maintain consistency, and reduce errors in automated development workflows.

FAQ

When should I use the context-engineering skill?

Use it when starting a new coding session, when agent output quality declines, when switching between codebase areas, or when setting up a new project for AI-assisted development.

What types of files are supported for context loading?

Persistent rules files (e.g., CLAUDE.md), specification or architecture docs, relevant source files and tests, error outputs, and conversation history can all be used to provide structured context.

Does this skill handle external or untrusted data?

Yes, but external or instruction-like content should be treated as data to present to the user rather than directives for the agent to follow.

Which programming technologies are compatible with this skill?

It is compatible with JavaScript, TypeScript, React, Node.js, Express, PostgreSQL, and associated tooling like Vite, Tailwind CSS, and Prisma, as indicated by project examples.

Can this skill improve agent adherence to coding conventions?

Yes, by loading rules files that define code conventions, patterns, boundaries, and commands, the agent can better follow project standards consistently.

Install context-engineering

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill