Skip to content

Files Lawcheck reads and writes ​

Lawcheck keeps its files in the folder .lawcheck/. The folder that holds it is the root, where each path of the law starts. You write the law, the settings and the rules. Lawcheck writes the other three: the verdicts of reviewer rules, a merge setting for them, and a local folder that git ignores.

The folder .lawcheck ​

FileWhat it holdsWritten byCommit it
.lawcheck/law.yamlthe law: the types, the rules and may_use (The law file)lawcheck init writes the first one, and you edit ityes
.lawcheck/config.yamlthe settings, such as the reviewer and the runner setting (Settings)you; Lawcheck only reads ityes
.lawcheck/rules/one file per rule, <id>.mjs for a script rule or <id>.md for a reviewer rule, and helpers of script rules in rules/lib/you; init makes no rules/ folderyes
.lawcheck/verdictsthe passes of reviewer rules, one line per pass: 32 hexadecimal characters, a space and the rule's id, sortedlawcheck check --reviewyes, so that CI reads the passes and calls no reviewer
.lawcheck/.gitattributesthe line verdicts merge=union, so a merge of two branches keeps the passes of bothlawcheck check --review, when it records a pass and the line is missingyes
.lawcheck/.gitignore.local/ and config.local.yamllawcheck init, when the file is absentyes
.lawcheck/.localthe failure cache, a lock and temporary files of the verdictslawcheck check --reviewno

init writes this .gitignore:

text
.local/
config.local.yaml

Lawcheck 0.1.0-alpha.3 reads no config.local.yaml. The second line of this file keeps a file of that name out of git.

A type's paths can match the law, the config and the rule files. Lawcheck then judges such a file against the rules of its type. .lawcheck/verdicts and .lawcheck/.gitattributes never get a type.

The folder .lawcheck/.local ​

check --review makes this folder. The folder holds its own .gitignore with the line *. Git ignores every file of the folder, even without .lawcheck/.gitignore.

FileWhat it holds
failures/<hash>.jsonone failed review: the rule and its findings, with any key hidden as [key]; a later check reports it again without a call, and check --review --again asks again (Reviewer rules)
verdicts.locka folder that one run holds while it writes .lawcheck/verdicts; a run that needs the lock removes one older than 10 seconds, or one of a run that ended
verdicts-<pid>-<hex>the new verdicts file before it replaces the old one
probe-<pid>-<hex>a test that the folder can be written, made and removed before the first call

After a review passes, Lawcheck removes its file from failures/. If you delete the .local folder, you lose the cached failures and nothing else. The next check --review asks the reviewer for those reviews again.

Outside the repository ​

WhereWhat it holdsWritten by
CLAUDE_PLUGIN_DATA, or a folder lawcheck-plugin-<user id> in the system's temporary directoryone small file per Claude Code session; each session start removes the files older than 7 daysthe Claude Code plugin (The Claude Code plugin)
a folder in the system's temporary directory named lawcheck-, the program's name, a dash and 6 random characters, such as lawcheck-claude- and 6 characters for claude-codethe working folder of one call to a reviewer program; gemini-cli gets a second folder, ending -aside- and 6 characters, for its policy filecheck --review and try, which remove both after the call
a folder lawcheck-index- and 12 random characters in the system's temporary directorya copy of git's index, so that reading the change leaves the real index untouchedcheck and doctor, when they compare with a base, and they remove it at once

Outside .lawcheck/, Lawcheck reads three things:

  • the files git lists below the root;
  • the files that the context of a reviewer rule names;
  • git's own data, through git.

Next: Codes