Skip to content
Back to skills

Lessence

ASecurity

lessence ("log essence") folds a large log into its distinct events with counts, line numbers and timestamps, keeping every unique line. Use it instead of tail/head/grep sampling when diagnosing any large log: tail -50 is blind to the rest of the file; lessence shows every event and declares anything it omits.

  • 5 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 15, 2026
ai-agentspythongojavabashdockerapisecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned November 30, 2026

npx -y skills add air-gapped/lessence --skill lessence --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lessence?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lessence
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/air-gapped-lessence/badge)](https://www.skillsdirectory.com/skills/air-gapped-lessence)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lessence
description: >-
  lessence ("log essence") folds a large log into its distinct events with
  counts, line numbers and timestamps, keeping every unique line. Use it
  instead of tail/head/grep sampling when diagnosing any large log: tail -50
  is blind to the rest of the file; lessence shows every event and declares
  anything it omits.
when_to_use: >-
  Triggers on "checking logs", "wall of logs", "wall of text", "build log",
  "too much output", "can't find the error", "what's actually failing",
  "find the root cause", "the error happened earlier", "what's
  the pattern", "compress logs", "feed logs to LLM", "reduce context", or
  when looking at kubectl logs, docker logs, journalctl output, CI failures,
  crash-looping pods, test failures, or anything not normal in log output.
  When tempted to tail -N, head -N, or sample a log over ~200 lines: run
  lessence first for the map, then read the raw lines of the events that
  matter. It already reports line counts, levels and each event's first and
  last timestamp, so no wc/head/tail recon pass is needed. Does NOT trigger for short output
  (under ~50 lines), live following (tail -f), or when the task is ONLY a
  known-keyword search — plain grep suffices there; if the question is even
  partly exploratory ("anything else weird?"), use lessence.
license: MIT
---

# lessence: the map of a log, then the lines that matter

lessence gives the map: every distinct event of the log, with its count,
level, first line number and the timestamps of its first and last line.
The answer is in the raw lines of
the few events that matter; lessence tells you which lines to read.

**Run lessence with no pipe after it.** Never put `| head`, `| tail` or
`| grep` on its output: the map is long on purpose, and a cut map hides
events. Read it all, then go to the raw log for the events you pick. Too
big for your context? Use `--overview N`, a declared short view, not head.

## The workflow

**1. Map.** Run it on the whole log, once.

```bash
lessence app.log                       # a file
kubectl logs deploy/api | lessence     # or anything on stdin
cargo test 2>&1 | lessence             # stderr too
```

stdout: the briefing, a `map:` line with the event total, every event on
one line (errors, then warnings, then the rest, rarest first). No file is
saved; `--report DIR` also keeps the complete folded JSON in a `report.jsonl`
under DIR, names it on the `report:` line and adds jq recipes.

```
[1x] id=93 error L263 E0909 20:00:10.852784 → E0909 20:00:10.852784  <TIMESTAMP>    <PID> controller.go:195] "Failed to update lease" err="Put \"<PATH>\": unexpected EOF"  variation: not recorded (not computed for this group, or none)
[6x] id=163 info L346 I0909 20:42:35.018774 → I0914 09:34:32.806964  <TIMESTAMP>    <PID> kubelet_network_linux.go:50] "Initialized iptables rules." protocol=<VARIES>  variation: ... VARIES=2 ["IPv4"|"IPv6"]
```

`[count]x`, `id`, level, `L<n>` (the first line in the source), the
timestamps on its first and last line exactly as written, the template, the
values per slot.

**2. Pick events.** From the briefing and the event lines:

- errors and warnings (they are at the top);
- rare events: `[1x]`;
- bursts: an event whose first and last stamps are seconds apart among
  events that run all day (the JSON `time_range.bunched` names the run);
- anything you did not expect for this system.

A big count whose first and last stamps cover the whole log is usually
routine. Judge by time, not count.

**3. Read the raw lines** of each picked event, in the log itself.

```bash
sed -n '263p' app.log                    # the event's first line (L263)
sed -n '255,270p' app.log                # what happened around it
grep -nF 'Failed to update lease' app.log   # its lines, and look-alikes: the template's literal words
```

With a report (`lessence --report DIR app.log`, the path is on the `report:`
line), jq gives one event's values: pods, IPs, users.

```bash
jq 'select(.type=="group" and .id==93)' -- '<report path>'
```

`grep -F` takes literal words between the placeholders (`<PATH>`, `<PID>`);
pick a run of words with no placeholder in it. Other events can share
those words (here, the same call with a different `err=`): add a second
`grep -F` on more literal words to keep only this event. The report record holds `first.line_no`,
`last.line_no`, `time_range` and `variation` with sample values.

**Confirm every count and every absence in the raw log before you state
it.** One event can sit in several map lines (a variant, a different
field), so a count read off one line can be too low. `grep -c` (or
`grep -cF` on the literal words) gives the number you report; "never",
"none" and "no X" are stated only after a `grep -F` for X finds nothing.

Then go back to the map for the next event, or grep the raw log for an id,
pod or IP you found. Search the log, not lessence's output: the output has
placeholders where the values were.

## Picking the run

| Situation | Command |
|---|---|
| Any large log, cause unknown | `lessence app.log` |
| Only a known keyword ("show the panics") | `grep -n panic app.log` |
| Live source, `tail -f`, no EOF | `... \| lessence --no-report` |
| Only the latest events matter (problem is live now) | `tail -N`: recency is the filter |
| Stack traces (test runs, Java, Python) | `lessence --frame-continuations app.log` |
| Map too big for the context | `lessence --overview 50 app.log` (declares what it leaves out) |
| Orientation only, as JSON | `lessence --preflight app.log` |
| All groups as JSONL for jq | `lessence --format json app.log` |
| Why two lines split or folded | `lessence --explain app.log` |
| Compare two periods or pods | `lessence --essence --no-report` on each, then `diff` |
| Mask hosts and IPs before sharing | `lessence --sanitize host:pseudonym,ip app.log` |

`--top N` and `--summary` rank by count: a one-off error is not among the
most frequent. Use them for dominant behaviour (crash loops, capacity),
never to look for the cause.

Test runs: the failures are the `[1x]` events. journalctl: one event from
many hosts is one event; the hosts are in its `HOST` values.

## Reading the map

- **Briefing** (first block): `format:` decides jq or grep for step 3;
  `levels:` how many errors there are to read. The time span, the busiest
  stretch, the top templates and the token classes are in the JSON
  briefing (`--preflight`, or the `--format json` summary): token
  `occurrences/distinct` with low distinct (`uuids 1,285/101`) is a facet to
  group by, distinct near occurrences is a per-request id to grep.
- **Times are as written.** The stamps on an event line are those of its
  first and last line, which in a log out of time order are not its earliest
  and latest; the JSON `time_range.first_seen`/`last_seen` are. A stamp with
  no year or zone is never given one (`span.year_known`, `zone_known`).
- **A template is a claim** about every member. A placeholder replaces a
  value; words, field names and levels stay literal. A slot that holds 6 or
  fewer different words across the log splits into one line per word
  (`Server Busy` and `Server Reject` are two lines). `<VARIES>` marks where
  members differ in a value or in more than 6 words; its values and counts
  are on the line (`VARIES=2 ["IPv4"|"IPv6"]`). `∅` counts members with
  nothing there.
- **Counts on the `variation:` line**: `ip=9` is exact, `ip>=64` a lower
  bound. `report-sampled` means the report itself holds only a sample.
- **Nothing is dropped.** The `report:` line says `groups: N total, N
  printed, 0 omitted` and whether the input was complete. When it says
  otherwise, `--report DIR` keeps every group in a file.

Field by field, the `--no-report` text form, and jq recipes:
`references/reading.md`.

## When the run fails

- Exit 1, empty stdout, `report: not written (…)` on stderr: the
  `--report` dir is on tmpfs or the report passed `--report-max-bytes`.
  Rerun with `--report DIR` on disk, or without `--report`.
- A `--report` directory is never pruned; delete old `run-*` directories.

## This skill and the binary

With this skill in context, do not run `lessence --skill`. The installed
`lessence --help` is the authority on flags. After an upgrade, reinstall:

```bash
mkdir -p ~/.claude/skills/lessence/references
lessence --skill > ~/.claude/skills/lessence/SKILL.md
lessence --skill flags > ~/.claude/skills/lessence/references/flags.md
```

## References

- `references/flags.md`: every flag, the saved report, security limits,
  CI exit codes. Printed by `lessence --skill flags`.
- `references/reading.md`: the briefing, text mode and JSON fields in
  detail, jq recipes, comparisons and CI gating (repo only).
- Repo only: `references/sources.md` (what each claim was checked
  against), `references/trigger-evals.json`, `references/choice-evals/`,
  `docs/format-json-schema.md`.

Files in this skill

  • SKILL.md25.3 KB
  • references/choice-evals/README.md11.1 KB
  • references/choice-evals/baseline.jsonl34.5 KB
  • references/choice-evals/candidate.jsonl31.3 KB
  • references/choice-evals/run_choice_eval.py12.4 KB
  • references/choice-evals/scenarios.json7.3 KB
  • references/choice-evals/score.py7.1 KB
  • references/flags.md24.4 KB
  • references/improvement-backlog.md4.5 KB
  • references/sources.md7.4 KB
  • references/trigger-evals.json2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.