codeflash-agent/plugin/hooks/session-end.sh

14 lines
428 B
Bash
Raw Permalink Normal View History

2026-04-09 08:36:01 +00:00
#!/usr/bin/env bash
# Plugin SessionEnd hook: Clean up symlink in target repo if in dogfood mode.
# The symlink redirects .codeflash/ to the agent repo — remove it when done
# so the target repo stays clean.
cd "$CLAUDE_PROJECT_DIR" 2>/dev/null || exit 0
# Only clean up if .codeflash is a symlink (dogfood mode created it)
if [ -L "$CLAUDE_PROJECT_DIR/.codeflash" ]; then
rm "$CLAUDE_PROJECT_DIR/.codeflash"
fi
exit 0