awesome cli.

Monitoring & incidents

Tailpipe for coding agents

External logs collected into a local analytical store and queried with SQL.

Open the official project ↗

This article follows the official documentation. We haven’t tested this tool for a hands-on review.

A coding agent investigating production logs can use Tailpipe to collect external log data into a local store for analysis, then query the collected tables with SQL. SQL is a language for selecting, filtering, and summarizing data. For example, an agent investigating a failing endpoint could search a log table for recent errors.

Tailpipe’s documentation explains how to collect logs and query them with SQL. It also describes a separate Tailpipe MCP server, which lets an AI assistant query the collected data. MCP, the Model Context Protocol, is a way for an AI tool to call tools exposed by another program. The docs do not describe a way to collect agent transcripts. An agent can use Tailpipe to analyze logs, but not to monitor its own activity. This article covers the command-line tool. Start with Tailpipe’s documentation for installation and setup instructions for your log source.

Set up Tailpipe

The Learn Tailpipe guide gives one install command for macOS and one for Linux:

# macOS
brew install turbot/tap/tailpipe

# Linux
sudo /bin/sh -c "$(curl -fsSL https://tailpipe.io/install/tailpipe.sh)"

Tailpipe reads logs through plugins. Each plugin adds the tables and sources for one platform. The guide uses the AWS plugin, which you install with tailpipe plugin install aws. You describe what to collect in configuration files with the .tpc extension in ~/.tailpipe/config. A connection block holds the credentials for the source, and a partition block says which source feeds which table. Tailpipe’s collection command depends on that source, so follow the relevant source or plugin instructions rather than assuming one universal login command.

Store credentials locally using the method your provider supports. The guide’s AWS example points the connection at an AWS profile, so the key itself stays in the AWS configuration. Do not put keys or tokens in the agent prompt or shell command. The agent needs permission to run the Tailpipe commands for the investigation and read the resulting logs. Give its credentials access only to the log source it needs.

Collection reads data from the external source and stores it in Tailpipe’s local analytical store. SQL queries inspect that local data. The collection reference documents the command syntax and its time-range options.

Collect and query a time range

A first collection run covers the last seven days by default. Use --from and --to to choose a different range, for example --from T-45d for the last 45 days. Later collection runs resume chronologically from the previous collection by default. Tailpipe keeps data it has already collected for a time range. It collects that range again only when you add --overwrite.

For example, replace the placeholders below with a table supported by your configured source and the desired time range:

tailpipe collect <table> --from <start-time> --to <end-time>

This command contacts the external source and adds log data from the specified time range to the local store. Replace the placeholders with the table name and time values you want to use in the shell.

Before the agent writes a query, it can look up the details of the table, which include its columns:

tailpipe table show <table> --output json

Then query the collected table:

tailpipe query "SELECT * FROM <table> LIMIT 10" --output json

Replace <table> with the same table name. LIMIT 10 keeps the result small. The query reference documents --output json next to CSV output. Without the flag, Tailpipe prints a table for people to read. Tailpipe’s SQL documentation also explains how to filter, sort, and group results. It covers aggregate functions such as count, min, and max.

An agent investigating a burst of errors could narrow the query to a time column and an error field, if the selected table provides those columns. Check the table’s schema before using column names: field names depend on the data source. Limiting the query to relevant rows helps the agent inspect them without returning the entire log table.

What the agent can and cannot inspect

Tailpipe is useful when logs already exist in a supported external source and the agent needs to search or summarize them locally. Its documented features do not include automatic collection of what coding agents such as Claude Code or Codex do. Use Tailpipe to investigate what a service logged during an incident. To audit an agent’s own actions, choose a tool that explicitly captures those events.

Log rows can contain credentials, personal data, or other sensitive values. Keep queries focused, and avoid pasting full results into an agent conversation when a small filtered sample or aggregate answers the question. The local store also holds collected data, so consider who and what can read it on the machine.

A realistic prompt for a coding agent is:

Use Tailpipe to inspect the configured service log table for errors in the specified time range. Check the table columns first with tailpipe table show, run a bounded SQL query with --output json, and report the error count and a few representative messages. Do not change the service or its log source.

Tailpipe collects logs and lets the agent analyze them with SQL. The agent can use these read operations to gather evidence, but deciding how to respond to the incident is a separate step. Developers looking for more shell tools for coding agents can browse the directory.

Tool details come from awesome-ai-cli.