Skip to content

fix: use relative paths for task attachments to match permission patterns#267

Merged
bborn merged 1 commit intomainfrom
task/578-make-sure-task-attachments-are-actually
Jan 23, 2026
Merged

fix: use relative paths for task attachments to match permission patterns#267
bborn merged 1 commit intomainfrom
task/578-make-sure-task-attachments-are-actually

Conversation

@bborn
Copy link
Copy Markdown
Owner

@bborn bborn commented Jan 23, 2026

Summary

  • Fixed task attachments not being accessible to the task executor due to path mismatch
  • The permission pattern Read(.claude/attachments/**) uses relative paths, but attachments were listed with absolute paths in the prompt
  • Changed getAttachmentsSection to convert absolute paths to relative paths by stripping the worktree prefix

Root Cause

The setupClaudeHooks function pre-approves reading from .claude/attachments/** using a relative path pattern. However, prepareAttachments was generating absolute paths like /Users/bruno/Projects/workflow/.task-worktrees/578/.claude/attachments/task-123/file.txt and including those in the prompt. Claude's permission matching couldn't match absolute paths against the relative pattern.

Test plan

  • All existing tests pass
  • Updated tests verify paths are now relative in the prompt
  • Tests verify retry feedback uses relative paths

🤖 Generated with Claude Code

…erns

The permission pattern Read(.claude/attachments/**) uses relative paths,
but attachments were being listed with absolute filesystem paths in the
prompt. This caused Claude to be unable to read attachment files without
permission prompts, since the absolute paths didn't match the relative
permission pattern.

Changed getAttachmentsSection to convert absolute paths to relative paths
by stripping the worktree prefix. This ensures the paths in the prompt
(like .claude/attachments/task-123/file.txt) match the pre-approved
permission pattern.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bborn bborn merged commit f7fd311 into main Jan 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant