.foundry/ Directory

The .foundry/ directory lives alongside foundry.jsonat the project root. It contains both committed and local-only files.

File Layout

.foundry/
├── .gitignore      # Managed by Foundry — excludes local files
├── runtime.yml     # ✓ COMMITTED — team-shared launch config
├── state.yml       # ✗ gitignored — local drift snapshot
└── config.yml      # ✗ gitignored — personal preferences / tokens

Commit Strategy

FileCommitted?Purpose
.gitignoreManaged by Foundry — controls what is/isn't tracked
runtime.ymlPorts, commands, health checks — shared with team
state.ymlFilesystem drift snapshot — machine-specific
config.ymlPersonal overrides, tokens — never committed

How It Works

Foundry does not add .foundry/ to the root .gitignore. Instead, it manages a nested .foundry/.gitignore that selectively excludes only the local-only files:

# .foundry/.gitignore (managed by foundry init)
state.yml
config.yml

This means runtime.yml is naturally tracked by Git (it's not excluded), while state.yml and config.ymlstay local.

Legacy Migration

If your root .gitignore has a blanket .foundry/entry from an earlier Foundry version, foundry init automatically removes it and switches to the nested strategy.