context-engineering

context-engineering is a skill for Claude Code, Codex from ApexIQ/skillsmith. It costs 25 tokens per session (811 once invoked), scanned A, original, MIT.

A set of guidelines for deciding what information an AI model should receive and in what order. A context window is the limited amount of text an AI can consider in one request.

In plain words
What is it for?
Use it when selecting files, instructions, examples, and project history for an AI coding task, especially when the available material is large.
Why use it?
Too little information can cause wrong assumptions, while too much can crowd out the important details and reduce answer quality. The guidance helps keep the supplied information focused and within practical limits.

Skill for Claude CodeCodex

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/apexiq/skillsmith/context_engineering
Any agent
npx skills add ApexIQ/skillsmith --skill context_engineering
Clone the repo
git clone --depth 1 https://github.com/ApexIQ/skillsmith

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/apexiq/skillsmith/context_engineering.svg)](https://agentmods.dev/skills/apexiq/skillsmith/context_engineering)
Your own site
<a href="https://agentmods.dev/skills/apexiq/skillsmith/context_engineering"><img src="https://agentmods.dev/badge/skills/apexiq/skillsmith/context_engineering.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 811 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.00025 $0.00811
Opus 5 $0.00013 $0.00405
Sonnet 5 $0.00005 $0.00162
Haiku 4.5 $0.00003 $0.00081

Measured 4d ago against content hash 8a36bc2a6498, 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 4d 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.

.agent/skills/context_engineering/SKILL.md · 142 lines

How it starts

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

🎯 Context Engineering

Philosophy: The right context at the right time produces the best results.

The Problem

AI models have limited context windows:

  • Too little context → Hallucinations, wrong assumptions
  • Too much context → Quality degradation, high costs
  • Wrong context → Irrelevant or incorrect output

Context Window Management

Know Your Limits

Model Approx Context Practical Limit
GPT-4 128k tokens ~80k for best quality
Claude 3.5 200k tokens ~150k for best quality
Gemini 2.0 1M+ tokens ~500k for best quality

Rule of thumb: Stay at 50-70% of max for optimal performance.

Context Priority Stack

Order context by importance:

1. CRITICAL: Current task instructions
2. HIGH: Directly relevant code/files
3. MEDIUM: Related patterns/examples
4. LOW: General project context
5. OPTIONAL: Historical context

Strategies

1. Progressive Disclosure

Start minimal, add context as needed:

Step 1: Give task + key file
Step 2: Agent asks for more context
Step 3: Provide specific additional files
Step 4: Agent completes task

2. Context Windowing

Show only relevant sections:

# ❌ Don't: Load entire 5000-line file
file_content = read_file("huge_file.py")

# ✅ Do: Load only relevant section
file_content = read_file("huge_file.py", start=100, end=200)

3. Semantic Chunking

Include related code, not arbitrary ranges:

Good chunk: Entire function + its imports
Bad chunk: Lines 100-200 (arbitrary)

4. Context Prefetching

Anticipate needs based on task type:

Task Type Prefetch
Bug fix Error logs, related tests, recent changes
New feature Similar features, API patterns, tests
Refactor Callers, tests, type definitions

Context Organization

Structure context for clarity:

<current_file>
[The file being edited]
</current_file>

<related_files>
[Files that import/use current_file]
</related_files>

<tests>
[Test files for current functionality]
</tests>

<documentation>
[API docs, READMEs relevant to task]
</documentation>

Read the full file on GitHub · 142 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. 4d ago First seen · 142 lines · 25 tokens per session scan A 8a36bc2a6498

Subscribe to this mod's changes

context-engineering is a skill published in the GitHub repository ApexIQ/skillsmith (5 stars, last pushed 5mo ago), licensed MIT. It adds 25 tokens to every session and 811 once invoked, about $0.0001 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.