pn-context-engineering

pn-context-engineering is a skill for Claude Code, Codex from perniemann/pnCore. It costs 45 tokens per session (1,144 once invoked), scanned A, original, MIT.

A method for deciding which project rules, specifications, task files, errors, and history an AI coding agent should see at each stage of work.

In plain words
What is it for?
Use it when starting or switching coding tasks, onboarding an agent to a repository, correcting drifting output, or reducing context under a token limit.
Why use it?
It reduces wrong assumptions, ignored project conventions, stale context, and wasted space in the agent's working context.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

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/perniemann/pncore/pn-context-engineering
Any agent
npx skills add perniemann/pnCore --skill pn-context-engineering
Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

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 pn-context-engineering

README.md
[![agentmods](https://agentmods.dev/badge/skills/perniemann/pncore/pn-context-engineering.svg)](https://agentmods.dev/skills/perniemann/pncore/pn-context-engineering)
Your own site
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-context-engineering"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-context-engineering.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,144 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.1 $0.00045 $0.01144
Opus 5 $0.00023 $0.00572
Sonnet 5 $0.00009 $0.00229
Haiku 4.5 $0.00005 $0.00114

Measured 2d ago against content hash bb5ed79e51f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pn-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 2d 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.

packages/pn-core-mcp/content/skills/orchestration/pn-context-engineering/SKILL.md · 88 lines

How it starts

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

Context engineering

When to use

  • Starting a coding session or onboarding an agent to a repo
  • Switching tasks or domains mid-session
  • Output drifts (wrong APIs, ignored conventions, invented paths)
  • Token budget pressure: need to slim what is loaded without losing guardrails

Context hierarchy (most → least persistent)

  1. Rules and house docs.cursor/rules/, AGENTS.md, CLAUDE.md, project README conventions (always-on constraints).
  2. Specs and architecture — discovery spec, PRD, ADRs, plans (docs/plans/, docs/discovery/) for the current initiative.
  3. Task-scoped sources — only files that implement or verify the active change.
  4. Ephemeral signals — test output, build logs, linter diagnostics, stack traces (refresh each iteration; do not treat stale logs as ground truth).
  5. Conversation — accumulates; prefer writing decisions back to spec/plan rather than relying on long threads.

Process

  1. State what matters now: one sentence on goal and non-goals for this step.
  2. Load tier 1 if missing: ensure rules/agents reflect repo truth (commands, paths, forbidden actions). Load a skill once per session; do not restack the same rule dump every turn (breaks prompt cache and, on Fable 5.1, thinking-block binding).
  3. Pull tier 2 only for the active feature — not the whole docs tree.
  4. Expand tier 3 surgically: open callers, contracts, and tests tied to the edit; avoid "read the whole package."
  5. After each failure: replace guesswork with tier 4 evidence; if evidence contradicts the plan, update the plan/spec (orchestration philosophy: map is not the territory).

Rationalizations

Excuse Reality
"I'll paste the whole repo into context." Noise hides the relevant files; use search and targeted reads.
"Rules are enough; I don't need the spec." Rules don't encode acceptance criteria or this week's scope.
"The user already explained it in chat." Chat compacts and drifts; canonical spec/plan wins.
"One more huge file won't matter." It crowds out signal; load slices or symbols, not megabytes.

Read the full file on GitHub · 88 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 88 lines · 45 tokens per session scan A bb5ed79e51f2

Subscribe to this mod's changes

pn-context-engineering is a skill published in the GitHub repository perniemann/pnCore (0 stars, last pushed 2d ago), licensed MIT. It adds 45 tokens to every session and 1,144 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-09-03.