Give settings.json's model one writer per machine, and sort its keys
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Git's clean filter for settings.json: drop "model" and sort every key.
|
||||
|
||||
Claude Code rewrites settings.json, in its own key order, whenever a model is
|
||||
picked or a plugin installed. Each machine owns its model, so git stores the
|
||||
file without it, and neither write shows as a change.
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
|
||||
|
||||
def main() -> None:
|
||||
settings = json.load(sys.stdin)
|
||||
settings.pop("model", None)
|
||||
json.dump(settings, sys.stdout, ensure_ascii=False, indent=2, sort_keys=True)
|
||||
sys.stdout.write("\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user