diff --git a/guix/ui.scm b/guix/ui.scm
index addc3ac334eb179eb8bd82b12d9dda45bb084fcb..ca0d4249ec289b0f0ac920b188b79b890de69d8c 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -397,8 +397,14 @@ (define directory
            (compose (cut string-append <> "/guix/scripts")
                     dirname)))
 
+  (define dot-scm?
+    (cut string-suffix? ".scm" <>))
+
+  ;; In Guile 2.0.5 `scandir' would return "." and ".." regardless even though
+  ;; they don't match `dot-scm?'.  Work around it by doing additional
+  ;; filtering.
   (if directory
-      (scandir directory (cut string-suffix? ".scm" <>))
+      (filter dot-scm? (scandir directory dot-scm?))
       '()))
 
 (define (commands)