CC-301i · Module 2
Task Decomposition for Scale
3 min read
Large tasks in large codebases fail when attempted as a single Claude session. The context budget runs out before the task is complete — Claude has read fifty files, the conversation is twenty turns deep, and it starts forgetting the decisions it made at turn three. The solution is task decomposition: break the large task into independent sub-tasks, each completable in a single session with a fresh context window.
The decomposition method: start with a planning session where Claude reads the relevant architecture and proposes a breakdown. "I need to add authentication to this application. Plan the work as independent tasks, where each task can be completed in a single session without depending on the others." Claude produces: "Task 1: Create the user model and database migration. Task 2: Implement login and registration routes. Task 3: Add middleware for route protection. Task 4: Update the frontend to handle auth state." Each task is scoped to a few files, completable in one session, and mergeable independently.
Do This
- Start with a planning session that produces independent sub-tasks
- Scope each task to fit in a single session — 3-5 files, clear deliverable
- Complete each task on its own branch for clean merging
- Use CLAUDE.md to document cross-task conventions decided during planning
Avoid This
- Attempt a 20-file refactoring in a single session — context will degrade
- Create sub-tasks with circular dependencies on each other
- Skip the planning session and jump directly into coding
- Rely on Claude remembering decisions from a previous session without documentation