Files
claude-mem/cursor-hooks/context-inject.sh
T
Alex Newman 8d485890b9 feat(cursor): Add Claude-Mem Cursor hooks installation and management
- Introduced functionality for installing, uninstalling, and checking the status of Cursor hooks.
- Added a new command structure for managing hooks with detailed usage instructions.
- Implemented a method to locate the cursor-hooks directory across different environments.
- Updated build-hooks script to inform users about the location of Cursor hooks.

This enhancement streamlines the integration of Claude-Mem with Cursor, improving user experience and accessibility of hooks.
2025-12-29 20:14:23 -05:00

32 lines
868 B
Bash
Executable File

#!/bin/bash
# Context Hook for Cursor (beforeSubmitPrompt)
# Ensures worker is running before prompt submission
#
# NOTE: Context is NOT updated here. Context updates happen in the stop hook
# (session-summary.sh) after the session completes, so new observations are included.
# Source common utilities
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/common.sh" 2>/dev/null || {
echo '{"continue": true}'
exit 0
}
# Check dependencies (non-blocking)
check_dependencies >/dev/null 2>&1 || true
# Read JSON input from stdin
input=$(read_json_input)
# Get worker port from settings
worker_port=$(get_worker_port)
# Ensure worker is running (with retries)
# This primes the worker before the session starts
ensure_worker_running "$worker_port" >/dev/null 2>&1 || true
# Allow prompt to continue
echo '{"continue": true}'
exit 0