REPOSITORY CONFIGURATION
The .swamp.yaml file is the repository-level configuration for swamp. It lives
at the root of the repository and is created by swamp repo init. It is tracked
in version control.
swampVersion: 20260430.202457.0
initializedAt: "2026-04-30T20:45:49.030Z"
repoId: 94735c06-fc0a-4d77-b712-04fbd801b18d
tools:
- claude
gitignoreManaged: trueRepository Resolution
Swamp resolves the repository root — the directory containing .swamp.yaml —
using the following priority chain:
| Priority | Mechanism | Behavior |
|---|---|---|
| 1 | --repo-dir flag |
Uses the specified directory directly |
| 2 | SWAMP_REPO_DIR environment var |
Uses the specified directory directly |
| 3 | Working directory traversal | Walks up from the current working directory, checking each ancestor for .swamp.yaml until a match is found |
When neither --repo-dir nor SWAMP_REPO_DIR is set, the CLI checks the
current working directory for .swamp.yaml. If not found, it walks up the
directory tree one level at a time. The search stops at the first directory
containing .swamp.yaml.
Traversal boundaries
The upward walk is bounded by whichever limit is reached first:
| Condition | Boundary |
|---|---|
| Inside a git repo | The git repository root (the directory containing .git) |
| Outside a git repo | 10 ancestor levels above the current working directory |
If no .swamp.yaml is found within the boundary, the command fails with a
not a swamp repository error.
swamp repo init
swamp repo init is unaffected by traversal. It always creates .swamp.yaml at
the path argument (or the current working directory when no path is given), even
if a parent directory already contains a .swamp.yaml.
Top-Level Fields
swampVersion
Version of Swamp that created or last upgraded this repository.
| Property | Value |
|---|---|
| Type | string |
| Required | Yes |
| Default | Set to the current CLI version on init |
| Format | CalVer YYYYMMDD.HHMMSS.PATCH (e.g., 20260407.173244.0) |
Updated to the new CLI version on swamp repo upgrade.
initializedAt
Timestamp when the repository was first initialized.
| Property | Value |
|---|---|
| Type | string (ISO 8601) |
| Required | Yes |
| Default | Set to current time on init |
| Format | YYYY-MM-DDTHH:MM:SS.sssZ |
Never changes after initial creation. Preserved across upgrades.
upgradedAt
Timestamp of the most recent upgrade.
| Property | Value |
|---|---|
| Type | string (ISO 8601) |
| Required | No |
| Default | Not set on init |
| Format | YYYY-MM-DDTHH:MM:SS.sssZ |
Only present after swamp repo upgrade has been run at least once.
repoId
Unique identifier for the repository.
| Property | Value |
|---|---|
| Type | string (UUID v4) |
| Required | No (auto-generated) |
| Default | Generated on init |
| Format | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
Used for telemetry identification and extension installation tracking. If
missing from an older .swamp.yaml, auto-generated on the next CLI invocation
and persisted.
tools
AI coding tools to configure skills and instructions for.
| Property | Value |
|---|---|
| Type | string[] |
| Required | No |
| Default | [claude] |
| Values | Built-in: claude, cursor, opencode, codex, copilot, kiro, none. Custom: any name defined via swamp agent setup. |
Each entry must be a built-in tool name, none, or the name of a custom tool
defined in .swamp-custom-tools.yaml (see
Custom Tools). The first entry is the
primary tool — operations that target a single tool (audit recording, extension
skills resolution, doctor checks) use it. Order is preserved on upgrade;
appending a tool keeps the existing primary stable.
Controls which tool-specific files are created and maintained. Built-in tools have fixed scaffolding paths:
| Tool | Instructions file | Skills directory | Settings |
|---|---|---|---|
claude |
CLAUDE.md |
.claude/skills/ |
.claude/settings.json |
cursor |
.cursor/rules/swamp.mdc |
.cursor/skills/ |
.cursor/settings.json |
opencode |
AGENTS.md |
.agents/skills/ |
.opencode/plugins/swamp-audit.ts |
codex |
AGENTS.md |
.agents/skills/ |
— |
copilot |
AGENTS.md |
.agents/skills/ |
.github/hooks/swamp-audit.json |
kiro |
.kiro/steering/swamp-rules.md |
.kiro/skills/ |
.vscode/settings.local.json, .kiro/hooks/, .kiro/agents/swamp.json |
none |
— | — | — |
Custom tools use paths configured during swamp agent setup. They receive an
instructions file and a skills directory but no tool-specific settings files.
When tools contains multiple entries, each tool's scaffolding is written
independently and lives alongside the others.
A tools value of [none] (or an empty list, written as tools: []) skips
skill copying, instructions file creation, and tool-specific .gitignore
entries.
Removing a tool from tools is non-destructive: the on-disk scaffolding
(.claude/, .kiro/, etc.) remains in place for the user to delete by hand.
tool (legacy)
Single-tool field from earlier swamp versions.
| Property | Value |
|---|---|
| Type | string |
| Required | No |
| Status | Migrated |
A marker that contains tool: <name> is auto-promoted to tools: [<name>] on
the next marker write (typically swamp repo upgrade). The legacy tool: line
is removed from the YAML once promotion completes. Existing repositories need no
manual migration.
gitignoreManaged
Whether Swamp manages a section in the .gitignore file.
| Property | Value |
|---|---|
| Type | boolean |
| Required | No |
| Default | true |
When true, Swamp writes and maintains a # BEGIN swamp managed section block
in .gitignore. The managed section includes .swamp/, .swamp-sources.yaml,
and tool-specific paths for every entry in tools (e.g., .claude/ when
tools contains claude).
Always set to true on swamp repo init. On swamp repo upgrade, the existing
value is preserved unless --include-gitignore is passed.
logLevel
Minimum log level for CLI output.
| Property | Value |
|---|---|
| Type | string |
| Required | No |
| Default | info |
| Values | trace, debug, info, warning, error, fatal |
| Override | Priority |
|---|---|
SWAMP_LOG_LEVEL |
Env > config > default |
telemetryDisabled
Disables telemetry collection for this repository.
| Property | Value |
|---|---|
| Type | boolean |
| Required | No |
| Default | false |
| Override | Priority |
|---|---|
--no-telemetry |
Flag > all |
SWAMP_NO_TELEMETRY |
Env > config |
When true, no telemetry data is collected or sent for commands run in this
repository.
Telemetry opt-out is resolved in two layers. The first two always apply; the third depends on whether a repository is present:
| Priority | Mechanism | Scope |
|---|---|---|
| 1 | --no-telemetry CLI flag |
Per-invocation |
| 2 | SWAMP_NO_TELEMETRY env var (any value except 0, false, or empty) |
Per-session / environment |
| 3a | .swamp.yaml telemetryDisabled: true |
Per-repo (inside a repo) |
| 3b | ~/.config/swamp/telemetry.yaml disabled: true |
User-global (repo-less runs) |
Layers 3a and 3b are mutually exclusive. When running inside a Swamp repository,
.swamp.yaml controls opt-out. When running outside a repository (no
.swamp.yaml found), the user-global
telemetry configuration controls opt-out
instead. See
User-Global Telemetry Configuration for
the file schema and path resolution.
telemetryEndpoint
HTTP endpoint for telemetry data.
| Property | Value |
|---|---|
| Type | string (URL) |
| Required | No |
| Default | https://api.swamp-club.com |
When the auth server is localhost, defaults to http://localhost:3000.
telemetryKeepFlushed
Retain telemetry entries after they are sent to the remote endpoint.
| Property | Value |
|---|---|
| Type | boolean |
| Required | No |
| Default | false |
When false (or not set), telemetry entry files in the
user-global spool are deleted after a
successful flush. When true, they are renamed to .flushed.json instead of
deleted. This setting is only read from .swamp.yaml — there is no user-global
equivalent. For repo-less runs, keepFlushed defaults to false.
User-Global Telemetry Configuration
Telemetry data is stored in a single, user-level spool directory — not inside
each repository. This allows swamp telemetry stats to report across all
repositories and to work outside a repository entirely.
Configuration file
~/.config/swamp/telemetry.yaml controls telemetry for repo-less runs (commands
run outside any Swamp repository). The file has a single field:
disabled: true| Field | Type | Default |
|---|---|---|
disabled |
boolean | false |
When disabled is true, telemetry is not collected for commands run outside a
repository. This file is only consulted when no .swamp.yaml is found — inside
a repository, the telemetryDisabled field in
.swamp.yaml controls opt-out instead. If the file is missing, malformed, or
disabled is not a boolean, telemetry defaults to enabled.
Spool directory
Telemetry entries are written to a user-global spool directory:
~/.config/swamp/telemetry/The spool path follows the same XDG-aware resolution as the Swamp config directory:
| Priority | Path |
|---|---|
| 1 | $SWAMP_HOME/config/telemetry |
| 2 | $XDG_CONFIG_HOME/swamp/telemetry |
| 3 | ~/.config/swamp/telemetry |
Both swamp telemetry stats and the flush process read from and write to this
single spool directory.
autoGc
Enable automatic garbage collection after each model method run.
| Property | Value |
|---|---|
| Type | boolean |
| Required | No |
| Default | false |
When true, garbage collection is enabled in two ways:
- Incremental write-time pruning — each
save()call enforces thegarbageCollectionpolicy immediately, capping stored versions at the declared limit as data is written. - Batch GC after model method runs — a full garbage collection pass runs after the method's completed event, so the user sees the method result before GC begins.
When false (the default), versions accumulate without limit and are only
removed by explicit swamp data gc runs.
Errors during automatic GC are logged at warn level and never fail the method run.
defaultVault
Default vault name for sensitive field storage.
| Property | Value |
|---|---|
| Type | string |
| Required | No |
| Default | None |
When set, Swamp uses this vault as the fallback for storing sensitive resource
output fields during model execution, OAuth token storage in swamp serve, and
device authorization token storage. Field-level and spec-level vaultName
overrides take precedence over defaultVault. When not set, Swamp falls back to
the first available vault.
See the vault resolution order for the full precedence chain.
defaultVault: prod-secretsEphemeral Data Budget
The SWAMP_EPHEMERAL_BUDGET environment variable controls the maximum memory
allocated to ephemeral data storage.
| Property | Value |
|---|---|
| Type | byte size string (512mb, 1gb, 256k) or integer (bytes) |
| Required | No |
| Default | 512mb |
| Override | Priority |
|---|---|
SWAMP_EPHEMERAL_BUDGET |
Env only |
Ephemeral data lives in memory only and is never written to disk. This budget
caps the total in-memory footprint. Writes that would exceed the budget fail
with an error. The budget applies per process — each swamp invocation has its
own ephemeral store. See the data reference
for how the ephemeral lifetime behaves.
Directory Overrides
Six fields override the default locations for extension source directories. All paths are relative to the repository root.
Each field follows the same resolution priority: environment variable >
.swamp.yaml value > default.
| Field | Environment Variable | Default |
|---|---|---|
modelsDir |
SWAMP_MODELS_DIR |
extensions/models |
workflowsDir |
SWAMP_WORKFLOWS_DIR |
extensions/workflows |
vaultsDir |
SWAMP_VAULTS_DIR |
extensions/vaults |
datastoresDir |
SWAMP_DATASTORES_DIR |
extensions/datastores |
reportsDir |
SWAMP_REPORTS_DIR |
extensions/reports |
These directories hold extension source files loaded by Swamp at runtime. They
are separate from the top-level models/, workflows/, and vaults/
directories that hold user-authored definitions.
modelsDir: custom/models
workflowsDir: custom/workflowsExtensions Directory
By default, Swamp discovers local extension sources from extensions/<kind>/
relative to the repository root (--repo-dir / SWAMP_REPO_DIR). The
--extensions-dir flag or SWAMP_EXTENSIONS_DIR environment variable overrides
the root directory used for local extension source scanning.
| Override | Priority |
|---|---|
--extensions-dir flag |
Highest |
SWAMP_EXTENSIONS_DIR |
Env > default |
| Repository root | Default (no flag) |
When set, --extensions-dir changes where Swamp looks for local extension
sources (all content types: models, vaults, datastores, reports). All data stays
at the repository root:
Resolved from --extensions-dir |
Stays at --repo-dir |
|---|---|
extensions/models/ |
.swamp/ data directory |
extensions/vaults/ |
Extension catalog (_extension_catalog.db) |
extensions/datastores/ |
Pulled extensions (.swamp/pulled-extensions/) |
extensions/reports/ |
Model definitions (models/) |
manifest.yaml (for extension push) |
Lockfiles and secrets |
This is useful for git worktree workflows where the working tree (code) is
separate from the .swamp/ data directory:
# Point at the main repo for data, worktree for extension sources
export SWAMP_REPO_DIR=~/repo
export SWAMP_EXTENSIONS_DIR=~/repo/worktrees/feature-branch
swamp model type search my-modelValidation
The CLI rejects --extensions-dir values that:
- Point inside the
.swamp/data directory - Do not exist on the filesystem
- Are not a directory (e.g. a file)
Trust Configuration
Two fields control which collectives are trusted for extension auto-resolution.
Note
Member collectives are not trusted automatically. Trust each explicitly with
swamp extension trust add <collective>, or set
trustMemberCollectives: true to trust all of your memberships. A trusted
collective's extensions auto-resolve, but are pinned to the version and
checksum recorded in the committed
extensions/models/upstream_extensions.json lockfile: a trusted collective
cannot silently push an updated version. Moving versions requires an explicit
swamp extension pull or swamp extension update, and a drifted checksum
fails the install. See
Extension Management for the
lockfile and version-pinning details, and
How Swamp works for why membership does
not grant install consent.
trustedCollectives
Explicitly trusted collective names.
| Property | Value |
|---|---|
| Type | string[] |
| Required | No |
| Default | ["swamp"] |
Each name must match [a-z0-9][a-z0-9_-]*.
Managed with swamp extension trust add <collective> and
swamp extension trust rm <collective>.
trustedCollectives:
- swamp
- my-collectivetrustMemberCollectives
Whether to include the authenticated user's membership collectives in the trust list.
| Property | Value |
|---|---|
| Type | boolean |
| Required | No |
| Default | false |
When true, the user's membership collectives from their auth credentials are
merged with trustedCollectives. When false (or not set), only the explicit
list is used.
Managed with swamp extension trust auto-trust enable and
swamp extension trust auto-trust disable.
$ swamp extension trust list --json{
"explicit": [
"swamp"
],
"membership": [],
"resolved": [
"swamp"
],
"trustMemberCollectives": false
}Datastore Configuration
The datastore field configures where Swamp stores runtime data. When not set,
Swamp uses the local filesystem at .swamp/ within the repository.
datastore:
type: filesystem
path: /data/swamp-storedatastore.type
Datastore backend type.
| Property | Value |
|---|---|
| Type | string |
| Required | Yes (within datastore) |
| Values | filesystem, or an extension type (e.g., @swamp/s3-datastore) |
datastore.path
Absolute path for the filesystem datastore.
| Property | Value |
|---|---|
| Type | string (absolute path) |
| Required | No |
| Default | {repo}/.swamp/ |
| Applies | filesystem type only |
datastore.bucket
S3 bucket name.
| Property | Value |
|---|---|
| Type | string |
| Required | No |
| Applies | S3-compatible types |
datastore.prefix
Key prefix within the S3 bucket.
| Property | Value |
|---|---|
| Type | string |
| Required | No |
| Applies | S3-compatible types |
datastore.region
AWS region.
| Property | Value |
|---|---|
| Type | string |
| Required | No |
| Applies | S3-compatible types |
datastore.endpoint
Custom S3-compatible endpoint URL.
| Property | Value |
|---|---|
| Type | string (URL) |
| Required | No |
| Applies | S3-compatible types |
datastore.forcePathStyle
Force path-style S3 URLs instead of virtual-hosted-style.
| Property | Value |
|---|---|
| Type | boolean |
| Required | No |
| Default | false |
| Applies | S3-compatible types |
datastore.config
Arbitrary configuration for extension-provided datastores.
| Property | Value |
|---|---|
| Type | Record<string, unknown> |
| Required | No |
| Applies | Extension types |
datastore.namespace
Namespace identifier for this repository within a shared datastore. When set,
data is scoped under .swamp/<namespace>/ instead of .swamp/ directly.
| Property | Value |
|---|---|
| Type | string |
| Required | No |
| Default | None (solo mode) |
| Format | Lowercase slug (e.g., infra, compute, security) |
Set via swamp datastore namespace set <slug>. See
Namespace Commands.
datastore.directories
Which .swamp/ subdirectories use this datastore. When not set, all default
directories are included.
| Property | Value |
|---|---|
| Type | string[] |
| Required | No |
Default directories:
definitions-evaluated workflows-evaluated data
outputs workflow-runs secrets
bundles vault-bundles report-bundles
audit telemetry
logs filesdatastore.exclude
Gitignore-style patterns for files to exclude from datastore operations.
| Property | Value |
|---|---|
| Type | string[] |
| Required | No |
$ swamp datastore status --json{
"type": "filesystem",
"path": "/home/user/my-repo/.swamp",
"healthy": true,
"message": "Filesystem datastore at /home/user/my-repo/.swamp is healthy",
"latencyMs": 0.43,
"directories": [
"definitions-evaluated",
"workflows-evaluated",
"data",
"outputs",
"workflow-runs",
"secrets",
"bundles",
"vault-bundles",
"report-bundles",
"audit",
"telemetry",
"logs",
"files"
]
}| Override | Priority |
|---|---|
SWAMP_DATASTORE |
Env > config |
Created Directory Structure
swamp repo init creates the following directories:
my-repo/
.swamp.yaml
.gitignore
models/ # User model definitions
workflows/ # User workflow definitions
vaults/ # User vault configurations
.swamp/
audit/
data/
definitions-evaluated/
outputs/
secrets/
vault-bundles/
workflow-runs/
workflows-evaluated/When tools is non-empty (and not [none]), tool-specific files are created
for each entry — for example, CLAUDE.md and .claude/ for the claude tool,
.kiro/steering/swamp-rules.md and .kiro/ for the kiro tool. With multiple
tools, every tool's scaffolding is written.
Initialization
$ swamp repo init [path] [options]| Option | Description |
|---|---|
-f, --force |
Reinitialize if already exists |
-t, --tool |
AI tool to configure for. Repeat to enroll multiple tools (e.g. --tool claude --tool kiro). Duplicates are collapsed. Defaults to claude when omitted. Built-in values: claude, cursor, opencode, codex, copilot, kiro, none. Custom tool names defined via swamp agent setup are also valid. |
--tool none (alone) skips tool scaffolding. Combining --tool none with any
other --tool value is rejected:
$ swamp repo init --tool none --tool claude --json{
"error": "Cannot combine --tool none with other --tool values. Use --tool none alone to clear the enrolled tool list."
}Creates .swamp.yaml with swampVersion, initializedAt, repoId, tools,
and gitignoreManaged set. Creates the directory structure, copies tool skills
for every entry in tools, and generates each tool's instructions file.
$ swamp repo init --json{
"path": "/home/user/my-repo",
"version": "20260605.190813.0",
"initializedAt": "2026-06-05T19:46:35.748Z",
"skillsCopied": [
"swamp",
"swamp-getting-started"
],
"instructionsFileCreated": true,
"settingsCreated": true,
"gitignoreAction": "created",
"tools": [
"claude",
"kiro"
],
"removedTools": [],
"tool": null
}The legacy tool field in the output mirrors tools[0] when there is exactly
one entry, is null when there are multiple, and is "none" when the list is
empty.
Upgrade
$ swamp repo upgrade [path] [options]| Option | Description |
|---|---|
-t, --tool |
Replace the enrolled tool list. Repeat to enroll multiple tools (e.g. --tool claude --tool kiro). Omit to preserve the existing list. --tool none (alone) clears the list. Values: any built-in tool name, none, or a custom tool name (same as init). |
--include-gitignore |
Manage a Swamp section in .gitignore |
--tool on upgrade has replace semantics: the value passed is the full new
list. To add kiro to a [claude] repo, run
swamp repo upgrade --tool claude --tool kiro — passing only --tool kiro
would replace the list with [kiro]. Plain swamp repo upgrade (no --tool
flag) preserves the existing list and just bumps the Swamp version.
Updates swampVersion and sets upgradedAt. All other fields are preserved
unless explicitly overridden by CLI flags.
| Field | Behavior on upgrade |
|---|---|
swampVersion |
Updated to new CLI version |
upgradedAt |
Set to current timestamp |
initializedAt |
Preserved |
repoId |
Preserved |
tools |
Replaced by the value of --tool when passed, otherwise preserved |
tool (legacy) |
Auto-promoted to tools and removed from the YAML on the first upgrade |
gitignoreManaged |
Overridden if --include-gitignore is passed, otherwise preserved |
| All other fields | Preserved |
$ swamp repo upgrade --json{
"path": "/home/user/my-repo",
"previousVersion": "20260605.190813.0",
"newVersion": "20260605.190813.0",
"upgradedAt": "2026-06-05T19:46:42.349Z",
"skillsUpdated": [
"swamp",
"swamp-getting-started"
],
"instructionsUpdated": false,
"settingsUpdated": false,
"gitignoreAction": "updated",
"previousTools": [
"claude",
"kiro"
],
"tools": [
"kiro"
],
"addedTools": [],
"removedTools": [
"claude"
],
"extensionsToReinstall": [],
"tool": "kiro",
"extensionInstall": {
"entries": [],
"installed": 0,
"migrated": 0,
"upToDate": 0,
"failed": 0
}
}previousTools and tools show the before/after enrolled lists. addedTools
and removedTools are the diff — removedTools lists tools whose scaffolding
remains on disk after the upgrade.
Telemetry spool migration
swamp repo upgrade migrates unflushed telemetry entries from the legacy
repo-local spool (.swamp/telemetry/) to the
user-global spool. The migration:
- Moves
telemetry-*.jsonfiles to the global spool directory. - Skips repositories that have
telemetryDisabled: true— a disabled repository's leftover entries are never moved, so they cannot be sent despite the opt-out. - Leaves already-flushed entries (
.flushed.jsonfiles) in the old directory. - Leaves the old
.swamp/telemetry/directory in place (orphaned, not deleted). - Is best-effort — a migration failure never blocks the upgrade.
Update
$ swamp update [options]Update Swamp to the latest version.
| Flag | Description |
|---|---|
--check |
Check for updates without installing |
--setup-auto |
Configure autoupdate interactively; use status to check, disable to turn off |
Shell Completions
$ swamp completions <shell>Generate shell completions. Subcommands: bash, fish, zsh. Each accepts a
-n / --name flag.
Installation:
- bash — add to
~/.bashrc:source <(swamp completions bash)
- fish — add to
~/.config/fish/config.fish:source (swamp completions fish | psub) - zsh — add to
~/.zshrc:source <(swamp completions zsh)
Configuration
swamp config get <key>
Get a configuration value.
| Argument | Description |
|---|---|
key |
Configuration key (required) |
swamp config set <key> <value>
Set a configuration value.
| Argument | Description |
|---|---|
key |
Configuration key (required) |
value |
Configuration value (required) |
swamp config list
List all configuration keys and current values. No arguments.
Complete Example
A .swamp.yaml with all optional fields configured:
swampVersion: 20260430.202457.0
initializedAt: "2026-04-30T20:45:49.030Z"
upgradedAt: "2026-04-30T20:45:49.312Z"
repoId: 94735c06-fc0a-4d77-b712-04fbd801b18d
tools:
- claude
- kiro
gitignoreManaged: true
logLevel: debug
telemetryDisabled: false
telemetryEndpoint: https://api.swamp-club.com
modelsDir: custom/models
workflowsDir: custom/workflows
vaultsDir: custom/vaults
datastoresDir: custom/datastores
reportsDir: custom/reports
trustedCollectives: # illustrative; default is ["swamp"]
- swamp
- si
- my-collective
trustMemberCollectives: true # illustrative; default is false
datastore:
type: filesystem
path: /data/swamp-store