context-engineering
БесплатноБез исполняемых скриптовНе проверенAudits and reorganises what an AI coding agent carries in its context window: instruction files, path-scoped rules, skills, subagents, hooks and the running…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Context Engineering
Overview
Context engineering is deciding what an AI coding agent has in its context window at each step: standing instructions, skill and tool listings, files it has read, command output, and the conversation so far. The window is finite and everything in it competes for the model's attention, so the work is curation: load what the current step needs, keep the rest reachable but out.
This skill does three jobs. It audits what a project loads today, moves each piece of knowledge to the mechanism that loads it at the right moment, and sets the habits that keep a long session usable. The facts below come from the tools' own documentation, not from folklore: where a number appears, it is one the vendor publishes.
Instructions
1. See what is loaded today
Inventory the instruction files from the shell:
wc -l CLAUDE.md CLAUDE.local.md AGENTS.md GEMINI.md .claude/CLAUDE.md .claude/rules/*.md 2>/dev/null
find . \( -name CLAUDE.md -o -name AGENTS.md -o -name GEMINI.md \) -not -path "*/node_modules/*"
ls .claude/skills .claude/agents .cursor/rules 2>/dev/null
Then ask the user to run the tool's own report, because only the tool knows what it really loaded:
| Tool | Check | Shows |
|---|---|---|
| Claude Code | /context |
token use by category, including the list under Memory files |
| Claude Code | /memory |
every instruction file location and the auto memory folder |
| Claude Code | /doctor, /skill-doctor |
proposed cuts for a checked-in CLAUDE.md; context cost and usage of each skill |
| Codex CLI | codex --ask-for-approval never "Summarize the current instructions." |
the instruction chain it built |
| Gemini CLI | /memory show |
the concatenated context files |
2. Know what loads when
Claude Code documents this behaviour:
| Mechanism | Enters the context | After compaction |
|---|---|---|
CLAUDE.md in the working directory and above, ~/.claude/CLAUDE.md, CLAUDE.local.md, rules without paths |
at session start, in full, on every request | re-read from disk |
.claude/rules/*.md with paths: and CLAUDE.md in subdirectories |
when a matching file is read | gone until a matching file is read again |
Auto memory MEMORY.md |
at start, first 200 lines or 25 KB | re-read from disk |
| Skill | description at start; the body when invoked | invoked bodies re-attached, first 5,000 tokens per skill, 25,000 in total; the description listing is not reloaded |
| Subagent | never: it works in its own window and returns a summary | background ones keep running |
| Hook | never, unless it returns text for the model: plain stdout on SessionStart and UserPromptSubmit, an additionalContext JSON field on other events |
SessionStart hooks matching compact run again |
| MCP server | tool names at start, full schemas when a tool is needed | tool names reload automatically |
Instruction files are delivered as context, not as enforced configuration: the documentation says longer files reduce adherence and gives a target of under 200 lines per file. @file imports organise a long file but do not make it cheaper, since imported files load at launch too.
3. Put each piece of knowledge where it loads at the right time
Take every section of the existing instruction file and ask, in this order:
- Must it happen every time with no exceptions (format after each edit, never touch
migrations/)? Make it a hook or a permission rule. An instruction can be ignored; a hook cannot. - Can the agent work it out by reading the code (directory tree, dependency list, standard language style)? Delete it.
- Does it apply only to some files? Move it to a rule with
paths:or to an instruction file inside that directory. - Is it a multi-step procedure or reference material used now and then (release steps, a migration recipe)? Make it a skill. Add
disable-model-invocation: truewhen it has side effects; its description then costs nothing until someone types the command. - Is it personal (a sandbox URL, a preferred editor)?
CLAUDE.local.md, gitignored, or~/.claude/CLAUDE.md. - What is left, the things needed in every session, stays in the root file.
A path-scoped rule looks like this:
---
paths:
- "src/api/**/*.ts"
---
- Every handler validates its input with the zod schema in the same folder.
- Errors are thrown as `ApiError` from `src/api/errors.ts`, never as a bare `Error`.
4. Write the root instruction file
It holds what cannot be guessed: commands, conventions that differ from the defaults, traps, and pointers to where decisions live.
# Harbor Ledger
## Commands
- Install: `pnpm install`
- One test file: `pnpm vitest run src/invoices/total.test.ts` (the full suite takes 9 minutes; run it only before a PR)
- Type check: `pnpm tsc --noEmit`
## Conventions that differ from the defaults
- Money is integer cents in a `bigint`, never a `number`.
- Dates cross the API as ISO 8601 strings in UTC.
#
Установить context-engineering в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл context-engineering?
Audits and reorganises what an AI coding agent carries in its context window: instruction files, path-scoped rules, skills, subagents, hooks and the running conversation. Use when someone says "the agent ignores our CLAUDE.md", "set this repo up for Claude Code / Codex / Cursor", "my AGENTS.md is too long", "quality drops in long sessions", "it keeps inventing APIs", "what should go in a skill versus the rules file", or asks how to hand work to a subagent. Grounded in the documented loading behaviour of Claude Code, with the equivalents for Codex, Gemini CLI and Cursor.
Как установить скилл context-engineering?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл context-engineering запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic