Problem
get_container_name() hashes $PWD, and every subcommand (stop, rm, exec, ssh server, update, git, aws, gh, attach) resolves the container from the current directory. Consequences:
cd ~/projects/myapp && dclaude # creates container A
cd ~/projects/myapp/src
dclaude stop # "No container found for this directory"
dclaude # silently creates a SECOND container for the same project
- Day-to-day commands fail confusingly from subdirectories
- Plain
dclaude from a subdirectory spawns a duplicate container (own volume mounts, own SSH port) for what the user thinks is the same project
- Containers accumulate per-path with no
dclaude ls to see them (cleanup requires the raw docker ps --filter name=dclaude incantation)
Proposed fix
- Resolve the "project root" before hashing — walk up to the nearest
.dclaude file or .git directory (the .dclaude walk already exists in find_config_file()), falling back to $PWD
- Add
dclaude ls to enumerate dclaude containers with their paths (path could be stored as a label at creation, e.g. dclaude.path=$HOST_PATH)
Backward-compat note: changing the hash input orphans existing containers; a transition warning or fallback lookup by label would help.
Found during a full-project code review.
Problem
get_container_name()hashes$PWD, and every subcommand (stop,rm,exec,ssh server,update,git,aws,gh,attach) resolves the container from the current directory. Consequences:dclaudefrom a subdirectory spawns a duplicate container (own volume mounts, own SSH port) for what the user thinks is the same projectdclaude lsto see them (cleanup requires the rawdocker ps --filter name=dclaudeincantation)Proposed fix
.dclaudefile or.gitdirectory (the.dclaudewalk already exists infind_config_file()), falling back to$PWDdclaude lsto enumerate dclaude containers with their paths (path could be stored as a label at creation, e.g.dclaude.path=$HOST_PATH)Backward-compat note: changing the hash input orphans existing containers; a transition warning or fallback lookup by label would help.
Found during a full-project code review.