.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 / tokensCommit Strategy
| File | Committed? | Purpose |
|---|---|---|
.gitignore | ✓ | Managed by Foundry — controls what is/isn't tracked |
runtime.yml | ✓ | Ports, commands, health checks — shared with team |
state.yml | ✗ | Filesystem drift snapshot — machine-specific |
config.yml | ✗ | Personal 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.ymlThis 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.