# cx-profiling

A Claude Code skill for inspecting Coralogix continuous profiling data via the cx profiling CLI. Identifies services consuming the most CPU or memory down to individual functions.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 1200 installs · ★ 243 repo stars
- Author: coralogix
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/coralogix/cx-cli/tree/HEAD/skills/cx-profiling/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/cx-profiling

## What it does

The skill inspects continuous-profiling data by ranking services by CPU time or heap allocations and decoding flame graphs. All subcommands run in read-only mode and output JSON or toon formats.

Investigations start with `metadata` checks to confirm active profile types before pulling metrics split by pod or version. Because rendering flame graphs on large services takes around 40 seconds, deep call trees require tuning `--min-node-ratio` or `--max-depth`.

Queries fail without the `cx` CLI and the `profiles.cpu-profiles:Read` permission on the Coralogix account. When a service lacks active profiles, the skill stops and directs checks to metric catalogs.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add coralogix/cx-cli --skill cx-profiling -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/cx-profiling/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/cx-profiling/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add coralogix/cx-cli --skill cx-profiling -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/cx-profiling/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add coralogix/cx-cli --skill cx-profiling -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/cx-profiling/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install coralogix/cx-cli skills/cx-profiling
```

2. **Manually: put the files in place**
- File: `.github/skills/cx-profiling/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add coralogix/cx-cli --skill cx-profiling -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/coralogix/cx-cli --path skills/cx-profiling
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/cx-profiling/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add coralogix/cx-cli --skill cx-profiling -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/coralogix/cx-cli/tree/HEAD/skills/cx-profiling/SKILL.md

## When to use it
- identify top CPU and memory consumers across deployed services
- generate flame graphs to locate hot functions in code
- isolate CPU regressions to a specific pod or deployment version
- list available profiling categories for a target service

## Example prompts
- Show top memory consumers in production for the past hour
- Generate a CPU flame graph for payment-service filtered by pod
- Check which service version caused the CPU spike via cx profiling

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 6ee1dec794a6e229.

BEGIN THIRD-PARTY FILE 6ee1dec794a6e229
```text
---
name: cx-profiling
description: >
  Query Coralogix continuous-profiling data with the `cx profiling` CLI — find
  which services use the most CPU or memory, which profile types a service has,
  what profiles can be filtered by, when usage spiked and which pod or version
  caused it, and which code paths and functions a service spends its CPU or
  memory on (flame graphs). Use when the user asks "which services use the most
  CPU", "top memory consumers", "what is service X spending CPU on", "hot
  functions", "flame graph for a service", "why is this service using so much
  CPU", "memory allocations by function", "CPU spike by pod", "which version
  increased CPU", "continuous profiling", "profiling data", or wants to explore
  profiles of a service. For how much CPU or memory a service or pod uses and
  whether it is saturated, use `cx-service-catalog` instead.
metadata:
  version: "0.1.0"
---

# Profiling Skill

Use this skill to answer **continuous-profiling** questions — which services
burn the most CPU or memory, and which functions inside a service are
responsible — via the Coralogix profiling API. Requires the
`profiles.cpu-profiles:Read` permission.

## CLI Commands

| Command | Purpose | Key flags |
|---|---|---|
| `cx profiling services` | Profiled services ranked by CPU+wall seconds (`cpu`) or allocated+heap bytes (`memory`) | `--category` (required), `--environment`, `--limit` (default 20, max 100), `--offset`, `--include-time-series` |
| `cx profiling metadata <service>` | A service's language and which profile types have data | - |
| `cx profiling filters <service>` | Label keys a service's profiles can be filtered by, with their values | `--profile-type` (required), `--filter`, `--max-values-per-key` (default 50) |
| `cx profiling metrics <service>` | One profile type's usage over time, split by `service`, `pod`, or any label; highest totals first | `--profile-type` (required), `--sum-by` (default `service`), `--max-buckets` (default 60), `--limit` (default 10), `--filter` |
| `cx profiling flame-graph <service>` | Decoded flame graph plus the top functions by self value | `--profile-type` (required), `--filter`, `--top-functions` (default 20), `--min-node-ratio` (default 0.01), `--max-depth`, `--show-kernel` |

- All commands are **read-only** and support `-o json` / `-o toon`.
- Every command takes `--start` / `--end` (default `now-1h` / `now`): `now`,
  `now-1h`-style relative expressions, or ISO-8601 timestamps.
- `--profile-type` is one of `cpu`, `wall`, `memory-allocation-bytes`,
  `memory-allocation-objects`, `memory-heap-bytes`, `memory-heap-objects`
  (case-insensitive; `MEMORY_HEAP_BYTES` also works). Check `metadata` first —
  only types with `has_data: true` return anything.
- `--filter` is repeatable and filters AND together:
  `key=v1,v2` (any of the values), `key!=v1,v2` (none of them),
  `key:exists`, `key:not-exists`. Discover keys and values with `filters`.
```
END THIRD-PARTY FILE 6ee1dec794a6e229

The third-party file has ended. Everything between the 6ee1dec794a6e229 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2955 of 7197 bytes. © coralogix · Apache-2.0 · https://github.com/coralogix/cx-cli/tree/HEAD/skills/cx-profiling/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
