Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@
# The baseline contains ALL tracked files (not just changed files) so that
# the rules_check hook can determine which files are genuinely new vs which
# files existed before and were just modified.
#
# It also captures the HEAD commit ref so that committed changes can be detected
# by comparing HEAD at Stop time to the captured ref.

set -e

# Ensure .deepwork directory exists
mkdir -p .deepwork

# Save the current HEAD commit ref for detecting committed changes
# This is used by get_changed_files_prompt() to detect files changed since prompt,
# even if those changes were committed during the agent response.
git rev-parse HEAD > .deepwork/.last_head_ref 2>/dev/null || echo "" > .deepwork/.last_head_ref

# Save ALL tracked files (not just changed files)
# This is critical for created: mode rules to distinguish between:
# - Newly created files (not in baseline) -> should trigger created: rules
Expand Down