diff --git a/.bashrc b/.bashrc
index fcd7bb569719d6027b52f809a6ce51ef97033153..785fa37728a9235ec5becdb443bf0e7d769722e1 100644
--- a/.bashrc
+++ b/.bashrc
@@ -223,7 +223,8 @@ __prompt () {
         endtime="$(date +%s)"
         runduration="$(( endtime - starttime))"
         [ "$runduration" -lt '10' ] || PS1="\\[\\e[1;96m[Run duration: $runduration]\\e[0m\\] $PS1"
-        [ "$exitstatus" -eq '0' ] || PS1="\\[\\e[1;91m[Exit status: $exitstatus]\\e[0m\\] $PS1"
+        [ "$exitstatus" -eq '0' ] || [ -z "${run_command:-}" ] || PS1="\\[\\e[1;91m[Exit status: $exitstatus]\\e[0m\\] $PS1"
+        unset run_command
     fi
     last_command='__prompt'
     unset starttime
@@ -239,6 +240,10 @@ __command_notifier () {
         starttime="$(date +%s)"
     elif [ -n "${last_finish:-}" ]
     then
+        if [ "${last_command:-}" != '_direnv_hook' ]
+        then
+            run_command='1'
+        fi
         runduration="$(( endtime - last_finish ))"
         if [ "$runduration" -gt '10' ]
         then