agentleFS
air-gappedair-gapped/lessence/CLAUDE.md

lessence

CLAUDE.md5 starsChanged 4 months agoMITView on GitHub

lessence ("log essence") folds a massive log to its distinct events with counts, keeping every unique line. It is built for an agent that must understand a log it cannot read in full. Zero data loss; an over-fold (two events shown as one) is the worst failure; shape recognisers, never vocabularies. Run make gate before committing anything that builds the binary: src/, Cargo.toml, Cargo.lock, build.rs, and the two skill files src/skill.rs embeds (.claude/skills/lessence/SKILL.md, references/flags.md); the pre-commit hook checks that gate.json…

  • Commits and pushes

The file

We split this CLAUDE.md into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run make gate before committing anything that builds the binary: src/, Cargo.toml, Cargo.lock, build.rs, and the two skill files …

    line 52
  2. Distinctive:

    Not evidence: synthetic inputs, wall-clock numbers, a baseline binary you supplied yourself, a number quoted from memory.

    line 118
  3. Very specific:

    Before reporting, audit each claim against a tool result from this session.

    line 127
  4. Distinctive:

    Write a rule in this file only for a judgment no check can make.

    line 137
  5. Distinctive:

    Commit before risky operations.

    line 163
  6. Distinctive:

    Never run destructive git commands without asking.

    line 167
  7. Distinctive:

    Everything pushed is public: check the diff for anything that should not be, every time.

    line 172
  8. Distinctive:

    Never create planning or scratch files inside the project tree.

    line 174

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md - lessence

lessence ("log essence") folds a massive log to its distinct events with counts, keeping every unique line. It is built for an agent that must understand a log it cannot read in full. Zero data loss; an over-fold (two events shown as one) is the worst failure; shape recognisers, never vocabularies.

lessence app.log                       # file or stdin
kubectl logs pod | lessence
lessence --explain app.log             # JSON: groups, facts, why lines split
lessence --diff <old-binary> app.log   # what an older build folds differently

Commands

make ci             # fmt + clippy + doc + test + deny + mutants-pins + comment-budget + corpus-acceptance + hooks-selftest (~20 s warm, every commit). Tests run on
                    # the test profile: the release profile (fat LTO, one codegen unit) is
                    # for the shipped binary, and GitHub CI is where it is checked to compile
make gate           # FAILS on exactly eight things: a changed line under src/folder,
                    # src/normalize.rs or src/patterns that no test catches a mutation of
                    # (adds minutes, about 13 s a mutant), a new ##CASE that also passes
                    # on the HEAD build (vacuous), kubelet instructions over +1%, or over +2%
                    # against the last release tag (the sum of small steps), --explain vs
                    # --format json disagreeing on a corpus where the HEAD build agreed,
                    # peak RSS over +32 MiB (default run and --overview all), and default
                    # stdout/stderr bytes or tokens over the reviewed size baseline in
                    # tests/fixtures + max(128, 1%), and, when src/normalize.rs or
                    # src/patterns changed, a detector-order dependence on a corpus line
                    # that DETECTOR_ORDER does not declare (about a minute). The golden
                    # diff it prints is material for you to READ, not a verdict — a changed
                    # golden never fails the gate. ≤15 lines, target/gate/gate.json (seconds)
make goldens        # re-record the goldens the last `make gate` reports as changed, after
                    # reading its diff; without it `make ci` fails on the stale golden
make distill        # examples/distilled/<name>.log + .golden from each examples/originals/<name>.log
                    # via the hidden dev flags `--distill --anonymize` (docs/distill.md):
                    # the smallest log that still proves every structure, token type, split
                    # and variation state; values invented. BLESS=1 re-blesses golden
make release-check  # the gate against the last PUBLISHED release's build (what users
                    # run; RELEASE_BASE=vX.Y.Z overrides) + mutants on the diff since it
                    # + make ci + the slow (wall-clock) test profile + the README
                    # compression table's freshness. Writes target/gate/release.json (~20 min)
cargo test --lib    # unit tests while iterating
cargo test --test integration known_open_defects -- --ignored --nocapture   # ##TODO status
cargo test --release --test integration invisible_anchor_splits -- --ignored --nocapture  # open anchor classes
make install        # to ~/.cargo/bin, keeping a copy of every build installed under
                    # ~/.local/share/lessence/installed (version + commit) — that archive
                    # is how a new ##CASE is checked against the build that shipped

Run make gate before committing anything that builds the binary: src/, Cargo.toml, Cargo.lock, build.rs, and the two skill files src/skill.rs embeds (.claude/skills/lessence/SKILL.md, references/flags.md); the pre-commit hook checks that gate.json was produced for exactly the staged change. Run make release-check before a release. Nothing else is required per change.

The perf evidence for a release is the measurement against the last published release, produced by make release-check at handoff and stated in the handoff as the cumulative number. The per-commit gate measures against the newest local tag as well, so the sum of small steps is refused when it passes +2%, but a gate.json found anywhere else, in a worktree or from an earlier day, is scratch, not evidence.

Architecture

Pipeline: read → normalize (detectors replace variable parts with placeholders) → cluster by token similarity → living template with <VARIES> and a counted rollup → render. src/normalize.rs holds the detector order and the anchors (matched, never scored); src/patterns/ the detectors, timestamp/ one scored table of formats; src/folder/ clustering and rendering; src/diff.rs the --diff mode. Details live in docs/ and the pattern-dev skill.

The truth layer

These define correct behaviour. Add to them; never weaken them.

  • tests/fixtures/fold_regressions.log — ##CASE blocks driven through the real binary. Every defect a corpus study finds becomes a ##CASE with invented lines (never copied from a corpus). A new ##CASE must fail on the baseline binary — make gate checks — unless its header says holds-on-base, which declares it a guard of existing behaviour.<!-- scar lessence-yuq: five tests that could not fail, one asserting second_run <= first_run*3 -->
  • tests/integration/test_constitutional_compliance.rs — owned-shape gates: each tolerated near-miss names its bead; the tables only shrink.<!-- scar: kubelet cap 700 -> 1000 proposed instead of a fix; caps replaced by owned shapes -->
  • examples/distilled/*.log (gitignored, scrubbed) — the corpora every gate runs on: the smallest log that still proves what the original proved, with repetition dropped rather than scaled (CONTEXT.md, "Vocabulary": distilled is coverage, miniature is proportion and is deliberately gone — that file is the definition, this is a pointer). The originals in examples/originals/ are raw material — read by studies and the value eval, distilled by make distill, never read by a gate. A gate fails loudly when a distilled corpus is missing; no test passes by absence.

The commit-msg hook refuses a commit that removes or edits an existing ##CASE header, demotes a ##CASE to ##TODO, or grows a known table, unless the message carries Truth-Layer-Change: <bead> <reason>.

Evidence

A claim about behaviour or speed points at a file a script wrote, or it is not a claim.

ClaimEvidence
tests passmake ci exit 0 in this session
output changed on purposegate.json → golden[]: templates added / removed / recounted, per corpus. Read the diff — the gate does not judge it. A re-bless makes any output "correct", so golden: 0 changed straight after BLESS=1 make distill proves only that you just wrote those files
not slowergate.json → perf.delta_pct: instructions:u on distilled kubelet, single thread, one pinned P-core; threshold +1%
not slower since the releasegate.json → perf.since_release.delta_pct: the same measurement against the newest tag's build; threshold +2% (GATE_PERF_RELEASE_MAX)
a new test can failgate.json → cases.new_failing_on_base
memory did not growgate.json → rss_kb: peak RSS of the default run and --overview all vs the baseline's default, allowance +32 MiB
the default output did not bloatgate.json → size: stdout/stderr bytes and tiktoken cl100k_base tokens per corpus vs tests/fixtures/overview-size-baseline.json + max(128, 1%). Same caveat as the goldens — GATE_BLESS_SIZE=1 makes any size "correct"
changed lines are testedgate.json → mutants: total and missed on the change's own lines
mutation scoremutants.out/outcomes.json from make release-check

Not evidence: synthetic inputs, wall-clock numbers, a baseline binary you supplied yourself, a number quoted from memory.

<!-- scar 349493a: a 1M-line synthetic benchmark showed +15%; the real journal went 20 s -> 6 min (0.4.4) --><!-- scar: a musl release binary compared against a local glibc build; the allocator was the "win" --><!-- scar 2026-08-30: four claims asserted from memory, all wrong — the corpus inventory, two root causes read off a commit message rather than measured, and a render edge case defended in argument that occurs in 0 of 120 identities. Each took under a minute to check. Run the command. -->

Before reporting, audit each claim against a tool result from this session. Report in four parts: DONE (what changed, in user terms), PROOF (gate.json numbers, commit hashes), SCOPE (what was not touched), NOT VERIFIED (anything without a tool result — say so plainly).

When the owner corrects you

Fix the mistake, then make it impossible or caught, in this order: change the code so the wrong thing cannot be written; add a check to make ci, make gate or a hook whose message says what to do instead; add a test. Write a rule in this file only for a judgment no check can make. A check explains itself when it fails, so it is not listed here.

Rules and what enforces them

RuleEnforced by
A normalized line states only text the original line hasevery_corpus_line_reads_as_its_normalized_form (src/normalize.rs, make ci); deliberate rewrites go in its DECLARED_REWRITES with a reason
Every word of a template holds for every memberassert_claim_holds on every join (debug builds, every test); the fold reviewer reads changed goldens
A detector-order dependence is declared in DETECTOR_ORDERevery_order_dependence_on_a_corpus_line_is_declared, run by make gate when detectors change
A changed line under src/folder, normalize or patterns is testedmake gate mutants; check-mutants-pins.sh --repin re-places pins that only shifted
A new ##CASE fails on the HEAD buildmake gate → cases.vacuous
The truth layer only growscommit-msg hook (Truth-Layer-Change:)
A ##TODO that passes is promoted to ##CASE or its expectation correctedknown_open_defects (make ci), each block judged on its own
The roadmap's State line is as new as the changes pushedscripts/check-roadmap-state.sh in the pre-push hook
Nothing private is publishedcheck-public-text.sh in the pre-commit and commit-msg hooks
Workers edit src/ and tests/; one build at a timeedit-guard.sh, build-guard.sh

Commits

Conventional commits decide what reaches the changelog, which is now written by hand at release time rather than generated. feat: / fix: / perf: are user-facing and appear in the notes — write the first line for users ("default cap of 30 patterns in --summary mode", not "add DEFAULT_SUMMARY_CAP"). test: / refactor: / style: / chore: / docs: / ci: / build: are hidden. RELEASE_COMMIT=1 for feat:/fix:/perf:. Commit before risky operations. Before git add, check git check-ignore.

Safety

  • Never run destructive git commands without asking. Pushing main is allowed: a push starts no release and no build. A release is only ever gh workflow run release-build.yml -f tag=vX.Y.Z, which tests every platform and creates the tag, the release and the crate after all of them pass — never tag or gh release create by hand (the release skill). Everything pushed is public: check the diff for anything that should not be, every time.
  • Never create planning or scratch files inside the project tree.
  • Corpora are scrubbed by invention before they land in examples/; nothing unscrubbed is ever on disk in the tree.

Orientation

CONTEXT.md — vocabulary (distilled vs miniature), what each gate proves and what it does not, the corpus inventory git cannot show because examples/ is gitignored, and the anchor invariant with its open classes. Read it before claiming what a corpus holds or why a fold split.

Skills

.claude/skills/: testing (test commands, ReDoS patterns), pattern-dev (detector order, adding a pattern, normalization internals), release (versioning, changelog, publishing), lessence (how an agent uses the tool — keep it in sync with every user-facing change).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.