MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / install

Method install

atomic-agent/src/hooks/claude_code/mod.rs:90–113  ·  view source on GitHub ↗
(&self, repo_root: &Path)

Source from the content-addressed store, hash-verified

88 }
89
90 fn install(&self, repo_root: &Path) -> AgentResult<usize> {
91 let settings_path = Self::settings_path(repo_root);
92 let (mut raw, mut hooks) = settings::read_settings(&settings_path)?;
93
94 let count = install_hooks_into(&mut hooks, &settings_path)?;
95
96 // Add permissions.deny rule to prevent Claude from reading metadata
97 let permissions_changed = settings::ensure_deny_rule(&mut raw);
98
99 if count == 0 && !permissions_changed {
100 return Ok(0);
101 }
102
103 // Serialize hooks back into raw settings
104 let hooks_val = serde_json::to_value(&hooks).map_err(|e| AgentError::ConfigError {
105 operation: "serialize hooks".to_string(),
106 path: settings_path.clone(),
107 reason: e.to_string(),
108 })?;
109 raw.insert("hooks".to_string(), hooks_val);
110 settings::write_settings(&settings_path, &raw)?;
111
112 Ok(count)
113 }
114
115 fn uninstall(&self, repo_root: &Path) -> AgentResult<()> {
116 let settings_path = Self::settings_path(repo_root);

Calls 6

read_settingsFunction · 0.85
install_hooks_intoFunction · 0.85
ensure_deny_ruleFunction · 0.85
write_settingsFunction · 0.85
cloneMethod · 0.45
insertMethod · 0.45