instrument-logs

instrument-logs is a skill for Claude Code, Codex from PostHog/skills. It costs 46 tokens per session (1,576 once invoked), scanned A, original, MIT.

A logging-integration skill that adds PostHog log capture, using OpenTelemetry when needed to export application logs.

In plain words
What is it for?
Detecting the project's platform and logging setup, configuring log export when absent, and adding structured log events to changed code.
Why use it?
It makes important application events available for review after features are changed or pull requests are assessed.

Skill for Claude CodeCodex

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

Good fit Detecting the project's platform and logging setup, configuring log export when absent, and adding structured log events to changed code.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/posthog/skills/instrument-logs"><img src="https://agentmods.dev/badge/skills/posthog/skills/instrument-logs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,576 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
  • Socket pass 19 May 2026
  • Snyk fail 19 May 2026
How audits are shown
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.00046 $0.01576
Opus 5.5 $0.00018 $0.00630
Sonnet 5.5 $0.00009 $0.00315
Haiku 4.5 $0.00005 $0.00158

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

Security

Grade A, and why

instrument-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 13d 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/omnibus/instrument-logs/SKILL.md · 92 lines

How it starts

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

Add PostHog log capture

Use this skill to add PostHog log capture for new or changed code. Use it after implementing features or reviewing PRs to ensure meaningful log events are captured with structured properties. If PostHog log export is not yet configured, this skill also covers initial OTLP exporter setup. Supports any platform or language.

Supported platforms: Next.js, Node.js, Python, Go, Java, Datadog, Android, React Native, iOS, and any language via OpenTelemetry.

Instructions

Follow these steps IN ORDER:

STEP 1: Analyze the codebase and detect the platform.

  • Detect the language, framework, and existing logging setup.
  • Look for dependency files and project files (package.json, Podfile, Package.swift, requirements.txt, go.mod, pom.xml, etc.).
  • Look for log libraries (winston, pino, logging module, logrus, log4j, serilog, os_log, Logger, etc.).
  • Look for lockfiles (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lockb, go.sum, Podfile.lock, Package.resolved, etc.) to determine the package manager.
  • Check for existing PostHog log export setup. If the OTLP exporter is already configured, skip to STEP 5 to add log capture for new code.

STEP 2: Research log capture. (Skip if PostHog log export is already configured.) 2.1. Find the reference file below that matches the detected platform — it is the source of truth for OTLP exporter configuration and integration with existing logging. Read it now. 2.2. If no reference matches, use the "Other Languages" reference as a fallback — it covers the generic OpenTelemetry approach.

STEP 3: Install dependencies. (Skip if PostHog log export is already configured.)

  • Install the OpenTelemetry SDK and OTLP exporter packages for the detected platform.
  • Do not manually edit dependency files — use the package manager's install command.
  • If the project keeps more than one lockfile for the same manifest, such as a second Gemfile lock for another bundle, update each one.

STEP 4: Configure the OTLP exporter. (Skip if PostHog log export is already configured.)

  • PostHog logs use the OpenTelemetry protocol. Set up an OTLP exporter pointed at PostHog's ingest endpoint.
  • For SDK-native log support such as Android, React Native, and iOS, follow the platform reference instead of adding a separate OTLP exporter.
  • Follow the platform-specific reference for the exact configuration.

Read the full file on GitHub · 92 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. 13d ago Changed d096e6c08a49
  2. 19d ago Changed · +4 lines 26d110d763df
  3. 2mo ago Changed 0b8cec60146c
  4. 2mo ago Changed · +1 lines 6508b9b8ec50
  5. 3mo ago First seen · 87 lines · 46 tokens per session scan A e456e06e0f69

Subscribe to this mod's changes

instrument-logs is a skill published in the GitHub repository PostHog/skills (81 stars, last pushed today), licensed MIT. It adds 46 tokens to every session and 1,576 once invoked, about $0.0002 per session on Opus 5.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.

Related

instrument-logs compared with skills from other repositories

instrument-logs next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
instrument-logsPostHog/skillsSkill81todayMITA46Claude Code, Codex
mem0-oss-to-platformmem0ai/mem0Skill70k3d agoApache-2.0A217Claude Code, Codex
tao-run-inference-serviceNVIDIA/skillsSkill4.2ktodayApache-2.0A92Claude Code
azure-mgmt-botservice-dotnetmicrosoft/skillsSkill3.3ktodayMITA78Claude Code
fastapi-router-pymicrosoft/skillsSkill3.3ktodayMITA46Claude Code
api-designericrisco/rsc-harnessSkill6915d agoMITA105Claude Code, Codex
migrate-segw-to-raparc-mcp/arc-1Skill275todayMITA106Claude Code