npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

code-tool-langfuse

v0.1.7

Published

Use npm scripts to configure Claude Code / OpenCode / Codex with Langfuse tracing.

Readme

code-tool-langfuse

Polished interactive terminal UI for configuring Langfuse tracing for Claude Code, OpenCode, and Codex.

Usage

Run locally from this project:

node bin/cli.js

After publishing to npm:

npx code-tool-langfuse

Commands

code-tool-langfuse
code-tool-langfuse setup
code-tool-langfuse setup claude
code-tool-langfuse setup opencode
code-tool-langfuse setup codex
code-tool-langfuse check
code-tool-langfuse check environment
code-tool-langfuse check claude
code-tool-langfuse check opencode
code-tool-langfuse check codex

The interactive UI supports arrow-key navigation in terminals that support raw input. Use Up / Down to move, number keys for quick selection, Enter to select, and q or Esc to exit. In multi-select setup screens, use Space to toggle targets and Enter to continue. It uses a soft color palette and falls back to plain numeric prompts when raw terminal input is unavailable.

Setup Langfuse supports selecting one or more setup targets:

  • Claude Code Langfuse
  • OpenCode Langfuse
  • Codex Langfuse

During setup, the only required input is User ID, which should be your employee number, for example h00613222. Other setup values use the built-in defaults.

Before setup, the CLI checks required local tools and prints install hints when something is missing:

  • Node.js / npm
  • Python / pip for Claude Code setup
  • Python / pip for Codex setup
  • OpenCode CLI for OpenCode setup

Python package installation uses pip's default package index by default. If you need a custom PyPI mirror, set CODE_TOOL_PIP_INDEX_URL or pass --pipIndexUrl=....

Use dry-run mode to preview the script calls without modifying files, installing packages, or writing environment variables:

code-tool-langfuse setup --dry-run

What It Configures

For Claude Code Langfuse setup, the CLI installs langfuse_hook.py, creates ~/.claude/langfuse-venv, installs langfuse into that virtual environment, updates ~/.claude/settings.json, and configures the hook environment. On Ubuntu/Debian, install python3-venv first if the setup reports that venv support is missing.

For OpenCode Langfuse setup, the CLI installs and patches opencode-plugin-langfuse, updates ~/.config/opencode/opencode.json, and can write LANGFUSE_* values to the user environment.

For Codex Langfuse setup, the CLI installs codex_langfuse_notify.py, creates ~/.codex/langfuse-venv, installs langfuse into that virtual environment, writes Langfuse credentials to ~/.codex/langfuse/config.json, and updates the top-level notify command in ~/.codex/config.toml. Restart Codex after setup so the notify command is loaded.

The Codex integration is implemented as a notify-hook exporter. On each notify event it incrementally reads the matching ~/.codex/sessions/**/*.jsonl file, converts new user/assistant/tool/token events into Langfuse observations, and then saves its offset in ~/.codex/langfuse/state.json. If Codex does not provide a session path in the notify payload, the exporter falls back to the latest session JSONL file.

Notes

  • Langfuse Base URL, Public Key, and Secret Key have built-in defaults for this internal setup. You can override them with LANGFUSE_BASEURL, LANGFUSE_PUBLIC_KEY, and LANGFUSE_SECRET_KEY.
  • The default secret key is not printed in the terminal UI.
  • The CLI calls the Node setup/check scripts directly, so it avoids PowerShell npm.ps1 execution-policy failures.
  • The Python hook reads userId from hook payload first, then from configured environment variables.
  • The Codex hook fails open: tracing errors are logged to ~/.codex/langfuse/codex_langfuse_notify.log and do not block Codex.