coily lockdown writes .claude/settings.json without trailing newline, fighting end-of-file-fixer #135

Closed
opened 2026-05-28 07:01:15 +00:00 by coilysiren · 1 comment
Owner

Problem coily lockdown writes .claude/settings.json without a trailing newline, fighting end-of-file-fixer.

After coily lockdown --apply --replace (or coily setup's recursive re-baseline), .claude/settings.json shows a \ No newline at end of file diff in any repo whose committed copy ends in a trailing newline:

-}
+}
\ No newline at end of file

In repos where the end-of-file-fixer pre-commit hook runs, the committed copy gets a trailing newline, but coily regenerates without one. Every coily upgrade / re-baseline re-dirties .claude/settings.json; the next commit re-adds the newline; the two tools fight forever.

Observed on coily v2.43.0 (Linuxbrew, kai-server). Repos showing only the newline diff after re-baseline: agentic-os-kai, cli-guard, coily, repo-recall.

Fix Have the lockdown renderer emit a trailing newline on settings.json (and check lockdown-deny.sh). Standard for generated files; removes the perpetual churn against end-of-file-fixer.

Surfaced while upgrading local coily 2.29.1 -> 2.43.0 and re-baselining lockdown across the coilysiren/* tree.

**Problem** coily lockdown writes `.claude/settings.json` without a trailing newline, fighting `end-of-file-fixer`. After `coily lockdown --apply --replace` (or `coily setup`'s recursive re-baseline), `.claude/settings.json` shows a `\ No newline at end of file` diff in any repo whose committed copy ends in a trailing newline: ``` -} +} \ No newline at end of file ``` In repos where the `end-of-file-fixer` pre-commit hook runs, the committed copy gets a trailing newline, but coily regenerates without one. Every coily upgrade / re-baseline re-dirties `.claude/settings.json`; the next commit re-adds the newline; the two tools fight forever. **Observed on** coily v2.43.0 (Linuxbrew, kai-server). Repos showing only the newline diff after re-baseline: agentic-os-kai, cli-guard, coily, repo-recall. **Fix** Have the lockdown renderer emit a trailing newline on `settings.json` (and check `lockdown-deny.sh`). Standard for generated files; removes the perpetual churn against `end-of-file-fixer`. Surfaced while upgrading local coily 2.29.1 -> 2.43.0 and re-baselining lockdown across the coilysiren/* tree.
Author
Owner

Root cause and fix are in cli-guard (the lockdown renderer): coilysiren/cli-guard#32, fixed in cli-guard@02aeb5b. The renderer now appends a trailing newline to .claude/settings.json, matching user_hook.go, with regression test TestBuildPlan_AfterEndsWithNewline.

This won't reach coily lockdown output until cli-guard is tagged and coily bumps its cli-guard dependency, rebuilds, and ships a new release. Leaving this open until a coily release carries the fix; closing cli-guard#32 as the code-level fix.

Root cause and fix are in cli-guard (the lockdown renderer): coilysiren/cli-guard#32, fixed in cli-guard@02aeb5b. The renderer now appends a trailing newline to `.claude/settings.json`, matching `user_hook.go`, with regression test `TestBuildPlan_AfterEndsWithNewline`. This won't reach `coily lockdown` output until cli-guard is tagged and coily bumps its cli-guard dependency, rebuilds, and ships a new release. Leaving this open until a coily release carries the fix; closing cli-guard#32 as the code-level fix.
Sign in to join this conversation.
No labels
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-bridge/coily#135
No description provided.