diff --git a/.claude/settings.json b/.claude/settings.json index d6aec1a..a824844 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -9,60 +9,6 @@ "command": "/Users/jason/go/bin/cnotes" } ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes2" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes3" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-fail" - } - ] } ], "PostToolUse": [ @@ -74,60 +20,6 @@ "command": "/Users/jason/go/bin/cnotes" } ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes2" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes3" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-fail" - } - ] } ], "PreCompact": [ @@ -139,60 +31,6 @@ "command": "/Users/jason/go/bin/cnotes" } ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes2" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes3" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-fail" - } - ] } ], "PreToolUse": [ @@ -204,60 +42,6 @@ "command": "/Users/jason/go/bin/cnotes" } ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes2" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes3" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-fail" - } - ] } ], "Stop": [ @@ -269,60 +53,6 @@ "command": "/Users/jason/go/bin/cnotes" } ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes2" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes3" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-fail" - } - ] } ], "SubagentStop": [ @@ -334,60 +64,6 @@ "command": "/Users/jason/go/bin/cnotes" } ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes2" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes3" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-fail" - } - ] } ], "UserPromptSubmit": [ @@ -399,60 +75,6 @@ "command": "/Users/jason/go/bin/cnotes" } ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes2" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-cnotes3" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test" - } - ] - }, - { - "matcher": ".*", - "hooks": [ - { - "type": "command", - "command": "/tmp/test-fail" - } - ] } ] } diff --git a/CLAUDE.md b/CLAUDE.md index 600efed..5a247da 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -128,9 +128,13 @@ cnotes registers as a Claude Code hook handler for: - **User Experience**: Prioritizes readable Markdown output over raw JSON - **Reliability**: Comprehensive backup/restore system for data protection +## Memories + +- Don't update the readme listing new features you're adding; the README is not a changelog. Remove the line about duplicate content. + When making changes, ensure: 1. Git notes functionality remains the primary focus 2. Privacy controls are maintained 3. Backup/restore capabilities work correctly 4. Pretty-printed output remains readable -5. Installation process configures Claude Code correctly +5. Installation process configures Claude Code correctly \ No newline at end of file diff --git a/README.md b/README.md index 398254e..60287e2 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ ⭐️ `cnotes` is pronounced like 💵 c-notes or 🏊 [_cenotes_](https://en.wikipedia.org/wiki/Cenote) -This tool ensures no duplicate content between commits by tracking the last processed event timestamp. - ## Quick Start diff --git a/cmd/install.go b/cmd/install.go index 4f36b24..395cfd3 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -70,14 +70,24 @@ func runInstall(cmd *cobra.Command, args []string) error { // Prevent installation from temporary directories (unless uninstalling) if !uninstall { tempDir := os.TempDir() + // Resolve any symlinks in the executable path for comparison realExecutable, err := filepath.EvalSymlinks(executable) if err != nil { realExecutable = executable // Fall back to original if can't resolve } + // Also resolve tempDir in case it's a symlink (like /tmp on macOS) + realTempDir, err := filepath.EvalSymlinks(tempDir) + if err != nil { + realTempDir = tempDir + } + // Check if executable is in temp directory - if strings.HasPrefix(realExecutable, tempDir) || strings.HasPrefix(executable, "/tmp/") { + if strings.HasPrefix(realExecutable, tempDir) || + strings.HasPrefix(executable, tempDir) || + strings.HasPrefix(realExecutable, realTempDir) || + strings.HasPrefix(executable, realTempDir) { return fmt.Errorf("cannot install from temporary directory: %s\nPlease build and install cnotes properly:\n go install && cnotes install", executable) } }