pub fn get_blocking(&self) -> Result<Vec<File>> {
        let mut files = Vec::new();
        let mut total_size = 0u64;
        let mut dir_entries: HashMap<String, usize> = HashMap::new();
        let mut file_count = 0;

        // TODO: Convert to async and return a stream
        let walk = WalkBuilder::new(&self.cwd)
            .hidden(true) // Skip hidden files
            .git_global(true) // Use global gitignore
            .git_ignore(true) // Use local .gitignore
            .ignore(true) // Use .ignore files
            .max_depth(Some(self.max_depth))
            // TODO: use build_parallel() for better performance
            .build();

        'walk_loop: for entry in walk.flatten() {
            let path = entry.path();

            // Calculate depth relative to base directory
            let depth = path
                .strip_prefix(&self.cwd)
                .map(|p| p.components().count())
                .unwrap_or(0);

            if depth > self.max_depth {
                continue;
            }

            // Handle breadth limit
            if let Some(parent) = path.parent() {
                let parent_path = parent.to_string_lossy().to_string();
                let entry_count = dir_entries.entry(parent_path).or_insert(0);
                *entry_count += 1;

                if *entry_count > self.max_breadth {
                    continue;
                }
            }

            let is_dir = path.is_dir();

            // Skip binary files if configured
            if self.skip_binary && !is_dir && Self::is_likely_binary(path) {
                continue;
            }

            let metadata = match path.metadata() {
                Ok(meta) => meta,
                Err(_) => continue, // Skip files we can't read metadata for
            };

            let file_size = metadata.len();

            // Skip files that exceed size limit
            if !is_dir && file_size > self.max_file_size {
                continue;
            }

            // Check total size limit
            if total_size + file_size > self.max_total_size {
                break 'walk_loop;
            }

            // Check if we've hit the file count limit (only count non-directories)
            if !is_dir {
                file_count += 1;
                if file_count > self.max_files {
                    break 'walk_loop;
                }
            }

            let relative_path = path
                .strip_prefix(&self.cwd)
                .with_context(|| format!("Failed to strip prefix from path: {}", path.display()))?;
            let path_string = relative_path.to_string_lossy().to_string();

            let file_name = path
                .file_name()
                .map(|name| name.to_string_lossy().to_string());

            // Ensure directory paths end with '/' for is_dir() function
            let path_string = if is_dir {
                format!("{path_string}/")
            } else {
                path_string
            };

            files.push(File { path: path_string, file_name, size: file_size });

            if !is_dir {
                total_size += file_size;
            }
        }

        Ok(files)
    }
Blocking function to scan filesystem. Use this when you already have
a runtime or want to avoid spawning a new one.
crates/forge_walker/src/walker.rs