log-structured

log-structured is a skill for Claude Code from Filip-Podstavec/claude-leverage. It costs 69 tokens per session (1,492 once invoked), scanned A, original, MIT.

A read-only code audit for structured logging, where logs use consistent fields such as timestamps, levels, trace IDs, events, and attributes. It checks a codebase against the logging rules in AGENTS.md.

In plain words
What is it for?
Use it when reviewing legacy logging, after adopting a JSON-lines logging format, or when cleaning up logging. It suggests replacements for common patterns in Python, JavaScript, TypeScript, and Go.
Why use it?
It finds logging that is hard to search, filter, or connect across services, such as print statements and messages with values embedded in text. It gives file-and-line findings without changing code.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions AGENTS.md.

Part of the claude-leverage plugin — 16 skills, 5 commands, 14 agents, 4 hooks shipped together

Good fit Use it when reviewing legacy logging, after adopting a JSON-lines logging format…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/filip-podstavec/claude-leverage/log-structured
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.

Any agent
npx skills add Filip-Podstavec/claude-leverage --skill log-structured
Clone the repo
git clone --depth 1 https://github.com/Filip-Podstavec/claude-leverage

Made for: Claude Code.

Or install claude-leverage, the plugin that ships this one along with the rest of its 16 skills, 5 commands, 14 agents, 4 hooks.

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 log-structured

README.md
[![agentmods](https://agentmods.dev/badge/skills/filip-podstavec/claude-leverage/log-structured.svg)](https://agentmods.dev/skills/filip-podstavec/claude-leverage/log-structured)
Your own site
<a href="https://agentmods.dev/skills/filip-podstavec/claude-leverage/log-structured"><img src="https://agentmods.dev/badge/skills/filip-podstavec/claude-leverage/log-structured.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,492 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.00069 $0.01492
Opus 5 $0.00034 $0.00746
Sonnet 5 $0.00014 $0.00298
Haiku 4.5 $0.00007 $0.00149

Measured 7d ago against content hash e7f58fb3fa5a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

log-structured 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 7d 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.

skills/log-structured/SKILL.md · 138 lines

How it starts

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

/log-structured

What it does

Helps retrofit a codebase to the structured-logging spec from AGENTS.md:

{"ts":"2026-05-24T12:34:56.789Z","level":"info","trace_id":"a1b2c3","span_id":"4d5e6f","service":"billing","event":"invoice_paid","attrs":{"invoice_id":"inv_789"}}

Walks a target path, finds anti-patterns, and emits a structured report with file:line citations and concrete suggested replacements. Never modifies code — the user decides per-finding.

Anti-patterns flagged

Pattern Why it's a problem Suggested fix
print(...) in production code No level, no context, no structure Replace with logger call
console.log(...) in production code Same; not structured Replace with structured logger
logger.X(f"user {id} did {action}") (Python) Values baked into message → agent can't grep event=did_action Move values to attrs={"user_id": id, "action": action}
logger.x(`user ${id} did ${action}`) (TS/JS) Same logger.info("user_action", { user_id: id, action })
fmt.Printf("user %d ...", id) followed by log.Print Same slog.Info("user_action", "user_id", id)
Missing trace_id propagation Can't reconstruct request flow Wire context-aware logger (template per lang)
Logging to stdout in a service that should log structured (e.g., print in Flask handler) Operator tooling can't parse Wire JSON formatter

Workflow

  1. Resolve target. Default . (whole repo). If $ARGUMENTS has a path, use that. If --lang <name> is given, restrict scan to that language; else auto-detect from file extensions.

  2. Detect language(s) by file extension. Walk only files matching:

    • Python: *.py (skip tests/, *_test.py, __pycache__)
    • TypeScript/JavaScript: *.ts, *.tsx, *.js, *.jsx (skip node_modules/, dist/, build/, *.test.*, *.spec.*)
    • Go: *.go (skip *_test.go, vendor/)
    • Rust: *.rs (skip target/, tests/)

Read the full file on GitHub · 138 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. 7d ago First seen · 138 lines · 69 tokens per session scan A e7f58fb3fa5a

Subscribe to this mod's changes

log-structured is a skill published in the GitHub repository Filip-Podstavec/claude-leverage (68 stars, last pushed 1mo ago), licensed MIT. It adds 69 tokens to every session and 1,492 once invoked, about $0.0003 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-08-30.