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://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/gateway.md

Gateway Routing for Coding Agents

Gateway routes model requests; telemetry observes activity. A Gateway key is not a telemetry write token, and neither authenticates the MCP client. Explain that inference uses the selected organization's Gateway balance and may incur model charges. Do not change the user's provider or model merely because they asked to record sessions.

Persistent connection

For continued use, configure the explicitly selected agent:

logfire-cli --org acme --beta --no-input --output json agent gateway --agent claude
logfire-cli --org acme --beta --no-input --output json agent gateway --agent codex

Run only the requested agent's command. The CLI creates or revalidates a project-bound Gateway key in the OS credential store. Agent settings contain the Gateway URL and a credential-helper command, not the key. Use a persistent CLI executable path because the helper must remain available after setup. Repeated setup reuses the bound active key; do not mint another with api-key as a workaround. Surface conflicting settings or missing permissions.

Codex uses a dedicated profile, launched with codex --profile logfire. Claude uses its base URL and apiKeyHelper settings; restart it after setup. Gateway setup and removal preserve independently configured telemetry.

logfire-cli --org acme --beta --no-input --output json agent gateway status --agent claude
logfire-cli --org acme --beta --no-input --output json agent gateway status --agent codex

Status checks configuration, not live key validity or inference. In particular, credential: not_checked is not successful credential verification.

Temporary connection

Use a temporary proxy when the user wants a one-session trial rather than persistent provider settings. Launch only when the user intends to start that agent; otherwise provide the command for their terminal, not a nested session.

logfire-cli --org acme --beta agent proxy launch claude
logfire-cli --org acme --beta agent proxy launch codex
logfire-cli --org acme --beta agent proxy launch copilot --model gpt-5.4

The proxy uses the selected project's organization-bound browser OAuth session, not a headless API key. It exchanges that grant for a short-lived Gateway token; the child receives only a local temporary credential. Copilot requires an explicit model. Do not claim temporary support for Cursor or Antigravity. Claude's --settings option is reserved for the temporary provider override. When the agent exits, the proxy stops without changing persistent telemetry.

For other supported clients, agent proxy serve provides a local base_url and temporary secret token. Capture that output privately; do not paste it in chat. The root URL is not an inference endpoint: OpenAI/Codex uses /proxy/openai, Anthropic/Claude uses /proxy/anthropic. Do not append /v1 to the OpenAI base URL; the configured upstream already supplies its API version. To repair older persistent Codex routes, rerun the Gateway setup command, which revalidates and reuses the existing key.

Hosted US/EU targets select their Gateway automatically. Self-hosted targets need a confirmed --gateway-url using HTTPS or loopback HTTP. Do not derive a Gateway resource from an arbitrary platform hostname.

Verify and recover

Run one harmless model request through the chosen configuration when authorized. A working settings file or status result is not proof that inference used Gateway. Check the response and fresh Gateway activity in the exact project when read access is available. Report inference and Logfire-side observation separately. Do not count an existing session still using its original provider.

The temporary proxy does not replay model requests. Expired/rejected OAuth requires signing in for the same organization and restarting the proxy; do not retry model calls in a loop or select another project. Report provider billing, activation, and permission failures as prerequisites, not successful setup.

Remove persistent routing

Preview the selected agent's changes, then remove after confirmation:

logfire-cli --org acme --beta --no-input --output json agent gateway remove --agent claude --dry-run
logfire-cli --org acme --beta --no-input --output json agent gateway remove --agent claude --yes

Use --agent codex for Codex. Removal preserves unrelated settings, telemetry, and the stored Gateway key. It is not key revocation. Recheck status and restart the agent; report an ownership conflict rather than deleting settings manually.

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 or Pydantic.

Download ZIP

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