packages/kilo-docs/pages/automate/tools/list-files.md
The list_files tool displays the files and directories within a specified location. It helps Kilo Code understand your project structure and navigate your codebase effectively.
The tool accepts these parameters:
path (required): The path of the directory to list contents for, relative to the current working directoryrecursive (optional): Whether to list files recursively. Use true for recursive listing, false or omit for top-level only.This tool lists all files and directories in a specified location, providing a clear overview of your project structure. It can either show just the top-level contents or recursively explore subdirectories.
read_file or search_filesnode_modules and .git in recursive mode.gitignore rules when in recursive mode.kilocodeignore with a lock symbol (š) when showKiloCodeIgnoredFiles is enabledlist_files on specific subdirectoriesWhen the list_files tool is invoked, it follows this process:
path parameter and optional recursive parameternode_modules, .git, etc..gitignore rules when in recursive mode.kilocodeignore patterns, either hiding files or marking them with a lock symbol/)showKiloCodeIgnored is enabledThe file listing results include:
/).kilocodeignore are marked with a lock symbol (š) when showKiloCodeIgnored is enabledlist_files on specific subdirectoriesExample output format:
src/
src/components/
src/components/Button.tsx
src/components/Header.tsx
src/utils/
src/utils/helpers.ts
src/index.ts
...
File listing truncated (showing 200 of 543 files). Use list_files on specific subdirectories for more details.
When .kilocodeignore files are used and showKiloCodeIgnored is enabled:
src/
src/components/
src/components/Button.tsx
src/components/Header.tsx
š src/secrets.json
src/utils/
src/utils/helpers.ts
src/index.ts
Listing top-level files in the current directory:
<list_files>
<path>.</path>
</list_files>
Recursively listing all files in a source directory:
<list_files>
<path>src</path>
<recursive>true</recursive>
</list_files>
Examining a specific project subdirectory:
<list_files>
<path>src/components</path>
<recursive>false</recursive>
</list_files>