The challenge: Building the world's fastest law firm
Crosby is the first AI law firm. Not just a legal software vendor, Crosby carries malpractice insurance, provides end-to-end service and owns its outcomes. AI agents and barred attorneys work together to redline commercial contracts, driving rapid turnaround times at big law quality. Clients can send requests straight from Slack.
Both tech startup and law firm, in 18 months Crosby has grown to be a 100-person team with more than 60 licensed attorneys on staff.
"We want to take the world's fastest law firm, which we think we've built, and make the world's fastest lawyers," explains Anthony Corletti, the founding engineer on Crosby's infrastructure team. "Agents give them the right context at the right time, so they can focus on legal judgment instead of mechanical work."
That ambition puts heavy demands on Crosby's engineering team. Every new agent means LLM spend, evals and maintenance, so Crosby needs hard evidence about where lawyers lose time before it builds anything. And early-stage engineers don't have a week to spare on plumbing.
Anthony had felt that pain before, at Capital One and across a decade at early-stage startups. "I've had to stand up an API service and hook up Prometheus, Grafana, Alertmanager and all the rest," he says. "Then build a Grafana dashboard and store it somewhere so it's versioned and nobody on the team breaks it."
The usual result is a pile of disconnected tools. Frontend monitoring sits in one place, LLM spend in another, backend errors in a third. Each tool keeps its own data, so no single query can follow a user problem from the browser to the database. "With New Relic and Datadog, usually engineers are the only people in the systems," Anthony notes. "It's a black box for everyone else."
The solution: Logging in minutes, one place for everything
Crosby adopted Logfire almost from day one. For a FastAPI shop built on Pydantic and a heavy Pydantic AI user, observability from the team behind both was the obvious choice.
Especially for early team members, momentum and maintaining speed were priorities.
"You want your logging done in minutes," says Anthony. Logfire's integrations auto-instrument FastAPI, OpenAI and Anthropic, so costs and traces appear without extra work.
Today, most of the team rarely opens the Logfire UI. They work in Claude Code or Codex and query production through the Logfire MCP server. That makes consolidation matter even more.
"We tried a bunch of observability tools, and it's better to consolidate. Your agent won't have to jump across MCPs and pull things from different places. From paint time in the browser all the way down to your database, you want one thing looking at that whole stack for you."
— Anthony Corletti, Founding Engineer at Crosby
Logfire was Crosby's hub even before it had session replay of its own. The team wrote each session replay ID from a separate frontend tool into the span at the end of the matching FastAPI request, so asking Claude about a user problem returned the replay links straight from Logfire. "We could still create this one pane of glass for observability," Anthony says.
Error alerts had the same gap. When an alert fired in Sentry, the team could only see the application code around it. "I'd take that trace to Logfire, look at that time frame, filter on is_exception, and there's the full log," says Anthony. "Same interface, just a query away." With error tracking and SQL alerts built into Logfire, the alert can fire where the full log already lives, with no second tool to start from.
Logfire also keeps alert fatigue in check. "Logfire doesn't leave me feeling like there's a massive backlog of issues," says Anthony. "I can see what needs addressing in the moment, and I can ask Logfire if there's anything else about my system I should look at."
And going from a question to a shared, durable dashboard no longer needs a separate project. "It's so easy to go from idea to question to dashboard with Logfire," he says. "All those problems are just gone."
New work comes instrumented by default. Anyone extending the API in Crosby's core monorepo gets traces out of the box, and the team also uses Logfire's Kubernetes observability. "It's already there, it's already working," Anthony says. "I don't have to re-instrument telemetry for my new feature."
How Devin triages production incidents with the Logfire MCP server
Crosby pushes the boundaries of agentic software development. Anyone at the firm can mention Devin in a Slack channel and it starts building, with engineers reviewing every change. Logfire makes the team comfortable doing that.
"It really is a sea change. Doing SRE work with Logfire feels like sci-fi."
— Anthony Corletti, Founding Engineer at Crosby
The difference is data. A coding agent that only sees the code, or a test environment, is guessing about what happens in production. Connect the Logfire MCP, and it can trace the real code path with real spans.
Anthony estimates that the quality of Devin's production triage at least doubled with that access. "If Devin is trying to triage something in production, it doesn't have the data," he says. "Logfire makes it super easy: connect the MCP, and now it sees it." Logfire stores everything as OpenTelemetry data, so the agent works with standard, well-documented semantic conventions and can follow one request across services by trace ID. That holds for any OpenTelemetry-instrumented stack, with or without Pydantic AI.
When Devin proposes a fix, engineers jump into the same traces to check it. "It looks like this will fix the bug, and we can see what the spans and traces are saying," Anthony explains. "That gives us a lot of peace of mind." Devin now handles triage and on-call work as well as pre-release checks.
Crosby checks CI health the same way, without digging through the GitHub Actions UI. Devin sends a daily report built on Logfire metrics, and Anthony runs a weekly diagnostic. Devin proactively sweeps for flaky tests every couple of days, with a prompt like this:
"Take a look at the CI runs over the past three days. How many flaky tests have there been? Build up a PR for them."
— Anthony Corletti, Founding Engineer at Crosby
"All that data comes from Logfire," Anthony says.
"When crazy things happen, Logfire is the first thing we want to lean on."
— Anthony Corletti, Founding Engineer at Crosby
Per-agent LLM cost tracking in about an hour
Crosby's ops team needs to know where every token goes. Token counts come with Pydantic AI, OpenAI and Anthropic traces by default, so Logfire already holds the LLM spend, and attributing it to a specific agent takes a few lines of code. "I don't have to change resources in AWS to say where a cost center is," says Anthony. "I just label it in the log."
From there, the per-agent figures flow into the ops team's data warehouse without a hand-built pipeline. "In the past it would be: now I have to write an ETL script, and that's more maintenance and more upkeep," Anthony says. "Now I don't have to care about that at all."
The team checks the totals against usage data from the Anthropic and OpenAI admin APIs to confirm every cost reconciles.
Anthony puts the build time for the whole system at about an hour.
Beyond engineering: Ops, product and legal engineers
At Crosby, engineering, product, ops and the firm's legal engineers all use Logfire. Legal engineers work between lawyers and product to shape how agents should behave.
Adoption is wide because most people get value without ever logging in. "Even if someone's not opening the Logfire UI every day, they're getting value from it through the MCP and Devin," says Anthony.
Next up: Session replay for the lawyers' own tools
Logfire now records session replays itself, linked to the same traces, so the replay-ID workaround and the extra tool behind it can go. Crosby's clients work in Slack, but its lawyers review contracts in internal web tools built around the firm's agentic redlining harness. That's where Crosby now wants to find the mechanical, repetitive work worth automating, and where Logfire's frontend observability and session replay come in.
"Logfire is going to give us insight into where people are feeling slowdowns in the UI, where we haven't had that before," says Anthony. Because it all lives alongside backend traces and LLM spend, the team can still drive it from Claude or Codex. "Automatic dashboards for session replay, and where users are feeling pain? That's just a couple of prompts away."
The results: One observability layer for engineers, ops and agents
Crosby's results with Pydantic Logfire:
- Roughly 2x better AI-led triage: Crosby estimates the quality of Devin's production triage at least doubled once the agent could read real traces through the Pydantic Logfire MCP server.
- LLM cost allocation in about an hour: Crosby attributes LLM spend to individual agents in Logfire and feeds it to the ops team's data warehouse, with no ETL scripts to maintain.
- One pane of glass: Crosby queries backend traces, LLM spend, CI health, Kubernetes metrics and frontend sessions in one place with SQL.
- Logging in minutes: Logfire auto-instruments Crosby's FastAPI, Pydantic AI, OpenAI and Anthropic calls, so the team skipped week-long observability setup projects.
- New features instrumented by default: Crosby engineers who extend the core API get telemetry out of the box, with nothing to re-instrument.
- Adoption beyond engineering: Crosby's ops, product and legal engineering teams all use Logfire, mostly through the MCP server.
Want your coding agents to debug production with real data? Get started with Pydantic Logfire.
Need Logfire running in your own environment? Talk to us about Logfire Enterprise and self-hosting.
Frequently Asked Questions
1. Can Pydantic Logfire track LLM costs per agent?
Yes. Logfire captures token usage from Pydantic AI, OpenAI and Anthropic traces automatically. Crosby attributes spend to individual agents with a few lines of code and built its full cost-allocation view in about an hour.
2. How do coding agents like Devin or Claude Code use Pydantic Logfire?
Through the Logfire MCP server, agents query production traces, logs and metrics directly. Crosby uses this for incident triage, on-call support and daily CI reports, and estimates triage quality at least doubled.
3. Does Pydantic Logfire require Pydantic AI?
No. Logfire is built on OpenTelemetry and accepts traces, logs and metrics from any OpenTelemetry-instrumented stack. Crosby sends FastAPI, Pydantic AI, OpenAI, Anthropic and Kubernetes telemetry to Logfire.
4. What is the Pydantic Logfire MCP server?
The Logfire MCP server lets coding agents such as Claude Code, Codex, Cursor and Devin run SQL queries against your traces, logs and metrics. Crosby's engineers and ops team use it to ask production questions without opening the Logfire UI.
5. Can Pydantic Logfire be self-hosted?
Yes. Logfire Enterprise supports self-hosted deployment for teams that need telemetry in their own environment.