Skip to content

Exclude Terraform and Terragrunt cache directories from checkpoints to reduce storage usage #4601

@ijin

Description

@ijin

What specific problem does this solve?

When working on Terraform/Terragrunt IaC projects, Roo Code's checkpoint system includes large cache directories (.terraform/ and .terragrunt-cache/) in snapshots, consuming excessive disk space.

Early in a project, these paths may not be included in .gitignore, so they’re saved in every checkpoint. As a result, disk space is consumed rapidly—sometimes 10x more than needed—especially with multiple checkpoints per task.

How should this be solved?

Add .terraform/ and .terragrunt-cache/ to the getBuildArtifactPatterns cost in src/services/checkpoints/excludes.ts.

This will automatically exclude these directories from all checkpoints, just like other build artifacts (node_modules/, .gradle/, etc.). The checkpoint system will write these patterns to .git/info/exclude in the shadow repository, ensuring Git ignores them regardless of .gitignore.

How will we know it works? (Acceptance Criteria)

Given I’m working on a initialized Terraform|Terragrunt project with downloaded providers and without .terraform|.terragrunt-cache in .gitignore

When I run work on a task and Roo Code creates checkpoints

Then the .terraform|.terragrunt-cache directory is automatically excluded from checkpoints

And checkpoint size remains small, comparable to projects without Terraform caches

But my actual Terraform/Terragrunt configuration files (.tf, .hcl, etc.) are still included

Estimated effort and complexity

Size: XS (1 minute)
Reasoning: Simple addition of two string patterns to existing array
Main challenges: None - straightforward pattern addition to established system
Dependencies: None - uses existing exclusion infrastructure

Technical considerations (optional but helpful)

No response

Trade-offs and risks (optional)

No response

Additional context (optional)

No response

Proposal checklist

  • I've searched existing Issues and Discussions for duplicates
  • This is a specific, actionable proposal with clear problem and solution
  • I've included concrete acceptance criteria
  • I understand this needs approval before implementation begins

Interested in implementing this?

  • Yes, I'd like to help implement this feature

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions