# How the Forge File Walker Determines Which Files to Include in Context

> Learn how the Forge file walker selects files using filters like depth, size, and binary detection within max_walker_depth (defaults to 5) for efficient code context.

- Repository: [Forge Code/forgecode](https://github.com/antinomyhq/forgecode)
- Tags: internals
- Published: 2026-04-08

---

**The Forge file walker selects files by applying hierarchical filters—depth limits, breadth caps, size constraints, and binary detection—starting from a configured directory, where `max_walker_depth` corresponds to the `max_depth` field that defaults to 5 levels.**

The **Forge file walker** is a Rust-based filesystem traversal engine found in the `antinomyhq/forgecode` repository. When the LLM needs context from a codebase, the walker returns a filtered `Vec<File>` containing only the entries that satisfy multiple safety and performance constraints. Understanding these filters and