Skip to content

code_files

code_files returns every file that has been indexed into the project graph. Use it to explore the codebase structure or find files matching a path pattern.

code_files()
code_files(path="src/services", language="TypeScript")
code_files(offset=50, limit=50)
ParameterTypeDefaultDescription
pathstringFilter by path substring
languagestringFilter by language (e.g. TypeScript, Python, Rust)
offsetnumber0Skip first N files (for pagination)
limitnumber50Max files to return
fastbooleantrueUse index cache for instant results

For large projects, paginate to avoid flooding context:

code_files(offset=0, limit=50) → files 1–50
code_files(offset=50, limit=50) → files 51–100
  • Get a high-level list of what files exist in a directory
  • Find all files in a specific language
  • Confirm a file was indexed before calling code_get