Fixes #4601: Exclude Terraform and Terragrunt cache directories from checkpoints #4666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #4601
This PR fixes issue #4601 by adding and directories to the checkpoint exclusion patterns, preventing these large cache directories from being included in snapshots and reducing disk space usage.
Changes Made
Problem Solved
When working on Terraform/Terragrunt IaC projects, Roo Code's checkpoint system was including large cache directories in snapshots, consuming excessive disk space. Early in a project, these paths may not be included in .gitignore, so they were saved in every checkpoint, sometimes consuming 10x more disk space than needed.
Solution
The checkpoint system will now automatically exclude these directories from all checkpoints, just like other build artifacts (node_modules/, .gradle/, etc.). The checkpoint system writes these patterns to .git/info/exclude in the shadow repository, ensuring Git ignores them regardless of .gitignore.
Testing
Acceptance Criteria Met
✅ Given I'm working on an 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
Fixes #4601
Important
Adds
.terraform/and.terragrunt-cache/to checkpoint exclusion patterns inexcludes.tsto reduce disk space usage..terraform/and.terragrunt-cache/to exclusion patterns ingetBuildArtifactPatterns()inexcludes.ts.getExcludePatterns()inexcludes.tsto include new patterns.excludes.spec.tsto verify.terraform/and.terragrunt-cache/are excluded..gitattributesfile.This description was created by
for 27ae143. You can customize this summary. It will automatically update as commits are pushed.