From code-practices
Manage Claude Code sessions effectively. Use during long sessions, multi-step tasks, or when responses start degrading. Covers /clear, checklists, and subagents.
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-practices:context-managementThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use during long sessions, multi-step tasks, or when Claude's responses start degrading in quality.
Use during long sessions, multi-step tasks, or when Claude's responses start degrading in quality.
From Anthropic's Claude Code best practices: "Regularly reset context between tasks to prevent irrelevant conversation and file contents from degrading performance."
/clear Between TasksAfter completing a task, before starting a new one:
/clear
This resets the conversation while keeping:
When to clear:
For migrations, bulk fixes, or multi-file changes:
## Migration Checklist
### Completed
- [x] Update User model
- [x] Update User service
- [x] Update User controller
### In Progress
- [ ] Update User tests ← CURRENT
### Remaining
- [ ] Update API documentation
- [ ] Update client SDK
- [ ] Run full test suite
Have Claude maintain this checklist:
Escape to interrupt:
Escape once to stop current generationDouble-tap Escape to edit:
Escape twice to edit your previous promptRequest undo:
Undo the last change to user-service.ts
Early in complex tasks, use subagents to investigate details:
Use a subagent to research how error handling is done in this codebase.
Report back the patterns found.
Benefits:
Tell Claude what's relevant and what isn't:
Forget about the authentication changes we discussed earlier.
Focus only on the new payment integration.
The relevant files are:
- src/payments/
- src/api/checkout.ts
| Symptom | Solution |
|---|---|
| Claude references old, abandoned approaches | /clear |
| Responses getting slower | /clear or reduce file reads |
| Claude confused about current state | Summarize current state explicitly |
| Repeating the same mistakes | Clear and re-explain requirements |
| Losing track of multi-step task | Use checklist |
## Task: [Migration/Refactor/Bulk Fix Name]
### Overview
[Brief description of the full task]
### Progress Tracking
#### Phase 1: [Name]
- [ ] Step 1.1
- [ ] Step 1.2
- [ ] Step 1.3
#### Phase 2: [Name]
- [ ] Step 2.1
- [ ] Step 2.2
#### Phase 3: [Name]
- [ ] Step 3.1
- [ ] Step 3.2
### Current Focus
[Which item is being worked on NOW]
### Blocked Items
[Items waiting on something]
### Verification
- [ ] All tests pass
- [ ] Manual verification complete
- [ ] Ready for review
Don't:
Do:
npx claudepluginhub joshuarweaver/cascade-code-general-misc-2 --plugin rahulsub-code-practices-pluginGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.