Skip to content

.agentignore

.agentignore defines workspace path permissions for Dline. Path patterns use .gitignore syntax, and you can append permission attributes to a line to restrict scanning, reading, writing, and execution independently.

Create .agentignore in the workspace root. Dline also accepts .dlineignore and .clineignore; it checks .agentignore → .dlineignore → .clineignore and uses only the first file that exists.

  • .agentignore files in subdirectories are not read.
  • Creating, editing, or deleting the file is detected automatically and takes effect immediately.
  • Use !include <file> to pull in rules from another file. Changes to an included file are not detected automatically; save .agentignore again to apply them.
# Hide large generated trees from scans; named files stay readable
coverage/ -s
.next/ -s
*.map -s
# Allow reading vendored code but prevent edits
vendor/ -w
# Prevent untrusted directories from being used as a command working directory
scripts/untrusted/ -x
# A rule without attributes blocks scan, read, write, and execute
.env
.env.*
secrets/
RuleEffect
secrets/Deny scan, read, write, and execute
generated/ -sHide from scans and listings; files named by path remain readable and writable
vendor/ -wAllow reads, deny writes
scripts/untrusted/ -xDeny using the path as a command working directory
private/ -rDeny reads; other permissions unchanged
build/ -swDeny scan and write; attributes can be combined
!audit.log -sRe-allow scanning a path excluded earlier

The attribute letters are r (read), w (write), x (execute), and s (scan). Write them separately (-s -w) or together (-sw). Blank lines and lines starting with # are ignored.

Relationship to .gitignore and built-in exclusions

Section titled “Relationship to .gitignore and built-in exclusions”

During broad scans, such as listing directories or searching files, Dline skips paths in .gitignore and the built-in .git, node_modules, dist, build, out, and tmp directories. This skipping only reduces scan cost; it does not stop reads or writes of a path named directly. A separate built-in rule always denies writes inside .git/.

Restrictions in .agentignore are permissions: even when a task names a restricted path directly, the read, write, and search tools refuse access. The active ignore file itself is also protected, so Dline cannot read or modify it.

  • When a read, write, or execution is denied, the chat shows “Dline tried to access <path> which is blocked by the .agentignore file.” The model receives a matching error and is told to continue without that file.
  • In directory listings, paths that cannot be read are marked with 🔒.
  • Searching a path restricted with -s directly is refused.

The chat notice shown when a write is denied by the vendor/ -w rule in .agentignoreThe chat notice shown when a write is denied by the vendor/ -w rule in .agentignore

Checkpoints follow only .gitignore and the built-in exclusions. The permission rules in .agentignore do not affect them.