context-engineering

context-engineering is a skill for Claude Code, Codex from 233i/agent-skills. It costs 43 tokens per session (2,643 once invoked), scanned A, original, MIT.

A guide for deciding which project information a coding agent should see, and when. It organizes persistent rules, architecture documents, relevant source files, test results, errors, and conversation history.

In plain words
What is it for?
Use it when starting a coding session, switching between parts of a repository, configuring AI-assisted development, or correcting output that ignores project rules.
Why use it?
Too little context can lead to invented APIs or missed project conventions, while too much can distract the agent. This approach keeps the information focused on the current task.

Skill for Claude CodeCodex

Part of the agent-skills plugin — 20 skills, 7 commands, 3 agents, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/233i/agent-skills/context-engineering
Any agent
npx skills add 233i/agent-skills --skill context-engineering
Clone the repo
git clone --depth 1 https://github.com/233i/agent-skills

Made for: Claude Code, Codex.

Or install agent-skills, the plugin that ships this one along with the rest of its 20 skills, 7 commands, 3 agents, 1 hook.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,643 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00043 $0.02643
Opus 5 $0.00022 $0.01321
Sonnet 5 $0.00009 $0.00529
Haiku 4.5 $0.00004 $0.00264

Measured 3d ago against content hash 4d78dea7b68e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

context-engineering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/context-engineering/SKILL.md · 288 lines

How it starts

The opening of the file, as written. The whole thing — 288 lines — stays where its author put it; the contents beside it link to each section on GitHub.

上下文工程

概览

在正确的时间,把正确的信息喂给 agent。上下文是影响 agent 输出质量的最大杠杆之一:给得太少,它会幻觉;给得太多,它会失焦。Context engineering 就是有意识地策划 agent 看到什么、什么时候看到,以及这些信息如何组织。

何时使用

  • 开启新的编码会话
  • Agent 输出质量下降,例如模式不对、API 幻觉、忽视项目约定
  • 在代码库不同区域之间切换
  • 为 AI 辅助开发搭建新项目
  • Agent 没有遵循项目约定

上下文层级

把上下文从最持久到最临时进行分层:

┌─────────────────────────────────────┐
│  1. Rules Files (CLAUDE.md, etc.)   │ ← 始终加载,项目级
├─────────────────────────────────────┤
│  2. Spec / Architecture Docs        │ ← 按功能 / 会话加载
├─────────────────────────────────────┤
│  3. Relevant Source Files           │ ← 按任务加载
├─────────────────────────────────────┤
│  4. Error Output / Test Results     │ ← 按迭代加载
├─────────────────────────────────────┤
│  5. Conversation History            │ ← 持续累积,可压缩
└─────────────────────────────────────┘

第 1 层:规则文件

创建一个能跨会话持续存在的规则文件。这是你能提供的最高杠杆上下文之一。

CLAUDE.md(用于 Claude Code):

# Project: [Name]

## Tech Stack
- React 18, TypeScript 5, Vite, Tailwind CSS 4
- Node.js 22, Express, PostgreSQL, Prisma

## Commands
- Build: `npm run build`
- Test: `npm test`
- Lint: `npm run lint --fix`
- Dev: `npm run dev`
- Type check: `npx tsc --noEmit`

## Code Conventions
- Functional components with hooks (no class components)
- Named exports (no default exports)
- colocate tests next to source: `Button.tsx` → `Button.test.tsx`
- Use `cn()` utility for conditional classNames
- Error boundaries at route level

## Boundaries
- Never commit .env files or secrets
- Never add dependencies without checking bundle size impact
- Ask before modifying database schema
- Always run tests before committing

## Patterns
[One short example of a well-written component in your style]

其他工具的等价文件:

  • .cursorrules.cursor/rules/*.md(Cursor)
  • .windsurfrules(Windsurf)
  • .github/copilot-instructions.md(GitHub Copilot)
  • AGENTS.md(OpenAI Codex)

第 2 层:Spec 与架构文档

开始一个功能时,只加载相关的 spec 片段。不要因为手里有完整 spec,就整个全塞进去。

高效: “这是我们 spec 里的认证章节:[auth spec content]”
浪费: “这是我们整份 5000 字 spec:[full spec]”,但当前只是在做 auth

Read the full file on GitHub · 288 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 288 lines · 43 tokens per session scan A 4d78dea7b68e

Subscribe to this mod's changes

context-engineering is a skill published in the GitHub repository 233i/agent-skills (6 stars, last pushed 4mo ago), licensed MIT. It adds 43 tokens to every session and 2,643 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens