stern-logs

stern-logs is a skill for Claude Code, Codex from shyuan/skills. It costs 217 tokens per session (3,675 once invoked), scanned A, original, MIT.

A guide for using stern, a command-line tool that collects logs from many Kubernetes pods and containers at once. Kubernetes runs applications in containers grouped into pods.

In plain words
What is it for?
Use it to find errors across a namespace, investigate crash-looping pods, follow a rollout, or compare logs from several containers.
Why use it?
It helps investigate failures without opening each pod's logs separately. It also prevents an automated session from hanging on an endless live log stream and limits the amount of output.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to find errors across a namespace, investigate crash-looping pods, follow a rollout, or compare logs from several containers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shyuan/skills/stern-logs
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 shyuan/skills --skill stern-logs
Clone the repo
git clone --depth 1 https://github.com/shyuan/skills

Made for: Claude Code, Codex.

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 stern-logs

README.md
[![agentmods](https://agentmods.dev/badge/skills/shyuan/skills/stern-logs/github.svg)](https://agentmods.dev/skills/shyuan/skills/stern-logs)
Your own site
<a href="https://agentmods.dev/skills/shyuan/skills/stern-logs"><img src="https://agentmods.dev/badge/skills/shyuan/skills/stern-logs/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 stern-logs

Your own site · 80×15
<a href="https://agentmods.dev/skills/shyuan/skills/stern-logs"><img src="https://agentmods.dev/badge/skills/shyuan/skills/stern-logs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 217 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,675 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.00217 $0.03675
Opus 5 $0.00109 $0.01837
Sonnet 5 $0.00043 $0.00735
Haiku 4.5 $0.00022 $0.00367

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

Security

Grade A, and why

stern-logs 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 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (evals/measure_triggers.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/stern-logs/SKILL.md · 214 lines

How it starts

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

stern

stern tails logs from many pods and many containers at once, selected by a regex or a Kubernetes resource, with automatic pickup of new pods and colorized per-pod output.

Iron Law

In an agent/non-interactive context, every stern invocation carries --no-follow.

Without it stern streams forever and never exits — the tool call blocks until the harness timeout, and the partial output may be discarded. The only exception: the user explicitly asked to watch a live stream, and it runs as a background command with a stated stop condition.

The second half of the law: bound the volume. The defaults are --since 48h and --tail -1 (every line ever retained), multiplied by every matching pod. Always narrow at least one of --tail / --since — and both once the query spans more than a handful of containers, since they are what truncates each stream. Narrowing which containers are read at all (-E, --exclude-pod, -l, a tighter query) saves more and costs nothing; line filters save neither.

Rationalization table

Every one of these will occur to you mid-task. All of them are wrong.

The thought Reality
"This namespace only has two pods, streaming is fine." Pod count does not make stern exit. Two pods stream forever just as well as fifty.
"The user said 'watch'/'monitor'/'看一下現在的狀況', so they want live output." They want an answer. --no-follow --since 5m gives it. Streaming into a blocked tool call gives them nothing.
"I'll add a timeout, that bounds it." timeout exits 124 and can cut a line mid-write, so the harness may surface a failed command instead of your logs. Bound it with stern's own flags; keep timeout only as a belt-and-braces outer limit.
"It's idle, it will stop when there's nothing left." --no-follow is the only thing that makes stern conclude "all logs shown". Idle means it waits, not exits.
"I'll pipe to head, so it ends." It does end, but head keeps the oldest N lines it happened to see first — the opposite of the recent lines you wanted. --tail N selects from the end.
"The previous stern call worked without it." It did not "work" — it hit the timeout, and you saw the partial output that survived.
"This is a follow-up to a live session, --tail 0 is what they meant." --tail 0 means "only lines from now on", which by definition never terminates. It is also rejected together with --no-follow.

Read the full file on GitHub · 214 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 214 lines · 217 tokens per session scan A ce886ba02c9c

Subscribe to this mod's changes

stern-logs is a skill published in the GitHub repository shyuan/skills (5 stars, last pushed yesterday), licensed MIT. It adds 217 tokens to every session and 3,675 once invoked, about $0.0011 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-31.

Related

Other skills, from other repositories

hermes-s6-container-supervision

Modify or debug s6 services in the Hermes Docker image.

NousResearch/hermes-agent · 20 tokens

oracle

Oracle second-model review: bundle prompts/files, debug, refactor, design.

steipete/oracle · 18 tokens

review-loop

Run the adversarial verification loop — implement, then hand the change to a fresh checker that did not write it, fix what it finds, and re-dispatch until APPROVE. Use before claiming any behavioural change is done, and on requests like "review loop", "adversarial review", "independent review", "get this verified"…

sangrokjung/claude-forge · 100 tokens

semgrep-rule-creator

Creates custom Semgrep rules for detecting security vulnerabilities, bug patterns, and code patterns. Use when writing Semgrep rules or building custom static analysis detections.

waybarrios/opencode-power-pack · 37 tokens

variant-analysis

Find similar vulnerabilities and bugs across codebases using pattern-based analysis. Use when hunting bug variants, building CodeQL/Semgrep queries, analyzing security vulnerabilities, or performing systematic code audits after finding an initial issue.

waybarrios/opencode-power-pack · 45 tokens

code-review-web

Review web application code for bugs, security issues, performance problems, and stack-specific anti-patterns. Use this skill whenever the user wants to review code, debug a production issue, investigate a build failure, audit security, or check a PR before merging. Triggers on code review, review my code, debug…

rampstackco/claude-skills · 121 tokens