Remove postinstall script and update user message for first-time setup in hooks

This commit is contained in:
Alex Newman
2025-12-09 14:39:31 -05:00
parent c5ee27f001
commit d957bff495
3 changed files with 49 additions and 61 deletions
+21 -32
View File
@@ -6,39 +6,9 @@
* has been loaded into their session. Uses stderr as the communication channel
* since it's currently the only way to display messages in Claude Code UI.
*/
import { join, basename } from "path";
import { homedir } from "os";
import { existsSync } from "fs";
import { basename } from "path";
import { ensureWorkerRunning, getWorkerPort } from "../shared/worker-utils.js";
// Check if first-run marker exists - if not, this is first run
const pluginDir = join(homedir(), '.claude', 'plugins', 'marketplaces', 'thedotmack');
const firstRunMarker = join(pluginDir, '.first-run-complete');
if (!existsSync(firstRunMarker)) {
// First-time installation - setup not yet complete
console.error(`
---
🎉 Note: This appears under Plugin Hook Error, but it's not an error. That's the only option for
user messages in Claude Code UI until a better method is provided.
---
⚠️ Claude-Mem: First-Time Setup
Dependencies have been installed in the background. This only happens once.
💡 TIPS:
• Memories will start generating while you work
• Use /init to write or update your CLAUDE.md for better project context
• Try /clear after one session to see what context looks like
Thank you for installing Claude-Mem!
This message was not added to your startup context, so you can continue working as normal.
`);
process.exit(3);
}
try {
// Ensure worker is running
await ensureWorkerRunning();
@@ -111,7 +81,26 @@ try {
);
} catch (error) {
console.error(`❌ Failed to load context display: ${error}`);
// Context not available yet - likely first run or worker starting up
console.error(`
---
🎉 Note: This appears under Plugin Hook Error, but it's not an error. That's the only option for
user messages in Claude Code UI until a better method is provided.
---
⚠️ Claude-Mem: First-Time Setup
Dependencies are installing in the background. This only happens once.
💡 TIPS:
• Memories will start generating while you work
• Use /init to write or update your CLAUDE.md for better project context
• Try /clear after one session to see what context looks like
Thank you for installing Claude-Mem!
This message was not added to your startup context, so you can continue working as normal.
`);
}
process.exit(3);