Agent skill

Apex Context Management

by jonathan-vella in jonathan-vella/apex

UTILITY SKILL — Two-mode context-window management. An agent skill from jonathan-vella/apex.

MITAuto-check passedAgent Workflows

Install Apex Context Management

skills CLI
$ npx skills add jonathan-vella/apex --skill apex-context-management -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jonathan-vella/apex apex-context-management --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jonathan-vella/apex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/apex-context-management .claude/skills/apex-context-management && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
apex-context-management
GitHub stars
217
Token cost
~1.8k tokens
SKILL.md length
595 words
Files
12 (incl. scripts, references)
Skills in repo
39
Repo updated
First seen
Licence
MIT

At a glance

UTILITY SKILL — Two-mode context-window management. An agent skill from jonathan-vella/apex.

  • Works in 4 steps: Estimate context usage — count… → Select tier based on the thresholds above → Apply compression template from → …
  • Tasks that involve Context engineering
  • SKILL.md covers Mode A: Runtime Compression, Mode B: Diagnostic Audit and Reference Index
  • Runs Python scripts from its folder

What it does

Apex Context Management is an agent skill from jonathan-vella/apex. UTILITY SKILL — Two-mode context-window management. RUNTIME: artifact compression (full/summarized/minimal) used by orchestrator and codegen agents. AUDIT: post-mortem analysis of Copilot debug logs (token profiling, redundancy + hand-off gap detection) used by 11-Context Optimizer. WHEN: "context optimization", "token budget", "runtime compression", "log parsing". DO NOT USE FOR: infra, IaC code, deployments.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including scripts and reference files (for example `references/analysis-methodology.md`, `references/audit-setup.md` and `references/compression-templates.md`). Compatibility notes: Audit mode requires Python 3.14 for log parser script

It sits in Agent Workflows, covering Context engineering. The repository describes itself as: APEX turns Azure platform engineering requirements into verified, deploy-ready IaC — powered by GitHub Copilot agents, real-time pricing, and built-in compliance. The licence is MIT.

When your agent uses it

  • Tasks that involve Context engineering

Example prompts

  • “context optimization”
  • “token budget”
  • “runtime compression”
  • “/apex-context-management”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Audit mode requires Python 3.14 for log parser script

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Estimate context usage — count approximate conversation tokens
  2. Select tier based on the thresholds above
  3. Apply compression template from
  4. If loading multiple artifacts, compress the older / less-critical ones first

What it can do on your machine

Read from SKILL.md and the folder at commit b8e5908. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Audit mode requires Python 3.14 for log parser script

    From compatibility in the SKILL.md frontmatter.

Context cost

Apex Context Management loads about 1.8k tokens when it runs, and up to ~16k if it reads all its reference files. Until then it costs about 110 tokens; SKILL.md has 595 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~110
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~16k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jonathan-vella/apex at commit b8e5908, republished under its MIT licence (© jonathan-vella). 595 words, ~1,788 tokens.

Download SKILL.mdSave it as .claude/skills/apex-context-management/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
apex-context-management
description
**UTILITY SKILL** — Two-mode context-window management. RUNTIME: artifact compression (full/summarized/minimal) used by orchestrator and codegen agents. AUDIT: post-mortem analysis of Copilot debug logs (token profiling, redundancy + hand-off gap detection) used by 11-Context Optimizer. WHEN: "context optimization", "token budget", "runtime compression", "log parsing". DO NOT USE FOR: infra, IaC code, deployments.
compatibility
Audit mode requires Python 3.14 for log parser script
user-invocable
true
disable-model-invocation
false
argument-hint
compression or audit, artifact or log path and scope

Context Management Skill

Unified context-window management with two distinct lifecycles:

  • Runtime Compression — what an agent does before loading a large artifact to stay under the model context limit (during workflow execution).
  • Diagnostic Audit — what the 11-Context Optimizer agent does after the fact to find waste in agent definitions, instructions, and skill loads.

The two modes do not depend on each other — pick the section that matches your need.


Mode A: Runtime Compression

Replaces the legacy context-shredding skill.

When to Use Runtime Compression
  • Before loading a predecessor artifact file (01 through 07)
  • When conversation length suggests >60% of model context is used
  • When an agent needs to load multiple large artifacts
Compression Tiers
TierContext UsageStrategy
full< 60%Load entire artifact — no compression
summarized60-80%Load key H2 sections only
minimal> 80%Load compact decisions; retain required safety evidence losslessly
Hard Token Checkpoints

Percentages are advisory; absolute input-token counts override them. GPT-6 Sol/Luna, GPT-6.1 Sol and GPT-5.6 Terra hard-checkpoint at ≥300K input; Claude Opus 5.5, Claude Sonnet 5.5 and MAI-Code at ≥160K. When hit, emit a compaction message and prefer the minimal artifact tier. Required missing guidance and safety evidence must still be recovered. These are repository trip-wires, not verified model API limits; use the active harness limit when known and do not infer it from a model name. Full per-model table, checkpoint procedure, and background context (nordic-foods saturation event) in references/hard-checkpoints.md.

Rules
  1. Estimate context usage — count approximate conversation tokens
  2. Select tier based on the thresholds above
  3. Apply compression template from references/compression-templates.md
  4. If loading multiple artifacts, compress the older / less-critical ones first
Steps
text
1. Estimate current context usage (rough: 1 token ≈ 4 chars)
2. Check the active harness model limit; if unavailable, report it as unknown
3. Calculate usage percentage and check hard-checkpoint table
4. Select tier:
   < 60%  → full (no compression needed)
   60-80% → summarized (key sections only)
   > 80%  → minimal (decision summaries only)
5. Load the artifact tier; skills remain single-tier and safety inputs remain complete
Skill Loading

Skills are single-tier — one file per skill, no digest / minimal variants. Reuse each SKILL.md while unchanged and available in context; reload missing required guidance after compaction, edits, or a new chat. Defer references/*.md until the SKILL.md body explicitly points to one. Full protocol in references/skill-loading.md.


Mode B: Diagnostic Audit

Replaces the legacy context-optimizer skill.

Structured methodology for auditing how GitHub Copilot agents consume their context window. Identifies waste, recommends hand-off points, and produces prioritised optimisation reports.

Show full SKILL.md (250 more words)Show less
When to Use Diagnostic Audit
  • Auditing context-window efficiency across a multi-agent system
  • Identifying where to introduce subagent hand-offs
  • Reducing redundant file reads and skill loads
  • Optimising instruction file applyTo glob patterns
  • Profiling per-turn token cost from debug logs
  • Porting agent optimisations to a new project
Audit Capabilities & Prerequisites

Capabilities cover log parsing, turn-cost profiling, redundancy detection, hand-off gap analysis, instruction audit, and structured report generation. Prerequisites: Python 3.14, VS Code Copilot Chat debug logs, and .github/agents/*.agent.md (or equivalent). Full capability matrix, portability checklist, and debug-log discovery in references/audit-setup.md.

Analysis Methodology

For the complete methodology — log format reference (ccreq line parsing, request types, latency heuristics), Steps 1-5 (log parsing → optimisation recommendations), common optimisation patterns, and baseline comparison workflow (Phase 0 + Phase 6) — read references/analysis-methodology.md.

Report Template

See templates/optimization-report.md for the full output template.


Reference Index

Operational procedures (load only the requested one):

For definition scorecards, static authoring-asset assessments, and their design history, use apex-agent-authoring. This skill owns log capture, context audit, and runtime compression, not authoring assessment procedures.

Load on demand:

ReferenceModeWhen to Load
references/compression-templates.mdRuntimePer-artifact H2 sections per tier
references/hard-checkpoints.mdRuntimeHitting a model token threshold or wiring agent checkpoint logic
references/skill-loading.mdRuntimeMulti-skill loads / clarifying single-tier load protocol
references/token-estimation.mdAuditEstimating token counts for context optimisation
references/analysis-methodology.mdAuditLog format, 5-step methodology, optimisation patterns, baseline comparison
references/audit-setup.mdAuditPrerequisites, enabling debug logs, audit capabilities, portability
scripts/parse-chat-logs.pyAuditLog parser producing structured JSON
templates/optimization-report.mdAuditReport output template

© jonathan-vella, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (scripts, references) in .github/skills/apex-context-management of jonathan-vella/apex.

  • SKILL.md
  • references/analysis-methodology.md
  • references/audit-setup.md
  • references/compression-templates.md
  • references/context-audit.md
  • references/debug-log-export.md
  • references/hard-checkpoints.md
  • references/log-profiling.md
  • references/skill-loading.md
  • references/token-estimation.md
  • scripts/parse-chat-logs.py
  • templates/optimization-report.md

Open the folder on GitHubat commit b8e5908

Compare with similar skills

Apex Context Management next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Apex Context Management compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Apex Context Management this skilljonathan-vella/apex217—~1.8kAutomated safety check: PassMIT
Analyze Trajectoryyologdev/yoyo-evolve1.9k—~3.6kAutomated safety check: PassMIT
AWS Secrets Manageraws/agent-toolkit-for-aws2.8k—~2kAutomated safety check: PassApache-2.0
Context Mode Output Sandboxmksglu/context-mode26k—~4.1kAutomated safety check: PassCustom licence
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence
Picoclaw Skill Creatorsipeed/picoclaw30k—~4.4kAutomated safety check: PassMIT

Similar skills

  • Analyze Trajectory

    yologdev/yoyo-evolve

    Diagnoses a recurring failure such as a stuck task, repeated CI error or frequent reverts by sending sub-agents through the logs and returning one root-cause diagnosis.

    1.9k GitHub stars~3.6k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • AWS Secrets Manager

    aws/agent-toolkit-for-aws

    Official

    Secret safety for AWS Secrets Manager, secret management, credentials, API keys, tokens, and passwords.

    2.8k GitHub stars~2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 7 days ago
    Agent WorkflowsAuto-check: notes
  • Picoclaw Skill Creator

    sipeed/picoclaw

    Guidance for creating, updating and reviewing Picoclaw skills, from the SKILL.md structure to organizing bundled scripts, references and assets.

    30k GitHub stars~4.4k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • ccc Semantic Code Search

    cocoindex-io/cocoindex-code

    Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.

    2.8k GitHub stars~938 tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed

More from jonathan-vella/apex

All 39 skills in this repo
  • Apex Azure Diagnostics

    jonathan-vella/apex

    WORKFLOW SKILL — Debug Azure production issues: Container Apps, Functions, App Service, AKS, VMs and messaging, with KQL log analysis.

    217 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • ANALYSIS SKILL — Azure Policy discovery: effective assignments (incl.

    217 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Apex Python Diagrams

    jonathan-vella/apex

    UTILITY SKILL — Python diagram generation for Azure architectures, WAF/cost/compliance charts, ERDs, swimlanes, timelines, and wireframes.

    217 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Apex Terraform Search Import

    jonathan-vella/apex

    WORKFLOW SKILL — Manual-only discovery and import of existing Azure resources into Terraform management.

    217 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Apex Vendor Prompting

    jonathan-vella/apex

    ANALYSIS SKILL — Manual-only audit of Anthropic Claude Opus 5.5 / Sonnet 5.5 and OpenAI GPT-6 / GPT-5.6 prompting guidance and APEX conventions.

    217 GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Apex Agent Authoring

    jonathan-vella/apex

    WORKFLOW SKILL — Creates, restructures, and audits GitHub Copilot .agent.md and .prompt.md files with correct frontmatter, handoffs, model policy, context budgets, and validation.

    217 GitHub stars~1.8k tokensUpdated today
    Auto-check passed

Questions about Apex Context Management

What does Apex Context Management do?

UTILITY SKILL — Two-mode context-window management. An agent skill from jonathan-vella/apex. Apex Context Management is an agent skill from jonathan-vella/apex. UTILITY SKILL — Two-mode context-window management.

When should I use Apex Context Management?

Apex Context Management fits situations like: tasks that involve Context engineering.

How do I install Apex Context Management in Claude Code?

Run `npx skills add jonathan-vella/apex --skill apex-context-management -a claude-code`. Or copy the skill folder (.github/skills/apex-context-management in jonathan-vella/apex) into .claude/skills/apex-context-management in your project. Claude Code loads it when a task matches its description.

How do I install Apex Context Management in Codex?

Run `npx skills add jonathan-vella/apex --skill apex-context-management -a codex`. Or copy the skill folder (.github/skills/apex-context-management in jonathan-vella/apex) into .agents/skills/apex-context-management in your project. Codex loads it when a task matches its description.

Can I use Apex Context Management in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jonathan-vella/apex --skill apex-context-management -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/apex-context-management, .gemini/skills/apex-context-management, .github/skills/apex-context-management and .opencode/skills/apex-context-management in your project.

What does Apex Context Management need to run?

Going by SKILL.md and its folder, Apex Context Management needs Python for the scripts in its folder. Our summary lists: Python 3. Compatibility (from SKILL.md): Audit mode requires Python 3.14 for log parser script.

Does Apex Context Management access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Apex Context Management safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Apex Context Management use?

Apex Context Management is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Apex Context Management use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 14k tokens, read only when the agent opens those files.

What are the alternatives to Apex Context Management?

Skills that share tags, products or a category with Apex Context Management: Analyze Trajectory (yologdev/yoyo-evolve, 1.9k stars), AWS Secrets Manager (aws/agent-toolkit-for-aws, 2.8k stars), Context Mode Output Sandbox (mksglu/context-mode, 26k stars) and Memori Long-Term Memory (MemoriLabs/Memori, 17k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Apex Context Management?

jonathan-vella (a GitHub user) maintains it in jonathan-vella/apex, which has 217 GitHub stars. The repository holds 39 skills in this directory. The repository was last updated on October 10, 2026.

Source: jonathan-vella/apex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.