Prompt Examples for Common Use Cases

The Tideways CLI gives AI coding agents such as Claude Code or OpenAI Codex access to the performance data Tideways collects for your PHP application. Instead of guessing from the source code alone, the agent reads traces, metrics, errors, and slow SQL queries, identifies the responsible code in your repository, and proposes a fix.

This is a great opportunity to identify which parts of your application are slow, get suggestions on what could perform better, and receive code fixes to address them, all without having to manually dive deep into timelines, flame graphs, or performance metrics.

Install tideways-cli

The tool is currently supported on both Linux and macOS.

To keep simplicity, this tutorial will setup Tideways CLI from the scratch, using the interactive mode. Tideways CLI also supports non-interactive. For more information, check full setup guide.

apt-get install tideways-cli
dnf install tideways-cli
brew install tideways-cli

Create a Token and tideways init

Open Commandline and click on Create User Token.

Commandline Page

Enter the token name and mark Include Full Read Access to All Data checkbox.

Create Token Page

You will get the token.

Token Information

Run the tideways init command on your project’s root directory, then follow the instructions, adapting them to your preferred coding agent.

$ tideways init --api-token <your token here>

Tideways CLI Setup

  ✓  Imported settings for Tideways Profiler CLI.
  ✓  Full read access is enabled for this CLI token.

SELECT A TIDEWAYS PROJECT FOR THIS REPOSITORY
  1. agency-hello-world/magento2
  2. company-foo-bar/shopware6
  3. partner-lorem-ipsum/laravel
Enter project number: 1

  ✓  Saved Tideways project agency-hello-world/magento2 to /app/.tideways.json

TIDEWAYS SKILL
Install Tideways SKILL.md in your repository, choose a location:
  1. ".claude/" (Claude)
  2. ".agents/" (Codex, OpenCode, CoPilot, Gemini)
  3. Both
  4. Skip
Enter option number: 1

  ✓  Installed Tideways AI agent files
        - .claude/skills/tideways/SKILL.md

SETUP COMPLETE
  To start profiling use `tideways run curl $url` or `tideways run php $file`

  See `tideways help` for the full list of options

Testing prompt

Run the following prompt on your agent, for testing, to make sure everything works:

Give me a high-level summary of the performance of this project in Tideways.

How It Works

The CLI comes with a SKILL.md: instructions that tell the agent which tideways commands answer which question. Inspecting issues is read-only. Depending on your prompt, the agent follows one of three workflows:

  • Profile a request: trigger a new trace for a URL or PHP script with tideways run and analyze its bottlenecks.

  • Inspect monitoring data: read response times, failure rates, observations, incidents and releases of your services and transactions.

  • Investigate issues: read errors, warnings, deprecations and slow SQL queries together with their stack traces.

Prompts

Here are some example prompts for interacting with a coding agent.

Performance Summary

Analyze performance of page <url>

Slow Queries

Find and fix slow database queries

Startup Time

Recommendations for reducing PHP application startup time

Speed up CPU-intensive functions

Tips to speed up CPU-intensive PHP functions

Memory Usage

Profile php bin/console app:import using Tideways to optimize PHP memory usage

Tips for Good Results

  • Name the service, environment and time window. The agent looks at the last 60 minutes by default and can go back up to 24 hours.

  • Ask for evidence. A good answer names the trace, transaction or stack frame it is based on, so you can check it in Tideways.

  • Start with one transaction or issue. Narrow prompts lead to smaller changes that are easier to review.

  • Prioritize by impact. Ask the agent to identify the biggest bottleneck by latency, execution frequency, or total time consumed, rather than simply listing slow operations.

Still need help? Email [email protected]