Build a rig

What gets shared

The default include/exclude lists, the boundary between shape and content, and how to override either.

Rig packages configuration by default, content by opt-in. The reasoning: agent workspaces almost always contain a mix of public scaffolding (prompts, configs, skills) and private payload (research notes, customer data, API results). Defaults should err on the side of leaving content out.

Defaults

[package] controls what goes into the artifact. When you don't customise it, you get:

Included by default:

  • README.md, CLAUDE.md, rig.toml, .mcp.json
  • Everything under .claude/ except sessions, memory, and settings.local.json
  • skills/, agents/, commands/
  • examples/
  • data/templates/, data/reference/
  • scripts/
  • .env.example

Excluded by default:

  • .env, .env.*, *.key, *.pem
  • node_modules/, .venv/, __pycache__/, .DS_Store
  • outputs/, private/, research/
  • .claude/sessions/, .claude/memory/, .claude/settings.local.json
  • .git/, dist/

Full lists are in [package].

Shape vs content

Rig distinguishes:

  • Shape — that a folder exists (e.g. data/portfolios/) so the agent knows where to look. Captured in [local].dirs. When a user runs rig install, the folder is created (with a .rigkeep placeholder) but contents are not shipped.
  • Content — actual files inside a folder. Only included if the folder matches an [package].include pattern.

rig init makes this choice for each folder it finds. You can re-decide later by editing rig.toml.

Overriding the defaults

Three layers, in order of precedence:

  1. [package].include / [package].exclude in rig.toml — explicit.
  2. .rigignore — additive excludes, gitignore-style syntax. See below.
  3. Built-in defaults — the lists above.

To include data/strategies/ (excluded by data/ defaults), add it explicitly via rig add, which edits [package].include for you.

To exclude something the defaults included, add it to [package].exclude or .rigignore.

.rigignore

An optional file at the workspace root. Same syntax as .gitignore. Adds excludes on top of [package].exclude. Each pattern strips matching files from the artifact:

# .rigignore
data/scratch/
*.bak
TODO.private.md

Useful for one-off exclusions you don't want to encode in rig.toml.

How to check what's in the artifact

rig pack --preview     # show what would be packaged, don't write the tarball
rig pack
rig inspect ./dist/<name>-<version>.rig.tgz

The inspect output lists every file in the artifact. It also runs safety checks for things that look like secrets.

Why not just use .gitignore?

.gitignore is about what gets committed; rig is about what gets distributed. The two often differ — e.g. you might check in data/reference/ (rarely changes, small, useful in the repo) but not want to ship it inside the artifact.

.rigignore is therefore a separate file; rig does not read .gitignore.

See also