PRODUCT.ENGINEER
ManifestoThe RolePlaybookLoops
All loops
BuildingManual

Context-Window Packer

Compress context into minimal tokens before handing to an agent. Loop until agent succeeds on first pass.

Compatible tools:Claude CodeCursor
Start the "Context-Window Packer" loop.

- Goal: Agent context (CLAUDE.md, relevant files, constraints) is compressed to minimal tokens while retaining enough information for the agent to succeed on its first attempt.
- Max iterations: 5
- Between iterations run: `wc -w CLAUDE.md && cat CLAUDE.md`
- Exit when: Agent completes the target task correctly on first attempt with the packed context, OR word count is under target budget.

Steps:
1. Identify the target task the agent needs to complete
2. List all context files currently referenced (CLAUDE.md, relevant source files, constraints)
3. For each context file: remove redundant information, collapse examples to one, remove obvious/derivable statements
4. Prioritize: constraints > conventions > examples > history
5. Test by running the agent with the compressed context on the target task
6. If the agent fails or drifts, identify what context was missing and add it back minimally
7. If the agent succeeds, try removing one more section and re-test
8. Converge on the minimal context that produces correct output

Self-pacing instructions: After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when exit condition passes or max iterations reached. Give a short status update each pass.

How it works

Context-Window Packer

yesfailsList context filesRemove redundancyTest agent on taskAgent succeeds?Add back missing infoMinimal context
product.engineer

Owning the whole loop, from idea to impact.

Learn

  • Blog
  • Manifesto
  • Authors
  • RSS Feed

Tools

  • Loops
  • Playbook
  • Discovery
  • Cloud Maturity
  • 5 Whys

Opportunities

  • Jobs
  • Hot Jobs
  • Companies
  • The Role
© 2026 product.engineer
||