Related guides:
<stanPath>/output/archive.tar — full snapshot of repo files (excludes binaries).<stanPath>/output/archive.diff.tar — changed files vs snapshot (always when archiving; binaries are also screened out).*.txt outputs — deterministic stdout/stderr from scripts.Attach archive.tar (and archive.diff.tar if present) to your chat.
STAN selects files for archiving in two passes:
Base selection
.gitignore, default denials (node_modules, .git), stan-core.excludes, and STAN workspace rules. Explicit excludes take precedence over any later includes. Reserved exclusions always apply:
<stanPath>/diff is always excluded.<stanPath>/output is excluded unless you enable combine mode.Additive includes
stan-core.includes is an allow‑list that ADDS matches back even if they would be excluded by .gitignore or default denials.excludes still win: if a path matches both includes and excludes, it is excluded.Example (YAML):
excludes:
- '**/.tsbuild/**'
- '**/generated/**'
includes:
- '**/*.md' # bring docs back even if ignored elsewhere
anchors (subject to reserved denials enforced by the engine).archive.diff.tar only when they have changed since the active snapshot baseline.<stanPath>/system/facet.state.json and <stanPath>/system/.docs.meta.json.stan run, the CLI clears <stanPath>/imports/ and then stages imports for the current configuration. This ensures that removing an import label from stan.config.* also removes any previously staged files for that label on the next run.prepareImports still clears per‑label directories for robustness and for non‑CLI consumers; the CLI’s global clear is an additional safety to remove labels that are no longer configured.stan init gitignores <stanPath>/imports/.<stanPath>/imports/** to both snapshot selection and archive selection so:
archive.tar, and<stanPath>/imports/** appear in archive.diff.tar (changed-only vs snapshot baseline), without requiring users to add them to stan-core.includes.Include outputs inside archives and remove them from disk:
stan run -c
Regular archive includes <stanPath>/output (excluding the archive files themselves). Diff archive excludes <stanPath>/diff and both archive files.
<stanPath>/system/stan.system.md (materialized temporarily when needed).stan.system.md in steady state when the effective prompt is sourced from an ephemeral location (--prompt core or a custom path) and has not changed since the last stan snap.archive.diff.tar so downstream assistants can see the change.--prompt local) participate in diffs via normal snapshot rules.stan snap writes <stanPath>/diff/.archive.snapshot.json and maintains an undo/redo history under <stanPath>/diff:
stan snap
stan snap info | undo | redo | set <index>
stan snap -s # stash before snap; pop after
Snapshots are used to compute archive diffs; stan run creates a diff archive even when nothing changed (a sentinel is written in that case).
stan snap applies the same facet overlay view that stan run uses (includes, excludes, and anchors).archive.diff.tar.At the start of stan run, stan snap, and stan patch, STAN:
stan init after upgrades if the docs baseline changed,