AI Optimization

Overview

AI optimization lets you use your AI coding agent (Cursor, Claude Code, Codex, or Gemini) to investigate Graphsignal data in natural language. Install a small skill and CLI so the agent can run graphsignal-context signals for a time range and get profiles, errors, and traces. You can then ask the agent to find the root cause of latency spikes, explain failures, or identify bottlenecks—without leaving your IDE or copying data by hand.

Install the Graphsignal skill

The graphsignal-context repo provides a skill so your AI coding agent can fetch Graphsignal signal context for a time range via the graphsignal-context CLI—useful when optimizing inference, profiles, or errors.

Claude Code — Clone the repo into Claude's personal skills directory:

git clone https://github.com/graphsignal/graphsignal-context ~/.claude/skills/graphsignal-context

Other agents (Cursor, Codex, Gemini) — Use the skills.sh registry:

npx skills add graphsignal/graphsignal-context

Install the CLI so the agent can run it: pip install graphsignal-context, then graphsignal-context login with an API key.

Supported agents

  • Cursor — Use the skill when working in Cursor with agent/composer.
  • Claude Code — Use with Claude Code (e.g. via Claude CLI or supported IDEs).
  • Codex — Use with Codex agent workflows.
  • Gemini CLI — Use with Gemini from the command line.

Example workflows

Once the skill is installed, the agent can run graphsignal-context signals for a time range and use the returned signal context (profiles, errors, traces) to help you optimize. Example prompts:

  • Find the root cause of the latency spike — e.g. "Fetch Graphsignal data for the last 2 hours and find the root cause of the latency spike" or "What's causing the slowdown? Use Graphsignal signal context from 10am to noon today."
  • Explain errors or failures — e.g. "Get signal context for the last 24 hours and summarize any errors or failures" or "Why did inference fail around 3pm? Pull Graphsignal data for that window."
  • Inspect profiles and bottlenecks — e.g. "Fetch Graphsignal context for yesterday and identify the main performance bottlenecks" or "Which operations are taking the most time? Use Graphsignal data from the last 6 hours."

The agent will call graphsignal-context signals --start <ISO> --end <ISO> (and optional --tags if you specify deployment or service tags), then analyze the returned signal context to answer your question.