Logfire Coding Agents
PydanticOfficialPublished by Pydantic
- Skill
- Tool integration
- Agent tooling
- MIT
- No issues found
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
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/pydantic/logfire-coding-agents/downloadUnzip 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
- ATTRIBUTION.mdAdded by AutoGineer859 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md2.8 KiB
- references/application-gateway.md1.6 KiB
- references/connection.md3.8 KiB
- references/gateway.md4.5 KiB
- references/telemetry.md4.8 KiB
references/telemetry.md
Coding-session Telemetry
Confirm the destination and capture policy before enabling recording. Settings are user-level: sessions in other repositories can also send to this project. Disabling the Logfire MCP/skills plugin does not stop native telemetry.
All examples use a synthetic absolute data directory. Replace it with the
confirmed credential directory from the handoff or connection guide; keep it
on configuration, status, and removal commands rather than falling back to
another application's .logfire directory. Preserve target and organization.
Claude Code
logfire-cli --org acme --beta --no-input --output json agent claude --data-dir /absolute/project-data configure --capture metadata-only
logfire-cli --org acme --beta --no-input --output json agent claude --data-dir /absolute/project-data statusUse --capture full only when the user chooses content capture. Full includes
messages, supported tool inputs/outputs, and raw model API bodies, which can
contain conversation history, source code, and secrets. Metadata-only retains
native traces, timing, and usage without message/tool content. Full is the CLI
default, so specify the chosen policy explicitly.
Claude exports logs, metrics, and beta traces natively. The CLI installs an
otelHeadersHelper pointing to the connected SDK credential; it does not add
transcript hooks or put the token in Claude settings. Keep the credential file
and executable available at their configured paths. Both telemetry and Gateway
honor CLAUDE_CONFIG_DIR; do not retarget a different Claude installation.
Native tool-output capture requires Claude Code 2.1.283 or later; not every
tool or failed call produces output, and thinking remains redacted. Detailed
beta tracing is separate and is not enabled. An older configuration can report
needs_update; reconfiguration enables the expanded capture policy, so obtain
the user's capture choice rather than silently upgrading it.
Restart Claude after configuration. If effective settings differ, check its
/status and the CLI status. Independent exporters or higher-priority settings
can conflict; report the conflict instead of rewriting them by hand.
Codex
logfire-cli --org acme --beta --no-input --output json agent codex --data-dir /absolute/project-data configure --capture metadata-only
logfire-cli --org acme --beta --no-input --output json agent codex --data-dir /absolute/project-data statusChoose one explicit policy:
| Policy | Content |
|---|---|
full | Native traces and logs with prompts, tool arguments, bounded tool-result previews, account email and host name; enrichment adds final assistant responses |
no-tool-content | Native traces with prompt and final-response enrichment, without native logs or tool content |
metadata-only | Timing and usage metadata without message/tool content |
The CLI configures native export plus its pinned logfire-exporter enrichment
plugin for fields native telemetry lacks. Do not install a duplicate transcript
exporter. Codex metrics are not redirected to Logfire. Static OTLP headers put
the write token in Codex configuration and the exporter credential file; treat
both as secrets, and do not print or commit them.
Restart Codex and review new hooks with /hooks if prompted. Configuration
refuses an independent exporter. A failed operation can leave the plugin
installed or a newly created token behind; follow the reported recovery action
instead of claiming the operation rolled back.
Verify delivery, not just configuration
After restart, send one harmless prompt and record its time. With read-capable MCP or CLI access, check fresh telemetry for that agent in the exact destination project, matching the session identity when available. Old or unrelated data is not delivery proof. A local status check does not prove token validity or ingestion. If read access or session correlation is unavailable, report delivery as unverified; never use a send-only SDK token for reads.
Stop recording
For Claude, preview removal before confirming it:
logfire-cli --beta --no-input --output json agent claude --data-dir /absolute/project-data remove --dry-run
logfire-cli --beta --no-input --output json agent claude --data-dir /absolute/project-data remove --yesFor Codex, remove its managed export settings and enrichment plugin:
logfire-cli --beta --no-input --yes --output json agent codex --data-dir /absolute/project-data removeRecheck the selected agent's status and restart it. Removal leaves Gateway and
MCP separate and does not revoke remote write tokens. Codex retains the local
exporter credential unless --delete-config is explicitly requested. Claude
retains its SDK credential and helper runtime. Do not delete files still used
by an active helper or bypass ownership conflicts with manual settings edits.
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