Skip to content

ericrisco/rsc-harness / skills/context-budget

context-budget

Verified

Use when a long-horizon task is filling the context window and you must decide what to keep, offload, drop, or hand off to a fresh window — when to compact, what the summary must preserve, and whether to isolate a read-heavy subtask in a subagent. NOT dollar spend or caps (that is cost-tracking), NOT finding context via embeddings (that is rag).

FileKindSize
SKILL.mdskill md9.4 KB
evals/README.mdmarkdown832 B
evals/cases.yamlconfig2.5 KB
references/handoff-and-compaction.mdmarkdown3.4 KB

references/handoff-and-compaction.md

View on GitHub
# Handoff and compaction (the version-specific detail)

This file holds the material that rots fastest — the exact server-side compaction API
contract and the concrete templates. Re-verify the numbers against the live docs before you
quote them; they are dated, not eternal.

## Server-side compaction API contract

Source: Claude API "Compaction" docs, accessed 2026-06-02.

- **Beta header:** `compact-2026-01-12`
- **Edit type:** `compact_20260112`
- **Default trigger:** `trigger.type = "input_tokens"`, `trigger.value = 150000` (minimum allowed: `50000`)
- **`pause_after_compaction`:** defaults `false` (the model continues straight from the summary)

### Behaviour you must account for

1. When the trigger fires, the API emits a **compaction block** and **drops all blocks before it**, continuing from the `<summary>` it produced.
2. You must **append the whole response — including the compaction block — to subsequent requests.** If you strip the compaction block, the next request loses the summarised state. This is the easiest thing to get wrong.
3. The summary is generated by a default prompt that distils the prior turns into a `<summary>`; you can steer what it preserves the same way you steer a manual `/compact` (keep decisions, paths, TODOs).

### Minimal request shape (illustrative)

```json
{
  "betas": ["compact-2026-01-12"],
  "context_management": {
    "edits": [
      {
        "type": "compact_20260112",
        "trigger": { "type": "input_tokens", "value": 150000 },
        "pause_after_compaction": false
      }
    ]
  }
}
```

Treat the field names as version-stamped: the `compact_20260112` suffix *is* the version. When
the beta graduates or revs, this block changes — do not assume it.

## Progress-file template

Drop this in the workspace (e.g. `claude-progress.txt` or `PROGRESS.md`) and rewrite it before
you run low on window. A fresh session should resume from this in a single read.

```markdown
# Progress: <task name>

## Goal
<one or two sentences — what "done" looks like>

## Done
- <unit completed> — proof: <commit hash / file path / test name>
- ...

## In progress
- <the one unit currently open> — current state: <where it stands>

## Next
1. <the very next concrete step>
2. <then this>

## Gotchas / constraints
- <non-obvious thing that will bite a fresh window>
- <decision that must not be relitigated, and why>

## Key paths
- <path:line> — <what lives there>
- ...
```

Rules:

- **One unit at a time.** Close a unit, record its proof (a commit hash beats a paragraph), then open the next.
- **Proof over prose.** "Done: auth migration — commit a1b2c3d, tests in auth/migrate.test.ts" beats three paragraphs describing it.
- **Write it before you need it.** A handoff written at 60% is calm and complete; one scrambled at 97% is missing the gotchas.

## Good vs. bad summary checklist

A summary (manual `/compact`, server-side, or a handoff note) is judged by one question:
**can a fresh window resume the task from it alone?**

**Keep (load-bearing):**

- Decisions made, and the one-line reason for each.
- Every file path touched, with `path:line` where it matters.
- Open TODOs and the next concrete step.
- Constraints and gotchas a fresh window can't re-derive.

**Drop (noise):**

- Raw tool logs and full command output.
- Dead-end exploration ("tried X, didn't work" collapses to one line, not the transcript).
- Redundant restatements of things already captured.
- Pleasantries and meta-commentary about the process.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall