Skip to content

rm

harn rm <paths...> --root <directory> previews the exact files it would permanently remove. Directories require --recursive; deletion requires --yes. --dry-run keeps the operation a preview even when --yes is present.

Terminal window
harn rm --root ./output --recursive --json -- ./output/obsolete-render

A batch accepts at most 100 explicit, nonoverlapping targets and inspects at most 10,000 entries by default. --entry-limit <n> selects an integer limit from 1 through 100,000.

A value above 10,000 works only when --root names one valid, unreleased managed artifact created by the current authenticated caller. The command checks that authority before inspection and again before applying. A parent artifact store, an ordinary directory or another caller’s workspace cannot use the larger limit.

The JSON report includes the chosen entry_limit, inspected entry count and byte count. Review the preview before adding --yes.

Every target must lie strictly inside the resolved root. The command refuses tracked paths, overlaps with another live agent’s claims, filesystem roots, home and system directories, the working directory and its ancestors, mount boundaries and special files. Targets and their ancestors cannot be symlinks. Links inside a recursive target are removed as links; their destinations stay untouched.

Protected paths need an exact --allow-protected <path> for each one. Live Git and coordination state cannot be allowed. Copied coordination state has its existing exact-path and artifact-ownership restrictions. An artifact’s root, record and holds stay in place when its disposable contents are pruned.

The whole batch is inspected before the first deletion. Root identity, file fingerprints, Git ownership, peer claims and any required artifact authority are checked again before applying. Deletion remains permanent, and a filesystem error can leave a partially completed batch.

Use --clean-clone with --recursive for a reviewed repository copy inside one valid, unreleased managed artifact owned by the current caller:

Terminal window
harn rm --root .harnery/artifacts/<workspace> --recursive --clean-clone --json -- .harnery/artifacts/<workspace>/copy

The default remains a preview. Add --yes only after reviewing its targets. This mode requires a standalone .git directory, no modified, staged or untracked files, and no HEAD, ref or reflog commit missing from all recorded remote refs. Detached HEADs and stashes are checked too. Registered or linked worktrees, shared Git metadata, and unverifiable repositories are refused. These checks do not fetch remotes; refresh a copy’s remote refs before attempting cleanup when their currency is uncertain.

Nested standalone repositories receive the same checks. Other protected state remains refused, and --allow-protected cannot be combined with this mode. Root identity, artifact ownership, repository state, fingerprints and peer claims are rechecked before deletion. The surrounding artifact, manifest, holds, sibling evidence and external symlink targets stay in place.