You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Grounding refresh writes mixed line endings in .cursor/rules/hunch.mdc and .windsurf/rules/hunch.md (Windows, CRLF repo) #657
What happens
After a grounding refresh (hunch grounding --refresh, or the refresh the post-merge / post-commit hooks run), .cursor/rules/hunch.mdc and .windsurf/rules/hunch.md end up with mixed line endings, both in the working tree and in the index (git ls-files --eol → i/mixed w/mixed).
In both files, the generated block body is CRLF, but these lines are LF:
the front matter (lines 1–5: ---, description: …, alwaysApply: true, ---, blank)
the <!-- HUNCH:END --> marker
the trailing blank line
CLAUDE.md, AGENTS.md and .github/copilot-instructions.md stay pure CRLF, so this looks specific to the writers that add front matter around the block.
Repro
A Windows repo where these files are committed as CRLF.
Normalize both files to CRLF and commit.
Run a refresh (or make any commit that triggers the hook refresh).
Impact
Line-ending churn in every refresh diff (each refresh rewrites ~14 lines in each file when only the count line changed). It can't be worked around locally: normalizing the files and committing triggers another hook refresh, which writes the mixed endings again.
Expected
Detect the file's existing EOL (or follow core.autocrlf / .gitattributes) and use it for the front matter and end marker too, as the block body already does.
Activity