filter-log

filter-log is a command for Claude Code from athola/claude-night-market. It costs 31 tokens per session (1,432 once invoked), scanned A, original, MIT.

A log-filtering command that selects the smallest useful part of a log file before you compress or share it.

In plain words
What is it for?
Use it with log, JSONL, or text files to print or apply a line-based filter and optionally measure token counts.
Why use it?
It reduces irrelevant log data before debugging or pasting it into another tool, making the material easier to handle.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the conserve plugin — 15 skills, 6 commands, 5 agents shipped together

Good fit Use it with log, JSONL, or text files to print or apply a line-based filter and optionally measure token counts.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/athola/claude-night-market/filter-log
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/athola/claude-night-market

Made for: Claude Code.

Or install conserve, the plugin that ships this one along with the rest of its 15 skills, 6 commands, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for filter-log

README.md
[![agentmods](https://agentmods.dev/badge/commands/athola/claude-night-market/filter-log/github.svg)](https://agentmods.dev/commands/athola/claude-night-market/filter-log)
Your own site
<a href="https://agentmods.dev/commands/athola/claude-night-market/filter-log"><img src="https://agentmods.dev/badge/commands/athola/claude-night-market/filter-log/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for filter-log

Your own site · 80×15
<a href="https://agentmods.dev/commands/athola/claude-night-market/filter-log"><img src="https://agentmods.dev/badge/commands/athola/claude-night-market/filter-log.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,432 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.01432
Opus 5 $0.00015 $0.00716
Sonnet 5 $0.00006 $0.00286
Haiku 4.5 $0.00003 $0.00143

Measured 6d ago against content hash 81b6310b291a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

filter-log scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/conserve/commands/filter-log.md · 144 lines

How it starts

The opening of the file, as written. The whole thing — 144 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Filter Log Command

Pick the smallest slice of a log that still answers the question you brought to it. Filter beats compression: on the committed intake_queue.jsonl fixture, tail -n 100 saves 95.6 percent of bytes while logs-tokenizer saves 70.3 percent. The asymmetry is reproducible and the tests/test_log_debugging_hygiene.py::test_filter_first_claim_is_reproducible test guards it.

This command routes the user to the tier-1 filters documented in skills/compression-strategy/modules/log-debugging-hygiene.md and stops there. Tier 3 (compression) is intentionally not the default path.

Usage

/conserve:filter-log path/to/file.log
/conserve:filter-log path/to/file.log --lines 50
/conserve:filter-log path/to/file.log --apply --tokens
/conserve:filter-log path/to/file.jsonl --apply

Arguments

Arg Required Meaning
<file> yes Path to the log file (.log, .jsonl, .txt, stdout dump).
--apply no Run the recommended filter and print the result. Default: print the command only.
--tokens no Measure pre- and post-filter token counts with tiktoken (cl100k_base proxy).
--lines N no Override the default line budget. Default: 100 for tail, 50 for head.

What This Command Does

When invoked, follow this routine. Do not skip steps.

Step 1: Inspect the file

Run these probes (read-only, fast):

wc -l "$FILE"          # total lines
wc -c "$FILE"          # total bytes
file "$FILE"           # type detection
head -n 3 "$FILE"      # first few lines for format
tail -n 3 "$FILE"      # last few lines for recency

Use the output to classify the log into one of four shapes:

  • JSONL (each line parses as JSON) -> jq route
  • Timestamped plaintext (lines start with ISO timestamp or [level]) -> rg or awk route
  • Stack trace or panic -> rg -B 5 -A 20 route
  • Unstructured -> tail or head route as fallback

Step 2: Recommend the tier-1 filter

Read the full file on GitHub · 144 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 144 lines · 31 tokens per session scan A 81b6310b291a

Subscribe to this mod's changes

filter-log is a command published in the GitHub repository athola/claude-night-market (337 stars, last pushed today), licensed MIT. It adds 31 tokens to every session and 1,432 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.