The TRUE root cause of recurring CRLF: shutil.copy2() in _copy_dir_files() copies hook files byte-for-byte from /plugins/ (mounted from Windows host) into /configs/.claude/hooks/. Windows git checkout introduces \r\n regardless of .gitattributes. Previous fixes were band-aids: - .gitattributes eol=lf (only works for files IN git, not host disk) - entrypoint.sh sed strip (runs at boot but after plugin install) - provisioner CopyTemplateToContainer strip (wrong code path — hooks come through the Python plugin installer, not the Go template copier) This fix strips CRLF at the single point where ALL plugin hooks enter a container: _copy_dir_files() in builtins.py. read_bytes() + replace + write_bytes for .sh/.py files. Other file types pass through unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| builtins.py | ||
| protocol.py | ||
| raw_drop.py | ||