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.
npx agentmods add instructions/jonathan-vella/apex-accelerator/context-optimizationgit clone --depth 1 https://github.com/jonathan-vella/apex-acceleratorWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01957 | $0.01957 |
| Opus 5 | $0.00979 | $0.00979 |
| Sonnet 5 | $0.00391 | $0.00391 |
| Haiku 4.5 | $0.00196 | $0.00196 |
Grade A, and why
apex-accelerator context-optimization.instructions.md 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.
How it starts
The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Window Optimization Rules
Rules for keeping agent context windows efficient. These apply when creating or modifying agent definitions, skills, and instruction files.
Agent Definition Rules
Two tiers govern agent definitions: hard limits (CI-enforced — a breach
fails npm run validate:agents) and soft guidelines (advisory — keep
lean, but no validator blocks them). Earlier revisions listed the soft
targets as hard caps; the tables below now match what the validators in
tools/scripts/ actually enforce.
Hard limits (CI-enforced)
| Rule | Limit | Enforced by |
|---|---|---|
| Agent body length | ≤ 600 lines | tools/scripts/_lib/paths.mjs (MAX_BODY_LINES) |
description length |
≤ 350 chars (warn ≥ 300) | validate-agents.mjs frontmatter check |
| Claude body > 350 lines | requires <context_awareness> |
validate-agents.mjs Check 3 (legacy-003) |
| Claude research agent | requires <investigate_before_answering> |
validate-agents.mjs Check 4 (legacy-004) |
Soft guidelines (advisory — not CI-enforced)
| Rule | Target | Rationale |
|---|---|---|
| Tool list size | ≤ 30 tools | Each tool adds ~75 tokens to prompt |
| Agent body length | ≤ 350 lines | Soft target; past it add <context_awareness> (hard cap is 600) |
| Inline template size | ≤ 50 lines | Move larger templates to skills |
| Handoff count | ≤ 8 handoffs | Each adds ~40 tokens; orchestrators are exempt (they route every step) |
| Skill references in body | ≤ 5 "Read" lines | Progressive load, not bulk load |
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.
- 2d ago First seen · 170 lines · 1,957 tokens per session scan A a4bc0e52f0e4
apex-accelerator context-optimization.instructions.md is an instructions file published in the GitHub repository jonathan-vella/apex-accelerator (50 stars, last pushed 6d ago), licensed MIT. It adds 1,957 tokens to every session, about $0.0098 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-30.
Other instructions, from other repositories
squad squad-routing-guard.instructions.md
Squad routing guard — explicit routing rules so the Copilot CLI routes tasks to the right Squad agent instead of handling them directly.
codex-settings AGENTS.md
Instructions for feiskyer/codex-settings, covering repository guidelines, repository structure, validation commands, toml syntax and plugin package and marketplace.
AI-Agents-Orchestrator AGENTS.md
Instructions for hoangsonww/AI-Agents-Orchestrator, covering agents.md — instructions for ai coding agents, project overview, build & test, code style and architecture boundaries.
Hosted_Agents_Workshop_dotNET AGENTS.md
Instructions for microsoft/Hosted_Agents_Workshop_dotNET, covering agents.md, repository purpose, general rules, documentation rules and code and build rules.
github-azure-agentic-journeys AGENTS.md
Instructions for DanWahlin/github-azure-agentic-journeys, covering agents and skills, journeys, prerequisites, agent & skill system and available agents.
ab100 CLAUDE.md
Instructions for timothywarner-org/ab100, covering claude.md, repository purpose, slide deck build, source decks (microsoft ab-100t00) and course structure (4 hours).