MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / migrate_remove_hooks

Function migrate_remove_hooks

src/agents/claude.rs:648–661  ·  view source on GitHub ↗

Remove every tracedecay hook (command contains `"tracedecay"`) from the five events in `settings.json`, leaving non-tracedecay hooks intact.

(settings_path: &Path)

Source from the content-addressed store, hash-verified

646/// Remove every tracedecay hook (command contains `"tracedecay"`) from the
647/// five events in `settings.json`, leaving non-tracedecay hooks intact.
648fn migrate_remove_hooks(settings_path: &Path) {
649 if !settings_path.exists() {
650 return;
651 }
652 let Ok(mut settings) = load_json_file_strict(settings_path) else {
653 return;
654 };
655 if remove_tracedecay_hooks(&mut settings) && backup_and_write_json(settings_path, &settings) {
656 eprintln!(
657 "\x1b[32m✔\x1b[0m Migrated: removed config-managed hooks from {}",
658 settings_path.display()
659 );
660 }
661}
662
663/// Strip tracedecay hook entries from all managed events. Returns true if
664/// anything was removed. Shared by migration and uninstall.

Callers 2

check_install_staleFunction · 0.85

Calls 4

load_json_file_strictFunction · 0.85
remove_tracedecay_hooksFunction · 0.85
backup_and_write_jsonFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected