# Tags and Collections

A tag groups artifacts. Each tag makes a collection: the artifacts carrying it, in one list, ready to open from anywhere.

## Assigning a tag {#assigning}

A tag is a `#word` in an artifact’s description: letters, digits, `_` or `-`, with at least one letter. There are four ways to assign one.

### In the description {#in-the-description}

**Edit Description** (<kbd>⇧⌘D</kbd>), type the tag anywhere in the text, and press <kbd>↩</kbd>. This is also how a new tag begins.

```
Quarterly numbers for the board. #finance #board
```

### With Tag… {#with-tag}

Select one or more artifacts and choose **Tag…** (<kbd>⇧⌘T</kbd>). Type a tag, one the shelf already uses or a new one, and press <kbd>↩</kbd> to add it to every artifact selected. Nothing changes until you choose **Done**, and <kbd>⎋</kbd> leaves everything as it was.

### From the right panel {#from-the-panel}

For a tag the shelf already uses, select one or more artifacts, open the **Tags** tab in the right panel (<kbd>⌥⌘2</kbd>), right-click the tag and choose **Add to Artifact**. With several selected, it tags them all at once, and the item shows how many it changes, for example **Add to 3 Artifacts**. Once every selected artifact carries the tag, the same item removes it instead and reads **Remove from Artifact** or **Remove from 3 Artifacts**.

### From the command line {#from-the-command-line}

The `sediment` command tags an artifact as it files it, or later by its id. `--tag` adds a tag at the end of the description, and `--untag` removes one wherever it stands. Repeat either for more than one tag.

```
sediment add ./q3.html --tag finance --tag board
sediment update <id> --tag board --untag draft
```

> [!TIP]
> Sediment is made to take in a lot from your agents, far more than you’d want to tag by hand. So rather than tagging each artifact yourself, set a rule once: which tags to use, and what each one means. Agents read it before they file, and tag as they go. [Your instructions](working-with-agents.md#instructions) are where that rule lives.

## Editing a tag {#editing}

**Edit Tag…** (<kbd>⌥⌘T</kbd>) changes a tag across the shelf at once.

| Field | What it does |
|---|---|
| **Meaning** | One line saying what belongs under the tag, and agents read it too. A good tag groups artifacts you’ll want together again; one artifact’s subject belongs in its description. A tag with none reads “No meaning yet”. |
| **Name** | Renames the tag on every artifact. |
| **Merge into** | Moves every artifact to another tag. |
| **Remove from all** | Takes the tag off every artifact, the Trash included. |

A good tag groups artifacts you’ll want together again. One artifact’s subject belongs in its description, not in a tag of its own.

### Finding what’s untagged {#untagged}

**Untagged** heads the **Tags** tab while any artifact has no tag. Click it to see them all.

## Collections {#collections}

Collections let you browse by subject instead of scrolling one long list.

A collection draws from the Shelf and the Archive together, and shows in the sidebar in place of the list. The sidebar’s heading names it and counts it: “#finance · 12”. **Show Shelf** (<kbd>⌘1</kbd>) takes you back.

Every tag is a collection by default, and **Search…** (<kbd>⌘K</kbd>) is the quick way to reach it. Type `#` and Sediment lists the shelf’s tags, the most used first, each with its count, narrowing as you type. Press <kbd>↩</kbd> on one and its collection opens, wherever you are.

### Saving a collection {#saving}

A collection you save stays at the foot of the sidebar, so a subject you come back to every day is one click or one key away, never a search. It’s still the tag underneath: whatever gets that tag next, from you or an agent, shows up there on its own.

**Save Collection…** (<kbd>⌘D</kbd>) saves the collection you’re in. The first six also answer <kbd>⌘4</kbd> to <kbd>⌘9</kbd>, in order. **Move Collection Up** (<kbd>⌃⌘↑</kbd>) and **Move Collection Down** (<kbd>⌃⌘↓</kbd>) change that order, and so does a drag. **Remove Collection…** (<kbd>⌘D</kbd>) takes it off the sidebar and leaves its tag on every artifact.

### Other ways in {#other-ways-in}

| Shortcut | What it gets you |
|---|---|
| <kbd>⌘4</kbd> to <kbd>⌘9</kbd> | One of your first six saved collections |
| <kbd>⌥⌘2</kbd> | The **Tags** tab: click a tag to open its collection |
| <kbd>⌘I</kbd> | **Show Info**: click a tag to open its collection |
| <kbd>⌘F</kbd> | **Find**: type `#` and the tag to narrow the list in front of you instead |
