Comprehensive logging for all Windsurf Cascade hook events with a dashboard for review and analysis.
Before installing, ensure you have:
- Python 3.8+ installed (
python3 --versionto check) - Node.js 18+ and npm installed (
node --versionandnpm --versionto check) - Windsurf IDE installed and run at least once (creates required directories)
git clone <repository-url>
cd windsurf-fedramp-hooks-loggerOr download and extract the ZIP file to a location of your choice.
Run the installer from the repository directory:
# macOS/Linux
python3 install_hooks.py
# Windows
python install_hooks.pyWhat this does:
- Copies the logger script to your Windsurf data directory
- Creates a
hooks.jsonconfiguration that tells Windsurf to log events - Backs up any existing hooks configuration
After installation, restart Windsurf for the hooks to take effect.
Easiest Method - Create a Desktop Shortcut:
# macOS/Linux
python3 create_launcher.py
# Windows
python create_launcher.pyThen double-click the shortcut created on your Desktop.
Alternative - Run Directly:
# macOS/Linux
./dashboard/start.sh
# Windows
dashboard\start.batThe dashboard will:
- Create a Python virtual environment (first run only)
- Install backend dependencies (first run only)
- Install frontend dependencies (first run only)
- Start the backend API on port 5173
- Start the frontend on port 5174
- Open your browser to http://localhost:5174
Press Ctrl+C in the terminal window to stop both servers.
To completely remove the logger and revert Windsurf to its pre-install state:
# macOS/Linux
python3 uninstall_hooks.py
# Windows
python uninstall_hooks.pyWhat this does:
- Removes the hooks configuration
- Removes the installed logger script
- Restores any previous
hooks.jsonthat existed before installation - Preserves your logs (use
--delete-logsto also delete logs)
Options:
--dry-run— Preview what will be removed without making changes--forceor-f— Skip confirmation prompts--delete-logs— Also delete all collected log files--delete-repo— Also delete this repository folder--delete-all— Delete everything (hooks, logs, and repository)--show-paths— Display all discovered Windsurf paths
After uninstalling, restart Windsurf for changes to take effect.
The installer automatically detects paths for your system. To see all paths:
python3 install_hooks.py --show-paths| Item | macOS | Linux | Windows |
|---|---|---|---|
| Hooks Config | ~/.codeium/windsurf/hooks.json |
~/.codeium/windsurf/hooks.json |
%USERPROFILE%\.codeium\windsurf\hooks.json |
| Logger Script | ~/.codeium/windsurf/cascade_logger.py |
~/.codeium/windsurf/cascade_logger.py |
%USERPROFILE%\.codeium\windsurf\cascade_logger.py |
| Log Output | ~/.codeium/windsurf/logs/ |
~/.codeium/windsurf/logs/ |
%USERPROFILE%\.codeium\windsurf\logs\ |
Note: If
~/.codeium/windsurf/doesn't exist, the installer will try~/.windsurf/as a fallback.
Set the WINDSURF_LOG_DIR environment variable to store logs elsewhere:
export WINDSURF_LOG_DIR=/path/to/custom/logsEnsure Python 3 is installed and in your PATH. On some systems, use python instead of python3.
Install Node.js from https://nodejs.org/ which includes npm.
Make the scripts executable:
chmod +x dashboard/start.sh
chmod +x "Windsurf Logger Dashboard.command"- Check if ports 5173 or 5174 are already in use
- Delete the virtual environment and retry:
rm -rf dashboard/backend/venv ./dashboard/start.sh
- Ensure you restarted Windsurf after installation
- Verify the hooks file exists:
python3 install_hooks.py --show-paths - Check for errors:
cat ~/.codeium/windsurf/logs/errors.log
-
See where files should go:
python3 windsurf_paths.py
-
Copy the logger script manually:
cp cascade_logger.py ~/.codeium/windsurf/cascade_logger.py -
Generate and copy the hooks config:
python3 install_hooks.py --print-config > ~/.codeium/windsurf/hooks.json
-
Restart Windsurf
# Remove installed files
rm ~/.codeium/windsurf/hooks.json
rm ~/.codeium/windsurf/cascade_logger.py
rm ~/.codeium/windsurf/windsurf-logger-install-manifest.json
# Restore backup (if exists)
mv ~/.codeium/windsurf/hooks.json.windsurf-logger.bak ~/.codeium/windsurf/hooks.json 2>/dev/null| Platform | Start Script | Desktop Shortcut |
|---|---|---|
| macOS | ./dashboard/start.sh |
Windsurf Logger Dashboard.command |
| Linux | ./dashboard/start.sh |
windsurf-logger.desktop |
| Windows | dashboard\start.bat |
Windsurf Logger Dashboard.bat |
Generate all platform launchers at once (useful if sharing the repo):
python3 create_launcher.py --allAll 9 available Cascade hook events are captured:
| Event | Category | Description |
|---|---|---|
pre_user_prompt |
prompt | User prompts before processing |
pre_read_code |
file_read | Before Cascade reads a file |
post_read_code |
file_read | After Cascade reads a file |
pre_write_code |
file_write | Before Cascade modifies code (includes full diff) |
post_write_code |
file_write | After Cascade modifies code (includes full diff) |
pre_run_command |
command | Before Cascade runs a terminal command |
post_run_command |
command | After Cascade runs a terminal command |
pre_mcp_tool_use |
mcp | Before Cascade uses an MCP tool |
post_mcp_tool_use |
mcp | After Cascade uses an MCP tool (includes result) |
By default, logs are stored in ~/.codeium/windsurf/logs/ (or the directory specified by WINDSURF_LOG_DIR environment variable):
- all_events.jsonl - Every event in chronological order
- prompt.jsonl - User prompts
- file_read.jsonl - File read operations
- file_write.jsonl - Code modifications with full edit details
- command.jsonl - Terminal command executions
- mcp.jsonl - MCP tool invocations
- pre_user_prompt.jsonl
- pre_read_code.jsonl / post_read_code.jsonl
- pre_write_code.jsonl / post_write_code.jsonl
- pre_run_command.jsonl / post_run_command.jsonl
- pre_mcp_tool_use.jsonl / post_mcp_tool_use.jsonl
- sessions/{trajectory_id}.jsonl - Events grouped by conversation
- code_changes.jsonl - Only write events with actual code edits
- summary.log - Human-readable summary for quick review
- errors.log - Any logging errors
Each log entry contains:
{
"event_id": "unique-16-char-id",
"trajectory_id": "conversation-id",
"execution_id": "turn-id",
"timestamp": "ISO-8601-timestamp",
"logged_at": "when-logged",
"action": "pre_write_code",
"category": "file_write",
"phase": "pre|post",
"system": {
"username": "user",
"hostname": "machine",
"platform": "Darwin",
"platform_version": "...",
"python_version": "3.x.x",
"machine": "arm64"
},
"data": {
// Event-specific data (see below)
},
"raw_tool_info": {
// Original data from Cascade
}
}Prompts (pre_user_prompt):
user_prompt- The prompt textprompt_length,prompt_word_count,prompt_line_countprompt_hash- For deduplication
File Operations (*_read_code, *_write_code):
file_path,file_name,file_extension,directoryis_hidden- Whether file starts with.- For writes:
edits[]array withold_string,new_string, line counts, deltas
Commands (*_run_command):
command_line- Full commandcommand_name- First word (e.g.,npm)command_args- Arguments arraycwd- Working directory
MCP Tools (*_mcp_tool_use):
mcp_server_name,mcp_tool_namemcp_tool_arguments- Arguments passedmcp_result- Result (post events only)
JSONL format allows easy filtering with jq (install from https://jqlang.github.io/jq/):
# Set your log directory (adjust path for your OS)
LOG_DIR=~/.codeium/windsurf/logs
# All prompts
cat "$LOG_DIR/prompt.jsonl" | jq .
# Code changes to Python files
cat "$LOG_DIR/file_write.jsonl" | jq 'select(.data.file_extension == "py")'
# Commands by a specific user
cat "$LOG_DIR/command.jsonl" | jq 'select(.system.username == "yourusername")'
# Events in a specific session
cat "$LOG_DIR/sessions/abc123.jsonl" | jq .
# All npm commands
cat "$LOG_DIR/command.jsonl" | jq 'select(.data.command_name == "npm")'- File Selection — Select which log files to display
- Directory Browser — Change log directory paths
- Search — Full-text search across all logs
- Filters — Filter by category, action, user, session
- Code Diff View — View code changes with before/after
- Statistics — Overview by category, user, and session
- Timeline View — Chronological activity stream
- Cloud Storage — Connect to S3 or Azure Blob Storage for centralized logs
The dashboard supports reading logs from AWS S3 or Azure Blob Storage. This is useful for:
- Centralized logging across multiple machines
- Long-term log retention
- Team-wide audit trail
To configure, either:
- Use the Storage settings in the dashboard UI
- Set environment variables in a
.envfile (copy from.env.example)
Required packages are included in requirements.txt but can be skipped for local-only usage.