strategy-compact

strategy-compact is a skill for Claude Code from d0gesec/pownie. It costs 26 tokens per session (3,151 once invoked), scanned A, original, MIT.

A context-management guide for long cybersecurity exercises such as CTFs, where participants solve challenges, and penetration tests that assess system security.

In plain words
What is it for?
Use it during CTF, Hack The Box, or penetration-testing work to decide when to summarize the current phase and retain useful exploit and investigation details.
Why use it?
It helps preserve important findings, payloads, and attack progress when a session becomes long or several approaches fail.

Skill for Claude Code

Written for Claude Code: $CLAUDE_PROJECT_DIR variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Part of the pownie plugin — 4 skills shipped together

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/d0gesec/pownie/strategy-compact
Any agent
npx skills add d0gesec/pownie --skill strategy-compact
Clone the repo
git clone --depth 1 https://github.com/d0gesec/pownie

Made for: Claude Code.

Or install pownie, the plugin that ships this one along with the rest of its 4 skills.

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 strategy-compact

README.md
[![agentmods](https://agentmods.dev/badge/skills/d0gesec/pownie/strategy-compact.svg)](https://agentmods.dev/skills/d0gesec/pownie/strategy-compact)
Your own site
<a href="https://agentmods.dev/skills/d0gesec/pownie/strategy-compact"><img src="https://agentmods.dev/badge/skills/d0gesec/pownie/strategy-compact.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,151 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.00026 $0.03151
Opus 5 $0.00013 $0.01576
Sonnet 5 $0.00005 $0.00630
Haiku 4.5 $0.00003 $0.00315

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

Security

Grade A, and why

strategy-compact 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 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (pre-compact-save.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/strategy-compact/SKILL.md · 260 lines

How it starts

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

Strategic Compact for Offensive Security

CTF and offsec sessions are long-form by nature — multi-hour engagements with heavy tool output, iterative exploitation, and chained attack paths. Auto-compaction is destructive in this context because it fires at arbitrary points and silently drops exploit state, payload bytes, and enumeration results. This skill teaches when and how to compact strategically so you keep attacking momentum without context rot.

When to Activate

  • Any CTF challenge, HTB machine, or pentest session
  • Session approaching context limits (responses getting shorter, losing track of prior findings)
  • After hitting a natural phase boundary (see below)
  • After 3+ failed strategies in the same category — compact the dead-end reasoning

Why This Matters for Offsec

Auto-compaction in a CTF session can:

  • Mangle CVE payloads — null bytes, backticks, escape sequences get stripped by markdown summarization
  • Lose enumeration context — which ports you already checked, which creds you already tried
  • Break multi-step exploit chains — partial state from stage 1 vanishes before stage 2
  • Repeat failed strategies — without the failure context, you try the same dead-end again

Strategic compaction at phase boundaries avoids all of this because Neo4j graph data and workspace files persist independently.

CTF Phase Model and Compact Points

Recon --> Enumeration --> Initial Access --> Post-Exploit Enum --> Lateral/Privesc --> Flag

Natural Compact Points

After this phase... Compact? Why
Full port scan + service enum Yes Nmap/gobuster output is massive. Findings are in Neo4j — you don't need raw output in context
Failed exploit chain (3+ attempts) Yes Dead-end reasoning pollutes context. Update attempts as failed in Neo4j first, then compact with fresh approach
Got initial shell + posted creds/shell Yes New user = fresh enumeration cycle. Prior exploitation context is noise now
Got new user (lateral movement) Yes Same as above — record creds/shell in Neo4j, compact, re-enumerate as new identity
Pivoting to completely different service Yes Web exploit context is useless for binary exploitation and vice versa

Read the full file on GitHub · 260 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. 6d ago First seen · 260 lines · 26 tokens per session scan A 00ff66b1ed1e

Subscribe to this mod's changes

strategy-compact is a skill published in the GitHub repository d0gesec/pownie (24 stars, last pushed 5mo ago), licensed MIT. It adds 26 tokens to every session and 3,151 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-30.