Skip to content

docs: add git worktree workflow guidance#9

Merged
andyxhadji merged 4 commits into
mainfrom
lacy-activity
May 30, 2026
Merged

docs: add git worktree workflow guidance#9
andyxhadji merged 4 commits into
mainfrom
lacy-activity

Conversation

@andyxhadji
Copy link
Copy Markdown
Owner

Summary

Documents the git worktree workflow and resolves common /var/nd/work directory not found errors when working across multiple worktrees.

Changes

  • CLAUDE.md: Added "Working in Git Worktrees" section with common issue troubleshooting
  • AGENTS.md: Added detailed troubleshooting for docker workspace mount issues when using git worktrees

Problem Solved

When docker containers are started from one worktree but code is being worked on in another, the volume mount ${ND_WORKSPACE_ROOT:-./.nd-workspace}:/var/nd is relative to where docker-compose up was run, not the current directory. This causes WorkspaceClient.prepare() to fail with [Errno 2] No such file or directory: '/var/nd/work'.

Documentation Additions

  1. Root cause explanation: Why the issue occurs with relative volume mounts
  2. Diagnostic commands: How to identify which worktree containers are running from
  3. Solution: Step-by-step guide to restart containers from current worktree
  4. Alternative approach: Using absolute ND_WORKSPACE_ROOT for shared workspace across worktrees
  5. Container naming clarification: Explains that container names are based on directory name

Test plan

  • Reproduced the /var/nd/work error with containers from different worktree
  • Followed documented solution to restart containers from current worktree
  • Verified /var/nd/work directory is accessible after fix
  • Verified AWS credentials load correctly in new containers
  • Documentation is clear and complete

🤖 Generated with Claude Code

fh-ahadjigeorgiou and others added 3 commits May 30, 2026 10:13
Documented common issue where `/var/nd/work` directory is not found when
docker containers are started from a different worktree than the current
working directory. The volume mount `${ND_WORKSPACE_ROOT:-./.nd-workspace}:/var/nd`
is relative to where `docker-compose up` was run, not the current directory.

Added troubleshooting section to both CLAUDE.md and AGENTS.md with:
- Root cause explanation and diagnostic commands
- Solution: restart containers from current worktree
- Alternative: shared workspace across worktrees using absolute path
- Container naming pattern clarification (based on directory name)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Expanded the "Lint and format before committing" step in both CLAUDE.md
and AGENTS.md to show the exact commands with inline comments explaining
what each does. Emphasized that CI enforces linting.

Changes:
- Added code block showing `ruff check .` and `ruff format .`
- Added inline comments explaining each command
- Clarified that all linting must pass before committing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixed bug in _parse_task_body where issue task data was incorrectly stored
using mr_number and mr_url keys instead of issue_number and issue_url.

The parser now correctly extracts:
- issue_number (instead of mr_number)
- issue_url (instead of mr_url)

This allows _extract_source_metadata to properly construct MR bodies with
"Addresses <issue_url>" when creating merge requests for issue tasks.

Also includes ruff formatting fixes for nd/worker/agent.py and
tests/e2e/test_suite_structure.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixed bug where publish_changes was looking for context["mr_url"] even for
issue tasks, causing MR bodies to be "Addresses " with no URL.

Now correctly checks for issue_url first, then falls back to mr_url for MR
tasks. This ensures MRs created from issues have proper "Addresses <issue_url>"
bodies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@andyxhadji andyxhadji merged commit 99a4560 into main May 30, 2026
4 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.

2 participants