Sign inGet started
–

Suggests manual context compaction at logical task intervals to preserve important context.

Lift · GLM-5.3-flash+8ppdirectional · all models →
90
Trustsecurity · quality · license · upkeep
Scan Saferisk 0/100
LicenseMITserved via MCP
Claude Haiku 5.5 · GPT-6 Luna — not run yet
Pass-rate Lift+8pp95% CI [−8, +25] · CI includes zero
full tier · not verifiedchat harness (v2)
−100pp+100pp

Pass rate with the skill minus without, same tasks, same model.

baseline
57%
with skill
65%
forced
53%
Content Lift forced arm
−5pp [−20, +10]
Trigger rate
100%
Trials
120 · 8 tasks
Model
GLM-5.3-flash
Measured
2026-10-15

Content Lift = the skill's instructions injected into the system prompt, so it measures what the content does once loaded, apart from whether the agent chooses to load it. Method →

Embed this score · live badge for your README
SkillzBench badge preview

The badge shows the real benchmark number and updates itself when we re-bench — including the honest states (“did not trigger”, “not benched yet”). All badge options →

Markdown[![SkillzBench](https://skillzbench.com/api/badge/strategic-compact.svg)](https://skillzbench.com/skills/strategic-compact)
+ cost/task[![SkillzBench](https://skillzbench.com/api/badge/strategic-compact.svg?cost=1)](https://skillzbench.com/skills/strategic-compact)
HTML<a href="https://skillzbench.com/skills/strategic-compact"><img src="https://skillzbench.com/api/badge/strategic-compact.svg" alt="SkillzBench benchmark" height="20"></a>

A/B outputs — median trial per arm

Chat harness (v2): the agent's final message without the skill (left) vs with it (right).

strategic-compact--m1
baseline · 0.79

Best manual compaction points, in order of value:

  1. After step 1 (requirements gathering) — This is the highest-leverage spot. Requirements are the input to everything downstream, so you want them distilled into a short, stable summary (a "requirements spec" of bullet points) before the schema design work starts generating lots of discussion.

  2. After step 2 (schema design) — Second-best spot. Once the schema is settled, the back-and-forth about alternatives is dead weight. Compact to just the final schema (tables, columns, relationships, key decisions/constraints).

  3. After step 3 (API implementation) — Useful if implementation involved a lot of debugging or exploration. Keep only the endpoint list, signatures, and any non-obvious decisions.

Practical tips:

  • Compact at task boundaries, not mid-task. Compacting in the middle of writing tests or the API risks losing in-flight details (file names, partial edits, error messages you're debugging).
  • Before compacting, write the durable state into the conversation yourself: a short "state summary" — requirements, final schema, endpoints, decisions made, what's done, what's next. Then compact; the summary survives and the noise gets dropped.
  • Skip compaction after steps 4 and 5 if you're nearly done — just finish, since there's little downstream work that needs the context.

So: compact after step 1, again after step 2 (if the design discussion was long), and optionally after step 3.

with skill · 0.85

Based on your 5-phase plan, here are the strategic compaction points:

TransitionCompact?Why
1 → 2 (requirements → schema)✅ YesRequirements gathering is bulky research context; the distilled output is the schema design
2 → 3 (schema → API implementation)✅ YesThe plan is "written down" (schema file) — free up context for the heavy implementation work
3 → 4 (implementation → tests)⚠️ MaybeRecent code context helps write accurate tests. Skip unless context is critically tight
4 → 5 (tests → docs)✅ YesTest output and error traces pollute context for unrelated doc work

Critical caveats given you're already near the limit:

  1. Write state to files before compacting. Save requirements and the schema design to disk (e.g., requirements.md, schema.md) before each /compact. Files persist; conversation context doesn't. Don't rely on a task list surviving — it may not.

  2. Never compact mid-implementation (during phase 3). You'd lose variable names, file paths, and partial state — the costliest possible compaction. If you're tight on context entering phase 3, that's exactly why compacting at the 2→3 boundary matters.

  3. Use /compact with a summary message to steer what's kept, e.g.:

    • After phase 1: /compact Keep the finalized requirements list; moving to schema design
    • After phase 2: /compact Schema is saved in schema.md; focus on API implementation next
  4. Since you're near the limit now: if requirements gathering is already underway, finish it, write the requirements to a file, and compact immediately — that's your first safe boundary.

strategic-compact--m2
baseline · 0.57

Compact now. Context is almost full, and you're mid-task (A) — that's exactly when a compaction is most valuable. Waiting risks a forced/automatic compaction at the worst moment (mid-edit, mid-command), where the summary is generated for you and may drop details you care about. Compacting proactively while you're at a natural checkpoint lets you control what's preserved.

What to include in the compacted summary:

  1. Task state — (A) refactor progress:

    • Which files/functions in the payment module are already refactored, and which remain
    • The target design/pattern you're migrating to (e.g., new interface, error-handling convention, naming)
    • Any in-progress, half-edited file — note its exact current state so you don't double-apply changes
  2. Decisions & constraints (the stuff that's expensive to rediscover):

    • Why you chose this approach over alternatives (so you don't re-litigate it)
    • Backward-compatibility requirements, deprecation rules, anything the legacy code forced on you
    • Any gotchas discovered: hidden side effects, circular imports, weird callers of the old API
  3. Remaining plan:

    • (A) remainder: concrete next steps in order
    • (B) test plan: list the specific edge cases you identified (name them now — this is the easiest thing to lose)
    • (C) README migration notes: key points to cover
  4. Verification state:

    • How you've been testing so far (commands to run, e.g., pytest tests/ -k payment)
    • Known failures or TODOs currently outstanding
  5. Environment/project facts:

    • Repo layout relevant to this work, Python version, test framework, any branch/PR context

What to omit: old failed attempts, long code dumps (re-read files from disk instead), and exploratory dead ends — just note "tried X, didn't work because Y" in one line if it prevents repeating the mistake.

Rule of thumb: the summary should let you resume (A) in your next message with zero re-exploration. If a detail can be recovered by reading a file, leave it out; if it only exists in the conversation (decisions, edge-case lists, gotchas), it must go in.

with skill · 0.85

Short answer: don't compact right now if you can avoid it — but you're close enough to the limit that you should compact at the next natural stopping point within (A), not mid-edit.

Per the compaction decision guide, "mid-implementation" is the worst time to compact: you lose variable names, file paths, and partial state, and you'd likely have to re-read files you've already loaded. But "context almost full" is a real constraint, so the right move is:

  1. Finish a coherent slice of (A) — e.g., complete the current function/class or get the module to a state where it imports cleanly and passes a smoke run. Commit it.
  2. Write your state to disk before compacting — a plan file (e.g., REFACTOR_NOTES.md) or memory. Don't rely on the task list surviving compaction; it may not exist on your setup. Files on disk always persist.
  3. Then run /compact with a focused summary message before starting (B).

What to include in the compacted summary

  • Goal & phase: "Refactoring legacy payment module; (A) ~half done, then (B) unit tests for new edge cases, (C) README migration notes."
  • Concrete code state: exact file paths touched, functions renamed/extracted so far, what's done vs. remaining in (A) — name names, not "partially refactored."
  • Decisions & conventions: any naming, structure, or API-shape choices made during the refactor, and why (so (B)/(C) stay consistent).
  • Known edge cases you've already identified for the (B) tests — this is the thing most likely to be lost and most expensive to reconstruct.
  • Gotchas: legacy quirks discovered (hidden dependencies, deprecated calls, ordering assumptions) that the README notes in (C) should mention.
  • Anything already written to files — just reference the file paths; don't re-summarize file contents.

What to deliberately drop

  • The original legacy code you read (it's still on disk / in git history)
  • Failed attempts and dead-end reasoning, unless the lesson matters
  • Tool-call history and intermediate analysis

If the context truly can't hold until a clean stopping point, compact now but make the summary above extra explicit about the exact remaining edits in (A) — that's the state most at risk.

strategic-compact--m3
baseline · 0.42

Compaction Plan for a 5-Phase Feature Build

When to Compact

Compact at phase boundaries, not mid-phase. Each phase completion is a natural checkpoint where decisions are settled and stable. Schedule:

  • Compaction 1: After Phase 1 (data layer) — this is your highest-risk phase since architectural decisions here cascade into everything else.
  • Compaction 2: After Phase 2 (service layer).
  • Compaction 3: After Phase 3 (REST endpoints).
  • Compaction 4: After Phase 4 (frontend integration), before E2E tests.

At 80% context now, if you're mid-Phase 1, finish the current sub-step, then compact immediately. Don't wait for "more to show for it" — waiting is how details get lost.

If a phase runs long (many sub-steps), allow one mid-phase emergency compaction, but keep it to a bullet skeleton only.

What Goes in Each Compacted Summary

Structure every summary the same way so later phases can rely on it:

1. Architecture decisions (immutable)

  • Schema/entity choices and why (e.g., "chose single-table over normalized because of query pattern X")
  • Naming conventions, ID formats, migration strategy
  • Anything later phases must not contradict

2. Interface contracts

  • Exact function signatures / types the data layer exposes
  • Service method signatures, request/response shapes
  • These are the "handoff points" between phases — losing these is the most expensive failure

3. State of the world

  • Files created/modified with one-line purpose each
  • What's done vs. explicitly deferred
  • Open TODOs and known gaps

4. Decisions rejected

  • One line per alternative considered and why it was rejected — prevents re-litigating the same debate after compaction

5. Environment/test facts

  • How to run migrations, seed data, start dev servers, run tests
  • Gotchas (ports, env vars, flaky setup steps)

How to Avoid Losing Important Details

  1. Write a persistent DECISIONS.md (or similar) in the repo itself. The filesystem is your real long-term memory — context compaction can't touch it. Update it at each phase boundary before compacting, then the summary can be short and just point at it.

  2. Compact proactively, not reactively. Don't wait until you're forced at 95%. Compacting at 80–85% lets you write a careful summary; compacting under pressure produces lossy ones.

  3. Make summaries self-contained. Never write "as discussed above" or "the approach we agreed on" — after compaction there is no "above." Spell out the decision in the summary.

  4. Preserve exact identifiers. Copy-paste real names (UserService.findByTenantId, orders_v2 table) rather than paraphrasing. Paraphrase is where silent drift happens.

  5. Keep a running "contract block" that's carried forward verbatim into every subsequent summary — the current public API of everything built so far. It only grows; it never gets rewritten.

  6. After each compaction, do a 30-second verification: ask yourself (or the assistant) to restate the phase-1 architecture. If it can't, the summary was incomplete — fix it before proceeding.

  7. Front-load risk. Since data-layer decisions constrain everything, spend extra tokens on detail in Compaction 1 and keep later summaries leaner.

Rough Budget

With ~4 hours and 5 phases: aim for ~40 min/phase of work, ~5 min per compaction, and keep the final hour for E2E tests plus fixing what they surface. If you find yourself deep in a phase with context climbing past 85%, cut scope on the current sub-step rather than skipping a compaction.

with skill · 0.53

Compaction Plan for Your 5-Phase Feature

You're at 80% context with ~4 hours of work left — you'll need 2–3 strategic compactions, placed at phase boundaries, never mid-phase.

Rule of thumb

  • Never compact mid-implementation — you'll lose file paths, variable names, and partial state.
  • Always write state to disk before compacting — files survive; conversation context doesn't. Don't rely on a todo list surviving (it may not exist on newer models).

Before any compaction: write a "feature state" file

Create docs/feature-state.md (or similar) in the repo and keep it updated at the end of each phase. This is your durable record. Include:

  1. Architectural decisions (your biggest worry) — e.g., "data layer uses repository pattern over ORM X," "services own all business logic, controllers stay thin," naming conventions, error-handling strategy.
  2. File map — every file created/modified so far, one line each on its purpose.
  3. Interfaces/contracts — the exact function signatures, DTO shapes, and API routes the next phase must consume.
  4. Open questions / TODOs — anything deferred.
  5. Environment quirks — build commands, test commands, config gotchas.

Compaction schedule

PointCompact?What to put in the /compact summary
End of Phase 1 (data layer)✅ Yes"Data layer complete: entities, migrations, repo pattern. Contracts in docs/feature-state.md. Next: service layer must use these interfaces."
End of Phase 2 (service layer)✅ Yes"Services done, business rules finalized. REST endpoints must call service methods per feature-state.md. Drop data-layer exploration details."
End of Phase 3 (REST endpoints)✅ Yes"API routes + contracts frozen. Frontend integration consumes these routes. Drop implementation internals of phases 1–2."
End of Phase 4 (frontend)⚠️ MaybeCompact only if context is tight; keep recent frontend code details for debugging.
Phase 5 (e2e tests)❌ NoYou're near the end; test failures will reference code you just wrote.

That's 3 compactions, each freeing roughly a phase's worth of exploration/tool-call noise while the distilled decisions live in the state file.

How to avoid losing important details

  1. Write before compacting, always. The state file is the source of truth; the /compact summary is just a pointer to it.
  2. Use a focused summary directive: /compact Preserve architectural decisions and API contracts from docs/feature-state.md; drop exploration and debugging details from completed phases.
  3. Commit at each phase boundary. Git state survives compaction — a commit per phase means any lost detail is recoverable from diffs.
  4. Record decisions as they're made, not retroactively — append to feature-state.md the moment you settle something ("chose X over Y because Z").
  5. After each compaction, re-read feature-state.md first to reload the contracts before starting the next phase.

If your session supports the strategic-compact hook, it'll nudge you at the right thresholds — but per the guide above, you should compact at the phase boundaries regardless, since those are the logically clean points.

strategic-compact--m4
baseline · 1.00

Strategic Compaction: Milestones vs. Fixed Intervals

Which is better?

Milestone-based compaction is generally better, but the ideal is a hybrid. Here's why:

Problems with fixed hourly compaction:

  • You may compact mid-thought, losing in-flight reasoning (e.g., halfway through debugging a tricky integration issue)
  • You may not compact when you actually need it — during heavy exploration, context fills fast; during documentation writing, it fills slowly
  • It creates artificial task boundaries that don't match the work

Why milestones win:

  • Compaction at a milestone means the context is at a natural "checkpoint" — outputs are finalized, decisions are made, and the summary captures settled state rather than partial state
  • Risk of losing unresolved threads is much lower

Hybrid rule of thumb: Compact at milestones by default, but add a safety valve — if context pressure is high (approaching limits, noticeable degradation in recall/quality) and you're not near a milestone, do an emergency mini-compaction that explicitly flags all in-flight work as "UNRESOLVED — resume here."

What to keep in a compacted summary

Use a decision-and-artifact-first hierarchy:

  1. Decisions & rationale (why, not just what) — these are impossible to reconstruct cheaply
  2. Artifacts & locations — file paths, dataset names, function signatures, where code lives (don't paste whole code; paste interfaces + pointers)
  3. Open questions & unresolved bugs — explicitly labeled
  4. Key data findings — numbers that drove decisions, with the command/notebook that produced them
  5. Constraints & environment facts — versions, API quirks, performance limits discovered the hard way
  6. Next steps — one line per pending action

What to drop: raw exploration output, dead-end details (keep only a one-line "tried X, failed because Y"), verbose discussion, intermediate data dumps.

Code vs. data vs. design rule: keep code as signatures + pointers, keep data as conclusions + provenance, keep design as decisions + rationale.

Reusable strategy (per-phase template)

For each phase, before compacting, write a structured summary with these sections:

STATE: <one-line phase status>
DECISIONS: <bullet list with rationale>
ARTIFACTS: <paths, signatures, dataset locations>
FINDINGS: <key numbers + how produced>
OPEN ISSUES: <unresolved items, explicitly flagged>
NEXT: <immediate next actions>

Applied to your scenario

Phase 1 — Exploration (context fills fast; compact early and often at sub-milestones):

  • Keep: research conclusions, candidate approaches evaluated, key data observations, rejected alternatives (one line each)
  • Drop: raw search results, full paper excerpts, exploratory plots
  • Milestone: "approach selected" → compact

Phase 2 — Prototyping:

  • Keep: architecture decisions, module signatures, known limitations of the prototype, environment quirks
  • Drop: iteration-by-iteration code changes; keep only the final prototype's interface
  • Milestone: "prototype demonstrates core feasibility" → compact

Phase 3 — Integration (highest risk phase — most in-flight state):

  • Keep: integration points, failing tests with error signatures, dependency/version constraints, workarounds found
  • Drop: successful-but-obvious test runs
  • Milestone: "all components pass integration tests" → compact. If a debugging session must be interrupted, mini-compact with a prominent OPEN ISSUES entry.

Phase 4 — Documentation (context fills slowly; compact only at the end):

  • Keep: the final design summary, API surface, and anything needed to write accurate docs
  • Drop: nearly everything from prototyping churn
  • Milestone: end of phase → final compaction becomes your project handoff summary

Bottom line: switch from hourly to milestone-triggered compaction, with an emergency fallback for context pressure, and always compact using the structured STATE/DECISIONS/ARTIFACTS/FINDINGS/OPEN ISSUES/NEXT template.

with skill · 1.00

Your teammate is right — milestone boundaries beat fixed intervals

Compacting on a clock (every hour) is the same failure mode as auto-compaction: it fires at arbitrary points, possibly mid-implementation, where losing variable names, file paths, and partial state is costly. Compacting at phase/milestone boundaries means the bulky context you're discarding (exploration, dead-end reasoning) is no longer needed, and the distilled output (a plan, a working prototype) is already written down.

The only caveat: if you're approaching the context limit mid-phase, compact anyway — but do it at the nearest safe point (e.g., right after committing a working change), not blindly.

Reusable strategy

When to compact:

  1. After a phase completes and its output is persisted to disk — never before writing the plan/notes to a file. Files survive compaction; conversation context doesn't. Don't rely on a todo list surviving.
  2. After a failed approach — clear dead-end reasoning before pivoting.
  3. Before a context switch (new task, new subsystem).
  4. Under context pressure (~160k on a 200k window) — compact at the nearest safe checkpoint, not mid-edit.
  5. Never mid-implementation of a single coherent change.

What to keep (write into the summary or a file before compacting):

  • Code: file paths, function/variable names, architecture decisions, what's done vs. in-progress. Discard: full file contents you've read, intermediate diffs.
  • Data analysis: final findings, key numbers, dataset locations, and the queries/scripts that produced them (so results are reproducible). Discard: raw output dumps and failed query attempts.
  • Design discussions: decisions made and why, rejected alternatives with one-line reasons, open questions. Discard: the back-and-forth itself.

A good pattern: before compacting, write a NOTES.md (or per-phase notes file) with "Decisions / State / Next steps," then use a directed compact like /compact Focus on implementing the integration layer next.

Applied to your phases

TransitionCompact?Keep
Exploration → PrototypingYesResearch findings, chosen approach + rationale, rejected options, links/sources. Discard raw reading notes.
Prototyping → IntegrationYes (after committing the prototype)Working code locations, API/function signatures, known limitations, test results.
Integration → DocumentationYesFinal architecture, file map, gotchas discovered during integration, anything a doc writer needs.
Mid-integrationNo — unless context pressure forces it; then commit first, compact second.

Practical rhythm: at each phase boundary, (1) write the phase's distilled output to a file, (2) /compact with a one-line directive naming the next phase, (3) start fresh. That gives you the context savings of frequent compaction with none of the mid-task state loss.

strategic-compact--m5
baseline · 0.85

Compress at phase boundaries, not mid-phase — ideally right after each phase's output is safely written to disk (files, not just chat). The code in your repo is the source of truth, so once tests are saved to a file, you don't need the full reasoning that produced them.

Concretely, for your three phases:

  1. After writing tests → compress before implementing. Before compressing, make sure the summary preserves: the exact function signature/contract, the list of edge cases the tests cover, and any tricky test names. This is the highest-risk moment to lose detail — the implementation must match the tests exactly.
  2. After implementing → compress before running the suite. The implementation is on disk; you only need "implementation done, here's the contract it targets."
  3. Don't compress mid-debugging. If the test run fails, capture the failing test names + error messages in a short note first, then compress. Raw failure output is bulky but the distilled version is what you need to fix things.

General thresholds:

  • Compress proactively around ~70–75% of your context limit, or when the oldest half of the conversation is stuff you'd never reference again (exploration dead-ends, earlier drafts).
  • Never compress while you're mid-thought on something stateful (a failing test you're actively diagnosing, a half-written function).

One habit that makes compression cheap: keep a running "state block" at the top of your work — contract, file paths, current phase, open questions. Then compression is just "drop everything except the state block," and nothing important can be lost.

with skill · 1.00

For your three-phase task, the best compaction points are:

  1. After writing the unit tests (end of phase 1) — this is the ideal spot. The tests are on disk, so they persist. Compacting here clears the discussion/reasoning that went into designing them, freeing context for implementation.

  2. Before running the full suite (end of phase 2) — optional. If the implementation is done and committed/saved, compacting before the test run is fine. But if the tests will reference code you just wrote and you might need to debug failures, keep context intact — mid-debugging compaction loses variable names and file paths.

Don't compact mid-implementation (during phase 2) — that's when losing partial state is most costly.

Practical tips:

  • Before compacting, make sure the test file and any plan/notes are written to disk — files survive compaction; conversation reasoning doesn't.
  • Use a targeted summary: /compact Keep the function signature, test file path, and remaining phases so the essentials are preserved.
  • Since you're not near the limit yet, compacting once after phase 1 is likely all you need for a task this size.
Limitations
  • Results are for the SkillzBench reference agent on GLM-5.3-flash. Switch models above — a skill can help one model and not another.
  • Screen tier (1 trial per arm) is directional. Verified needs a full-tier run (≥ 8 tasks, ≥ 3 trials per arm) with the CI excluding zero.
  • Task coverage: 8 generated tasks for this skill's category; a skill can shine elsewhere.