cc-safe-setup 11.6.0 → 11.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +29 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1881,6 +1881,16 @@ async function profile(level) {
1881
1881
  },
1882
1882
  };
1883
1883
 
1884
+ // Check for saved custom profiles
1885
+ const profilesDir = join(HOME, '.claude', 'profiles');
1886
+ if (level && !PROFILES[level]) {
1887
+ const customPath = join(profilesDir, `${level}.json`);
1888
+ if (existsSync(customPath)) {
1889
+ const custom = JSON.parse(readFileSync(customPath, 'utf-8'));
1890
+ PROFILES[level] = { desc: `Custom profile (saved ${custom.savedAt?.split('T')[0] || '?'})`, hooks: custom.hooks || [] };
1891
+ }
1892
+ }
1893
+
1884
1894
  if (!level || !PROFILES[level]) {
1885
1895
  console.log(c.bold + ' Safety Profiles' + c.reset);
1886
1896
  console.log();
@@ -1890,6 +1900,25 @@ async function profile(level) {
1890
1900
  console.log(` ${c.dim}npx cc-safe-setup --profile ${name}${c.reset}`);
1891
1901
  console.log();
1892
1902
  }
1903
+
1904
+ // Show saved profiles too
1905
+ if (existsSync(profilesDir)) {
1906
+ const saved = readdirSync(profilesDir).filter(f => f.endsWith('.json'));
1907
+ if (saved.length > 0) {
1908
+ console.log(c.bold + ' Saved Profiles' + c.reset);
1909
+ console.log();
1910
+ for (const f of saved) {
1911
+ const sName = f.replace('.json', '');
1912
+ try {
1913
+ const data = JSON.parse(readFileSync(join(profilesDir, f), 'utf-8'));
1914
+ console.log(` ${c.bold}${sName}${c.reset} (${data.hooks?.length || 0} hooks)`);
1915
+ console.log(` ${c.dim}Saved ${data.savedAt?.split('T')[0] || '?'}${c.reset}`);
1916
+ console.log(` ${c.dim}npx cc-safe-setup --profile ${sName}${c.reset}`);
1917
+ console.log();
1918
+ } catch {}
1919
+ }
1920
+ }
1921
+ }
1893
1922
  return;
1894
1923
  }
1895
1924
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-safe-setup",
3
- "version": "11.6.0",
3
+ "version": "11.7.0",
4
4
  "description": "One command to make Claude Code safe. 59 hooks (8 built-in + 51 examples). 26 CLI commands: dashboard, create, audit, lint, diff, migrate, compare, generate-ci. 284 tests.",
5
5
  "main": "index.mjs",
6
6
  "bin": {