Auto Context — selection mode + bulk actions
A multi-select mode on the Auto Context sidebar panel: pick several always-inject or on-demand docs at once, then copy their contents to the clipboard or delete them in one confirmation. Covers the Select toggle, the keyboard shortcuts, which docs participate, and the bulk-copy cap.
What it is
A multi-select mode on the Auto Context sidebar panel (the collapsible group that lists every file the project automatically feeds the agent — see project-docs-auto-injection.md for the underlying feature). Lets you pick several Always-inject or On-demand-context docs at once and then copy their contents to the clipboard (with --- filename --- headers between each one) or delete them in one confirmation, instead of repeating the single-row right-click menu N times.
It also adds a Copy contents entry to the single-row right-click menu for the same one-doc-to-clipboard flow when you don't need a bulk operation.
Desktop only — the toggle and the bulk-action footer are hidden on mobile (hidden md:flex). Mobile users still get single-doc actions via the existing long-press / row menu.
System Instructions are deliberately not selectable. The third Auto Context sub-group (CLAUDE.md / MEMORY.md and their synced mirrors) is view / edit-only — bulk-delete would let one stray Ctrl+A wipe the agent's persistent rules + memory in a single confirm, so those rows render without a checkbox slot and never appear in the selection count. Bulk copy / delete only touches the Always-inject and On-demand context sub-groups.
Where to find it
Everything here lives in the Auto Context group of the left sidebar. Expand that group on any real project — virtual projects with no on-disk folder don't have docs.
The Select square icon sits at the right end of the filter search row, next to the search input. Once at least one row is ticked, a bulk-action footer slides in under the doc list. Both the toggle and the footer are desktop-only; on a phone the same actions are available one doc at a time through the long-press / row menu.
How it behaves
How to use it
- Expand the Auto Context sidebar group on any real project (virtual projects with no on-disk folder don't have docs).
- Click the Select square icon at the right end of the filter search row (sits next to the search input). The square fills in (
text-accentcolour) and Always-inject + On-demand-context rows gain a checkbox slot at the left edge of each row. System Instructions rows stay unchanged. - Click a row to toggle its selection. Shift+click a second row to range-select every row between the previous click and that one. Ctrl/Cmd+click behaves the same as a plain click in selection mode (toggle one row), and also works outside selection mode to enter it and pick the first row in one stroke.
- The bulk-action footer slides in under the doc list once at least one row is selected, showing
N selectedplus three buttons:- Copy — concatenates each selected doc's full text contents into one clipboard payload, separated by
--- <filename> ---headers, and fires a toast. Binary files (images, PDFs) emit a[Binary file <filename> — <size> bytes — not copied]placeholder line in their slot so you still see them in the output. - Delete — opens a confirm dialog (
Delete N docs?) listing the selected filenames; Confirm loops throughFILES_DELETEper file, fires a single summary toast at the end, then drops out of selection mode. - × Cancel — exits selection mode and clears the selection without touching anything.
- Copy — concatenates each selected doc's full text contents into one clipboard payload, separated by
- Right-click a selected row while in selection mode (with 2+ rows selected) → the row menu adapts to show Copy N docs and Delete N docs instead of the per-doc Rename / Delete / Copy contents entries. Right-clicking an unselected row still shows the single-doc menu.
- Esc exits selection mode, Ctrl+A selects every selectable doc currently visible under the search filter (System Instructions are skipped), Ctrl+C triggers the bulk-copy, and Delete / Backspace opens the bulk-delete dialog — but only while keyboard focus is inside the Auto Context panel itself, so the same shortcuts don't fight your text editing elsewhere on screen.
The Select button only renders when the panel is expanded AND at least one selectable doc exists (Always-inject or On-demand context) — there's nothing to select when the panel only holds System Instructions, or when the panel is empty.
Filter narrows selection scope. Selection commands respect the search query — Ctrl+A selects everything the current filter shows that is selectable. If you change the search while a selection is live, the selection persists; rows scrolled out of view by the filter stay in selectedNames until you exit selection mode.
What participates
Both auto-injected buckets — the Always-inject docs at the top of .claude/docs/ and the On-demand context docs in .claude/docs/rag/ — participate equally; System Instructions never participate (see above):
- Plain hand-dropped docs (markdown, text, code, PDFs, images) — selectable in both Always-inject and On-demand context.
- ContextDock-managed docs (📦 bundles and 📋 lists, identified by the
ContextDockDocRowsentinel) — selectable in both. Bulk copy reads their on-disk snapshot (the same content the agent sees), bulk delete unlinks the underlying file like the single-row Delete already does.
The single-doc right-click menus on plain docs (Copy contents / Rename / Delete) and on ContextDock rows (Open in browser / Copy contents / level options) gain the same Copy contents entry routed through the same runCopyForNames([name]) helper, so the output format and clipboard path is identical whether you copy one doc or twenty.
What's deliberately suppressed in selection mode
Selection-mode clicks need a clean way to toggle rows, so two row gestures pause while it's on:
- Drag-reorder is disabled on every selectable row — the row's long-press drag-props are not forwarded (so a press-and-hold toggles selection instead of starting a drag), and a checkbox slot appears at the left edge. Re-ordering is available again when you exit selection mode.
- Middle-click delete is suppressed on ContextDock rows — the row's existing middle-click "delete this row" handler returns early when
selectionModeis true, so a middle-click drag-scroll gesture across the list can't accidentally remove every row it passes over.
Single-doc click-to-open-the-file-peek is also suppressed in selection mode — a plain click toggles the selection instead. Exit selection mode (Esc, the × in the footer, or click the header Select button again) to get the original behaviour back.
Clipboard size cap
Bulk copy is bounded by a 5 MB byte cap on the concatenated payload (BULK_COPY_BYTE_CAP in src/renderer/src/features/dashboard/ProjectDocsSection.tsx). If the running total would exceed the cap, the helper stops concatenating and fires an error toast naming the file that pushed it over — your clipboard is left untouched, no partial dump. The cap protects against accidentally pulling a folder full of multi-megabyte image data-URIs into clipboard memory (the underlying FILES_READ_ABSOLUTE IPC returns data: strings for image files, which inflate by ~33% from base64).
Why a separate page
The auto-injection page describes how files reach the agent — the first-message inline injection, the first-message binary attachment, the bucket split, the cap, and the three-sub-group sidebar surface. Selection mode is orthogonal: it's how you wrangle the files inside the sidebar once they're already there. They share the same data source (the same FILES_LIST_PROJECT_DOCS IPC response, the same on-disk folder layout, the same ContextDock sentinel detection, the same System Instructions probe) but the user flow, the surface, and the failure modes are different — so the two pages stay independent and cross-link.
Related
Selection mode only makes sense on top of the Auto Context panel itself, so project-docs-auto-injection.md is the page to read first: it explains the first-message inline injection, the binary attachment, the bucket split and the three-sub-group sidebar layout that this mode operates on. ContextDock-managed bundles and lists participate in selection, bulk copy and bulk delete exactly like hand-dropped docs do, so contextdock.md is the natural companion. The third sub-group — System Instructions, meaning CLAUDE.md / MEMORY.md and their synced mirrors — is view / edit-only and never participates in bulk delete, which agent-instructions-sync.md covers. If you like the mental model here, the same idea exists on a different surface in bulk-select-sidebar.md, the bulk-select feature on the sessions sidebar.
Last verified 2026-09-23