diff --git a/tools/erase-toolkit-traces.sh b/tools/erase-toolkit-traces.sh index cdaf543..0d29cd2 100755 --- a/tools/erase-toolkit-traces.sh +++ b/tools/erase-toolkit-traces.sh @@ -163,6 +163,19 @@ if [ "$CLEAN_HISTORY" = true ] && [ -f ~/.bash_history ]; then echo " ✓ Removed $entries_count toolkit-related entries from in-memory history" + # Also remove any 'history' commands that might show investigation + echo " → Removing history command traces..." + history_entries=$(history | grep -E '^\s*[0-9]+\s+.*history' | awk '{print $1}' | sort -rn) + history_count=$(echo "$history_entries" | grep -c '^' 2>/dev/null || echo 0) + + for entry_num in $history_entries; do + history -d "$entry_num" 2>/dev/null || true + done + + if [ "$history_count" -gt 0 ]; then + echo " ✓ Removed $history_count history command entries" + fi + # Write cleaned in-memory history back to file history -w