Skip to content

for superpowers:writing-plans, wheen create a long plan, try to write more times instead of write a large file once #1947

Description

@Birdjyy

Before filing: Please search open and closed issues. Many features have been requested before — some were implemented differently, some are in progress, and some were intentionally declined.
  • I searched existing issues and this has not been proposed before.

What problem does this solve?

When using superpowers:writing-plans to write a long plan document (approximately 1600 lines), the write operation fails with errors like Error writing file or Invalid tool parameters.
Error log example:
Read 1 file, listed 2 directories (ctrl+o to expand)⏺ Now that I have all the necessary information, I'll start writing the plan file. ⎿ Error writing file ⎿ Error writing file ⎿ Error writing file⏺ I'm using the writing-plans skill to create the implementation plan. Let me write it now. ⎿ Error writing file⏺ I'm experiencing a tool issue preventing me from writing the plan file. Let me try a different approach and write it through Bash. ⎿ Invalid tool parameters⏺ I'm using the writing-plans skill to create the implementation plan. Let me write the plan now. ⎿ Interrupted · What should Claude do instead?

Specific scenario: When I need to create a detailed plan for a large, complex project, the plan document naturally grows to over a thousand lines. At this point, Superpowers attempts to write the entire plan to a file in one operation, but fails due to the file size exceeding some unknown threshold. This error is not consistently reproducible but correlates with plan length.
Impact:
  • Workflow interruption: Once the write fails, the entire planning workflow is halted. Already-generated content cannot be saved.
  • Requires manual intervention: The AI agent cannot automatically recognize the root cause and take corrective action—a human operator must step in.
  • Increased cognitive load: Users must remember the implicit limitation that "plans cannot be too long" and proactively intervene during every long-plan session by requesting chunked writes. This defeats the tool's design goal of helping users focus on high-value work.

Proposed solution

  1. Built-in threshold detection: Implement a conservative line/character threshold (e.g., 500 lines or 10,000 characters) within writing-plans. When the plan content exceeds this threshold, automatically trigger a chunked writing strategy instead of writing all at once.
  2. Error recovery mechanism: When write failures like Error writing file or Invalid tool parameters occur, Superpowers should recognize that file size may be the cause and automatically retry using a chunked writing mode, rather than failing immediately.
Implementation approach:
  • Split long plans by section or fixed line count into multiple chunks
  • Write chunks sequentially (append mode) or to separate fragment files
  • Ensure idempotency to avoid duplication during retries

What alternatives did you consider?

Alternative: Explicitly instruct Claude Code to write the plan in multiple chunks.
Add a prompt instruction like "write every 500 lines at a time."
Why this is not sufficient:
  • Neither the Superpowers skill nor the Claude Code CLI currently recognizes that the write failure is caused by excessive plan length. When the error occurs, the AI agent does not automatically retry or adjust its strategy—it simply reports the error and waits for human intervention, as shown in the error log above.
  • Users must anticipate how long a plan will be and manually add extra instructions every time they write a long plan, which increases cognitive load and friction.
  • Even with chunked-writing instructions, the AI cannot intelligently handle retry logic (e.g., whether to append or restart) when an individual chunk write fails, potentially leading to incomplete or duplicated content.

Is this appropriate for core Superpowers?

Yes. This issue applies universally to any user writing detailed plans for large projects, whether in software development, system design, or other complex domains.
Automatic chunked writing is a general-purpose file operation enhancement, not domain-specific. It should be part of Superpowers' core capabilities because:
  • File reading/writing is one of the most fundamental operations
  • Content length limits are a common system constraint
  • Automated error recovery significantly improves robustness and user experience
Making this a separate plugin would require users to install and configure it manually, undermining the "batteries-included" experience.

Environment (required)




Field Value
Superpowers version 2.1.152
Harness (Claude Code, Cursor, etc.) Claude Code
Harness version v2.1.152
Your model + version Claude Sonnet 4.6
All plugins installed Superpowers core plugins (writing-plans, etc.)

Context

  • Reproduction steps: During large-scale project planning, generated a plan document of approximately 1600 lines (containing dozens of subtasks, detailed steps, acceptance criteria, etc.)
  • Error message: Error writing file / Invalid tool parameters / Interrupted
  • Workaround: Manual intervention—ask the AI to write the plan content in chunks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions