Generated banner for Logfire Coding Agents
Generated logo for Logfire Coding Agents

Logfire Coding Agents

PydanticOfficialPublished by Pydantic

  • Skill
  • Tool integration
  • Agent tooling
  • MIT
  • No issues found

From the author

Connect Claude Code or Codex itself to Logfire telemetry, or route a coding agent's model requests through Pydantic AI Gateway. Use for coding-session recording, capture policies, Gateway agent configuration, temporary proxy launches, status, or removal. Not for instrumenting an application or routing an application's model client.
— the description by Pydantic

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to integrating coding agents like Claude Code or Codex with Logfire services. It enables users to record agent activity via telemetry, route model inference requests through the Pydantic AI Gateway, or configure MCP for agent-based data querying. The skill emphasizes using a consistent CLI executable and preserving existing project configurations to ensure secure and reliable integration without redundant authentication or setup.

What it does

  • Records coding agent activity using Logfire telemetry.
  • Routes agent model requests through the Pydantic AI Gateway.
  • Configures MCP to allow agents to query Logfire data.
  • Manages agent-specific capture policies and proxy configurations.
  • Verifies connection status and handles agent configuration removal.
  • Maintains existing project and organization credentials for consistency.

When to use it

  • When you need to monitor or record the activity of a coding agent.
  • When you want to route agent inference requests through a paid Gateway.
  • When an agent needs to query Logfire data via MCP.
  • When setting up a new coding session that requires specific telemetry or routing policies.

Advantages

  • Centralizes agent activity monitoring and inference routing.
  • Ensures secure credential handling by leveraging existing CLI sessions.
  • Prevents redundant authentication by distinguishing between telemetry, Gateway, and MCP needs.
  • Provides a clear, repeatable workflow for agent configuration.

Usage examples

“Connect my Claude Code session to Logfire for telemetry.”
The agent will use the logfire-cli to enable telemetry recording for the current project, ensuring agent activity is captured in the specified organization.
“Route my coding agent's requests through the Pydantic AI Gateway.”
The agent will configure the necessary proxy settings to route inference requests through the organization's paid Gateway access.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/pydantic/logfire-coding-agents/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip logfire-coding-agents.zip -d .agents/skills

Documentation by Pydantic

Connect Coding Agents to Logfire

Use the exact Rust CLI executable supplied by the handoff for every operation; examples call it logfire-cli. Preserve its region, organization, project, and data directory. Do not replace it with a package launcher or install a second exporter by hand. These commands require --beta.

Without a prepared handoff, follow native CLI connection. The same skill is distributed in the Logfire plugin; plugin installation alone does not supply a CLI session, project credential, or capture consent.

Distinguish three independent capabilities:

  • Telemetry: record the coding agent's activity in the selected project.

  • Gateway: route the agent's model requests through the organization's paid Gateway access. This does not enable telemetry.

  • MCP: let the agent query Logfire. MCP OAuth is owned by the agent's MCP client; CLI login or telemetry setup does not authenticate that client.

Honor the user's stated goal and agent. Ask only for missing choices; do not enable all three because the user asked to connect one. For application code, use instrumentation or the application Gateway skill instead.

Confirm the destination

A prepared handoff already selected the origin, organization, project, and local SDK credential: reuse those without repeating account commands or creating another write token. Otherwise follow the shared connection reference. Do not guess another project when access fails.

Keep account credentials out of prompts, logs, and child environments. Leave credential storage and settings writes to the CLI. If a saved helper will invoke this executable later, use a persistent installed path, not a temporary build or cache directory.

Choose the requested workflow

  • To observe Claude Code or Codex, read session telemetry.

  • To route coding-agent inference, read Gateway routing.

  • For both, configure telemetry first, then Gateway. Preserve each integration's destination and settings independently.

Do not launch another setup agent or a nested interactive coding session just to configure this one. Explain any required restart. Finish with the configured agent, destination, capture or routing choice, observed verification result, and one next action. Configuration is not proof of ingestion or inference.

Files

references/connection.md

Connect the Native CLI

Use this reference when a plugin or standalone skill was invoked without a prepared CLI handoff. A CLI-launched skill already has its executable and destination: preserve those and do not repeat setup.

Choose the executable

Prefer an explicit executable from LOGFIRE_SETUP_CLI or the user's handoff. Otherwise locate a trusted installed logfire-cli and inspect its version:

logfire-cli --output json version

Native npm installations and Python logfire version 6 or later can instead provide logfire. Accept that trusted installed executable only when its --output json version response has envelope version 1 and native CLI data.installed metadata. A legacy SDK command is not interchangeable. Require native CLI version 0.1.14 or later for coding-agent capture and Gateway setup. Do not execute an untrusted repository-local binary. If unavailable, offer installation rather than silently adding dependencies to the application. For a settings helper that will run in future sessions, use a persistent install (such as uv tool install logfire-cli), not a temporary package-runner cache path. Use the resolved absolute executable for subsequent commands.

Confirm account and project

Confirm the region/origin, organization, and project before sending credentials or making changes. Cloud uses --region us or --region eu; a self-hosted instance requires its confirmed --base-url. Preserve that selection on every command. Replace the synthetic names in these examples. When selecting a cloud region, omit LOGFIRE_BASE_URL from CLI child processes so an ambient base URL cannot override the confirmed destination.

logfire-cli --region us --org acme --no-input --output json auth status
logfire-cli --region us --org acme --no-input --output json mcp context

auth status reports local profile metadata; mcp context checks live identity. If login is required, explain the browser approval and run auth against the same target and organization. Do not request account keys in chat, read the OS credential store directly, or silently switch to another account on failure. For browser OAuth, omit ambient LOGFIRE_API_KEY, LOGFIRE_TOKEN, and LOGFIRE_MCP_TOKEN from CLI child processes without printing their values or changing the parent environment. Preserve explicitly requested headless access.

For session recording or creating a Gateway key, inspect project current with the chosen --data-dir and reuse a verified matching SDK credential. Only if missing, create one with the following command, replacing the region, organization, project name, and data directory with the confirmed destination:

logfire-cli --region us --org acme --no-input --output json init use --name my-app --permission send --data-dir /absolute/project-data

For self-hosted instances, replace --region us with the confirmed --base-url. That creates a write token: do not repeat it after a network/authentication error or create another token on each reconnect. Keep helper credentials outside the plugin cache and separate from an unrelated application's .logfire directory.

Frontend setup does not require an ordinary SDK write token. Gateway key creation currently resolves the project from its SDK credential file, so account-only access is insufficient for that CLI workflow. An existing application Gateway key does not require this initialization.

MCP remains independent

The agent's native MCP connection has its own OAuth session; CLI authentication does not authenticate it. Existing native MCP can verify delivery without a second CLI login. Use the plugin's /logfire:connect when available for Claude session setup, and do not configure a second exporter or duplicate MCP server. Do not install or authenticate the CLI merely to query data through working MCP.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Pydantic
Publisher
Pydantic (Official)
Source
pydantic/skills · skills/logfire-coding-agents · commit 98f591c
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced
Also distributed in
pydantic/skills

AutoGineer is not affiliated with or endorsed by Pydantic.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download logfire-coding-agents.zip