(push (match-string 1) models))))
 
     (if (file-exists-p prompt-dir)
-        (let* ((files   (directory-files prompt-dir t "\\`[^.].*\\.txt\\'"))
+        (let* ((files   (directory-files prompt-dir t "\\`[^.].*\\.yaml\\'"))
                (aliases (mapcar #'file-name-base files)))
           (if aliases
               (let* ((selected-alias (completing-read "Select prompt alias: " aliases))
 
      */
     private void processDetectedFilesystemEvents(WatchKey key) throws IOException {
         Path dir = (Path) key.watchable();
-
         for (WatchEvent<?> event : key.pollEvents()) {
             WatchEvent.Kind<?> kind = event.kind();
-
             if (kind != ENTRY_CREATE && kind != ENTRY_MODIFY && kind != ENTRY_DELETE) {
                 continue;
             }
-
             @SuppressWarnings("unchecked")
             WatchEvent<Path> ev = (WatchEvent<Path>) event;
             Path filename = ev.context();
             Path fullPath = dir.resolve(filename);
-
             System.out.printf("Event: %s – %s%n", kind.name(), fullPath);
-
             if (kind == ENTRY_DELETE) {
                 // Remove any existing tasks for this file
                 removeTasksForFile(fullPath);
                 continue;
             }
-
             // Handle directory creation
             if (Files.isDirectory(fullPath)) {
                 if (kind == ENTRY_CREATE) {
+                    // Register the new directory and its subdirectories for monitoring
                     registerAllSubdirectories(fullPath);
+                    // Scan the new directory for existing files to process
+                    Files.walk(fullPath)
+                            .filter(path -> {
+                                try {
+                                    return Files.isRegularFile(path) && !Files.isHidden(path);
+                                } catch (IOException e) {
+                                    System.err.println("Failed to check if file is hidden: " + path + " - " + e.getMessage());
+                                    return false; // Skip files that cause errors
+                                }
+                            })
+                            .forEach(path -> {
+                                try {
+                                    considerFileForQueuing(path);
+                                } catch (IOException e) {
+                                    System.err.println("Failed to process file in new directory: " + path + " - " + e.getMessage());
+                                }
+                            });
                 }
                 continue;
             }
-
             // Handle file events
             if (kind == ENTRY_MODIFY) {
                 // Remove existing tasks for this file before adding new ones
                 removeTasksForFile(fullPath);
             }
-
             // Check if it's a regular, non-hidden file and needs processing
-            if (Files.isRegularFile(fullPath) && !Files.isHidden(fullPath)) {
-                considerFileForQueuing(fullPath);
+            try {
+                if (Files.isRegularFile(fullPath) && !Files.isHidden(fullPath)) {
+                    considerFileForQueuing(fullPath);
+                }
+            } catch (IOException e) {
+                System.err.println("Failed to check file: " + fullPath + " - " + e.getMessage());
             }
         }
     }