Free, open source blog writer for Claude Code. Researches current sources, writes answer-first posts for Google and AI answers, has an independent reviewer score each one out of 100 and ships only after five delivery gates. 32 skills, 30 /blog commands, 5 agents. Active development at AI-Marketing-Hub/claude-blog; public releases ship here.
type: flow title: "Context Compaction Routine" status: active created: 2026-08-25 updated: 2026-08-25 tags: [memory, handoff, flow] domain: "Blog Content Brain" confidence: verified related: - "[[Memory Governance Policy]]" - "[[Uncertainty Eval Policy]]" - "[[Provenance Trace Policy]]" - "[[Explore Plan Code Commit]]" - "[[Claim Verification Flow]]" - "[[Evidence Gap Register]]" - "[[hot|Hot]]" - "[[log]]" source_urls: - "https://developers.google.com/search/docs/fundamentals/creating-helpful-content"
Context Compaction Routine
Trigger
Compact when the working context is too large to preserve accurate execution, when a task crosses a long verification boundary, or when another operator must resume without redoing completed work.
Prerequisites
- Current user outcome.
- Repository and branch.
- Active authorization boundaries.
- Current plan.
- Dirty-worktree inventory.
- Completed edits.
- Commands and results.
- Source decisions.
- Remaining blockers.
- Exact next action.
Steps
1. Restate the outcome
Capture the current request in one sentence. Drop stale conversational branches that no longer affect the work.
2. Freeze boundaries
Record what is authorized and what is not. Commit, push, publish, deploy, spending, account changes, and third-party contact remain separate unless explicitly approved.
3. Record location
Write the repository path, branch, relevant subdirectory, and named contracts. Do not include credentials or personal identifiers.
4. Preserve worktree facts
List modified and untracked paths that matter. Mark user-owned paths that must remain untouched. Do not describe an untracked artifact as generated by the current task unless known.
5. Summarize evidence
Separate verified fact, inference, suspicion, and unavailable checks. Include primary-source URLs for volatile claims and exact local paths for code claims.
6. Summarize changes
List implemented behavior, not merely files. Identify generated files and their source declaration.
7. Record verification
For each gate, record exact command, exit state, count, and first relevant failure. Distinguish focused, broad, static, browser, native, live, and human review.
8. Record failures
Keep failed attempts that change the next approach. Remove noisy attempts that add no decision-relevant information.
9. Update the plan
Mark completed, active, and pending steps. Keep only one step active.
10. Name the next action
The resume point should be executable without rediscovery, such as “run the dry source verifier and classify threshold failures.”
11. Validate the handoff
Check that no success is claimed without evidence, no contradiction was lost, and no external action is implied.
12. Resume naturally
Continue from the next action. Do not restart completed exploration or repeat already delivered progress unless the underlying state changed.
Outputs
| Section | Required content |
|---|---|
| Goal | Current outcome |
| Rules | Authorization and safety boundaries |
| Location | Repository, branch, relevant paths |
| Worktree | Modified and protected files |
| Evidence | Facts, inferences, suspicions |
| Changes | Implemented behavior |
| Verification | Commands and results |
| Failures | Decision-relevant failed attempts |
| Plan | Completed, active, pending |
| Next action | One concrete resume point |
| Sources | Primary URLs |
| Risks | Remaining uncertainty |
Gates
- The outcome is current.
- Authorization boundaries are explicit.
- User-owned work is preserved.
- No secret appears.
- Source claims are traceable.
- Verification claims have commands.
- Failures are not hidden.
- External state is not inferred.
- The next action is concrete.
- The handoff is shorter than the context it replaces.
Failure modes
- Treating a previous request as current.
- Dropping a user-owned untracked path.
- Saying “tests pass” without counts.
- Omitting a failed audit.
- Copying raw tool output with secrets.
- Losing source URLs.
- Confusing a planned correction with an applied edit.
- Restarting from scratch after compaction.
- Marking external publication complete.
- Hiding that human review remains.
Rollback
If the compacted handoff is inaccurate, stop execution, compare it with the latest verified state, correct the handoff, and resume only from facts that can be re-established. Do not compensate by guessing. If a wrong change followed the handoff, revert only the scoped edit after inspecting the current diff.
Retention rule
Keep durable product decisions in [[Memory Governance Policy]] surfaces. Keep the compaction itself task-scoped. A handoff is an execution aid, not a new authority or a permanent source of truth.
Compaction quality sample
Before resuming, sample one completed change, one source claim, one failed gate, and one authorization boundary against the live state.
| Sample | Pass condition |
|---|---|
| Changed file | Diff matches summary |
| Source claim | Citation supports wording |
| Failed gate | Failure remains visible |
| Plan state | One action is current |
| Protected work | Path remains untouched |
| External boundary | No execution implied |
If any sample fails, correct the handoff before taking another action.