Use when running long coding sessions that approach context limits - provides strategies for compaction vs context resets, structured handoffs, and managing context anxiety across model versions
From cc-harnessnpx claudepluginhub jinsong-zhou/cc-harness --plugin cc-harnessThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Delivers DB-free sandbox API regression tests for Next.js/Vitest to catch AI blind spots in self-reviewed code changes like API routes and backend logic.
Strategies for maintaining coherence and performance during multi-hour autonomous coding sessions. Based on lessons from building complex applications over 3-6+ hour sessions.
Models lose coherence on lengthy tasks as the context fills. Symptoms:
Some models begin wrapping up work prematurely as they approach what they believe is their context limit. Symptoms:
"Claude Sonnet 4.5 exhibited context anxiety strongly enough that compaction alone wasn't sufficient to enable strong long task performance, so context resets became essential."
What: Summarize earlier conversation in place so the same agent continues on shortened history.
When to use:
Strengths:
Weaknesses:
What: Clear the context window entirely, start a fresh agent with structured handoff.
When to use:
Strengths:
Weaknesses:
| Model | Context Anxiety | Coherence Duration | Recommended Strategy |
|---|---|---|---|
| Sonnet 4.5 | Strong | ~30 min | Context resets essential |
| Opus 4.5 | Minimal | ~1-2 hours | Compaction usually sufficient |
| Opus 4.6 | Minimal | 2+ hours | Compaction sufficient; can run coherently for full builds |
Is the agent showing context anxiety?
├── Yes → Context reset with structured handoff
└── No
├── Is quality degrading? (inconsistencies, forgotten patterns)
│ ├── Yes → Try compaction first, reset if no improvement
│ └── No → Continue, monitor for degradation
└── At a natural breakpoint? (feature complete, phase transition)
├── Yes → Good time for preventive compaction
└── No → Continue
When performing a context reset, write harness/context-handoff.md:
# Context Handoff
## Project State
[What has been built — completed features with status]
- Feature 1: PASS (2 iterations)
- Feature 2: PASS (1 iteration)
- Feature 3: In progress — sprint contract written, not yet implemented
## Current Task
[What the new agent should work on next — be specific]
## Architecture Decisions
[Key decisions that must be preserved — include reasoning]
- Using Zustand for state management — chosen over Redux for simplicity,
all stores in `src/store/`
- API routes prefixed with `/api/v1/` — versioned for future compatibility
- SQLite with WAL mode — single-file DB in `data/app.db`
## File Map
[Key files and their purposes — the new agent needs this to navigate]
- `src/components/Editor.tsx` — Main editor component (canvas + tools)
- `src/components/Sidebar.tsx` — Tool palette and settings panels
- `src/api/routes/` — All FastAPI route modules
- `src/store/editorStore.ts` — Editor state (zoom, tool, selection)
- `SPEC.md` — Product specification (source of truth)
- `harness/` — Harness communication files
## Known Issues
[Problems discovered but not yet fixed]
- Tile palette scrollbar barely visible in dark theme
- Grid overlay flickers during rapid zoom changes
## Conventions Established
[Patterns the new agent must follow for consistency]
- Components: PascalCase, one component per file
- API routes: snake_case, grouped by resource in separate modules
- State: Zustand stores, named `*Store.ts`
- Styling: Tailwind CSS with project-specific color tokens in tailwind.config
- Error handling: try/catch on all API calls, toast notifications for user-facing errors
## Next Steps
1. Implement Feature 3 per the sprint contract in harness/sprint-contract.md
2. After completion, write sprint-result.md for evaluator
3. Remaining features from SPEC.md: Feature 4, Feature 5, Feature 6