Skip to main content
skill CX Codex

sector-pe-ratios — Claude Code skill: what it does, how to install

Retrieves sector P/E ratios across stock exchanges using Octagon MCP. Helps compare equity valuations against sector baselines.

MIT 260 installs ★ 132 updated 2026-06-05

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add OctagonAI/skills --skill sector-pe-ratios -a claude-code
Open on GitHub

What sector-pe-ratios does

This skill guides your coding assistant to query sector-wide price-to-earnings ratios by date, exchange, and industry. It routes natural language queries through the octagon-mcp server using the octagon-agent tool, backed by the octagon-stock-data-agent source.

You can query exchanges like NYSE, NASDAQ, or AMEX. Without the Octagon MCP server configured in your environment, the agent cannot return valuation numbers. The skill also provides guidance for calculating discount and premium percentages against sector averages.

What it helps with

  • benchmark a company valuation against sector P/E medians
  • compare Technology sector valuations between NYSE and NASDAQ
  • track sector P/E multiples across different trading dates

Example prompts for the agent

  • Retrieve the latest sector P/E ratios for 2025-02-03, filtered by exchange NASDAQ and sector Technology
  • Compare P/E ratios for Technology and Financials sectors on NYSE
  • Check if AAPL trades at a discount compared to the Technology sector P/E

How to install sector-pe-ratios

1Skills CLI (Vercel)

npx skills add OctagonAI/skills --skill sector-pe-ratios -a claude-code

2Manually: put the files in place

~/.claude/skills/sector-pe-ratios/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/sector-pe-ratios/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about sector-pe-ratios

How to install sector-pe-ratios in Claude Code?

Run npx skills add OctagonAI/skills --skill sector-pe-ratios -a claude-code. The definition will be placed into ~/.claude/skills/sector-pe-ratios/SKILL.md.

What does sector-pe-ratios do?

It structures prompts for fetching weighted sector P/E figures and comparing asset multiples to sector benchmarks.

What prerequisite is required to run queries?

Your agent environment must have the octagon-mcp server configured with the octagon-agent tool enabled.

Source text

SKILL.md · MIT
---
name: sector-pe-ratios
description: Retrieve sector P/E ratios using Octagon MCP. Use when comparing company valuations to sector benchmarks, analyzing sector valuations across exchanges, and understanding market-wide valuation trends.
---

# Sector P/E Ratios

Retrieve price-to-earnings ratios by sector and exchange using the Octagon MCP server.

## Prerequisites

Ensure Octagon MCP is configured in your AI agent (Cursor, Claude Desktop, Windsurf, etc.). See [references/mcp-setup.md](references/mcp-setup.md) for installation instructions.

## Workflow

### 1. Identify Parameters

Determine your query parameters:
- **Date**: Specific date for the data
- **Exchange**: NYSE, NASDAQ, etc.
- **Sector**: Technology, Healthcare, Financials, etc.

### 2. Execute Query via Octagon MCP

Use the `octagon-agent` tool with a natural language prompt:

```
Retrieve the latest sector P/E ratios for <DATE>, filtered by exchange <EXCHANGE> and sector <SECTOR>.
```

**MCP Call Format:**

```json
{
  "server": "octagon-mcp",
  "toolName": "octagon-agent",
  "arguments": {
    "prompt": "Retrieve the latest sector P/E ratios for 2025-02-03, filtered by exchange NASDAQ and sector Technology."
  }
}
```

### 3. Expected Output

The agent returns sector P/E data:

| Metric | Value |
|--------|-------|
| Sector | Technology |
| Exchange | NASDAQ |
| P/E Ratio | 58.77 |
| Date | 2025-02-03 |

**Data Sources**: octagon-stock-data-agent

### 4. Interpret Results

See [references/interpreting-results.md](references/interpreting-results.md) for guidance on:
- Comparing company P/E to sector P/E
- Historical sector valuation context
- Cross-sector comparisons
- Exchange-specific analysis

## Example Queries

**Specific Sector and Exchange:**
```
Retrieve the latest sector P/E ratios for 2025-02-03, filtered by exchange NASDAQ and sector Technology.
```

**All Sectors on Exchange:**
```
Get P/E ratios for all sectors on the NYSE.
```

**Sector Comparison:**
```
Compare P/E ratios for Technology, Healthcare, and Financials sectors.
```

**Historical Trend:**
```
What is the historical P/E trend for the Technology sector on NASDAQ?
```

**Cross-Exchange:**
```
Compare Technology sector P/E ratios on NYSE vs. NASDAQ.
```

## Understanding P/E Ratios

### Definition

```
P/E Ratio = Stock Price / Earnings Per Share
```

For sectors:
```
Sector P/E = Weighted Average P/E of all stocks in the sector
```

### Types of P/E

| Type | Description |
|------|-------------|
| Trailing P/E | Based on past 12 months earnings |
| Forward P/E | Based on estimated future earnings |
| GAAP P/E | Using GAAP earnings |
| Non-GAAP P/E | Using adjusted earnings |

## Sector Categories

### Major Sectors

| Sector | Typical P/E Range |
|--------|-------------------|
| Technology | 25-60 |
| Healthcare | 18-35 |
| Financials | 10-18 |
| Consumer Discretionary | 15-30 |
| Consumer Staples | 18-25 |
| Industrials | 15-25 |
| Energy | 8-20 |
| Utilities | 15-22 |
| Real Estate | 30-50 |
| Materials | 12-20 |
| Communications | 15-25 |

### P/E Characteristics by Sector

| Sector | P/E Tendency | Reason |
|--------|--------------|--------|
| Technology | Higher | Growth expectations |
| Financials | Lower | Mature, regulated |
| Utilities | Moderate | Stable, dividend-focused |
| Healthcare | Variable | Mix of growth/value |

## Major Exchanges

### Exchange Characteristics

| Exchange | Focus |
|----------|-------|
| NYSE | Large-cap, established |
| NASDAQ | Tech-heavy, growth |
| AMEX | Smaller companies, ETFs |

### Exchange P/E Differences

| Factor | NYSE | NASDAQ |
|--------|------|--------|
| Tech Weight | Lower | Higher |
| Average P/E | Generally lower | Generally higher |
| Growth vs. Value | More balanced | Growth-tilted |

## Using Sector P/E for Analysis

### Company Valuation Context

| Comparison | Interpretation |
|------------|----------------|
| Company P/E < Sector P/E | Potentially undervalued or issues |
| Company P/E = Sector P/E | Fairly valued relative to sector |
| Company P/E > Sector P/E | Premium valuation or overvalued |

### Premium/Discount Calculation

```
Premium/Discount = (Company P/E - Sector P/E) / Sector P/E × 100%
```

### Example

- Company P/E: 45
- Sector P/E: 58.77
- Discount: (45 - 58.77) / 58.77 = -23.4% (trading at discount)

## Historical Context

### Valuation Levels

| Sector P/E vs. History | Interpretation |
|------------------------|----------------|
| Above 10-year average | Potentially elevated |
| At 10-year average | Normal valuation |
| Below 10-year average | Potentially attractive |

### Cycle Considerations

| Phase | Typical Sector P/E Behavior |
|-------|----------------------------|
| Early Recovery | Rising from lows |
| Mid-Cycle | Moderate, stable |
| Late Cycle | Often elevated |
| Recession | Compressed or distorted |

## Cross-Sector Analysis

### Relative Value

| Comparison | Use |
|------------|-----|
| Tech vs. Financials | Growth vs. value |
| Cyclical vs. Defensive | Risk appetite |
| High vs. Low P/E | Market expectations |

### Rotation Signals

| Signal | Meaning |
|--------|---------|
| Tech P/E rising faster | Growth favored |
| Value sectors rising | Risk-off rotation |
| Convergence | Normalization |
| Divergence | Theme-driven market |

## Data Considerations

### Timing

| Factor | Consideration |
|--------|---------------|
| Earnings season | P/E updates with new earnings |
| Price movements | Daily fluctuation |
| Index rebalancing | Composition changes |

### Calculation Differences

| Source | May Differ On |
|--------|---------------|
| Weighting | Market-cap vs. equal |
| Earnings | Trailing vs. forward |
| Constituents | Index composition |

## Common Use Cases

### Stock Valuation
```
Is AAPL's P/E reasonable compared to the Technology sector?
```

### Sector Selection
```
Which sectors have the lowest P/E ratios currently?
```

### Market Timing
```
Are Technology sector valuations elevated compared to history?
```

### Portfolio Analysis
```
How do my holdings' P/E ratios compare to their sectors?
```

## Analysis Tips

1. **Compare apples to apples**: Same sector, similar companies.

2. **Consider growth**: High P/E may be justified by high growth.

3. **Check historical range**: Current vs. typical levels.

4. **Look at earnings quality**: P/E only as good as earnings.

5. **Cross-reference exchanges**: Same sector, different exchanges.

6. **Watch for outliers**: Negative earnings distort averages.

## Integration with Other Skills

| Skill | Combined Use |
|-------|--------------|
| financial-metrics-analysis | Company P/E vs. sector |
| income-statement | Earnings driving P/E |
| stock-quote | Current price context |
| analyst-estimates | Forward P/E calculation |

© OctagonAI · MIT · OctagonAI/skills

Similar skills

All skills for Finance and business →
company-valuation himself65 company-valuation estimates a public company's intrinsic value using DCF, peer multiples, and SOTP. The skill generates a WACC sensitivity grid and bull, base, or bear price targets. CX Codex +1 3,600installs longbridge-fundamentals longbridge The longbridge-fundamentals Claude Code skill analyzes Longbridge financial statements, business segments, and company valuations. It supports stock comparisons and DCF analysis. CX Codex +1 3,500installs quantitative-valuation JoelLewis quantitative-valuation works out intrinsic value through DCF, dividend models, peer multiples and residual income. Useful when an estimate needs a method behind it. CX Codex +1 859installs AION Indian Market Intelligence for Macro Event & Sector Impact Analysis AION-Analytics-India AION Indian Market Intelligence for Macro Event & Sector Impact Analysis is an MCP server for Claude Code that turns an Indian financial headline into a signed per-sector impact vector. CX Codex +1 ★ 24repo stars sector-overview official anthropics sector-overview — a skill that generates comprehensive industry reports covering market size, key players, competitive dynamics, and sector trends. Built for analysts, investors, and strategists preparing client decks and research. CX Codex +1 1,300installs Finance Toolkit JerBouma Finance Toolkit calculates corporate financial metrics directly from raw financial statements. Helps avoid methodology discrepancies across different market portals. CX Codex +1 ★ 5,554repo stars

From the same set67

The whole set →
sec-s1-analysis sec-s1-analysis is a Claude Code skill that analyzes IPO S-1 filings, extracting business models, risks, financials, and ownership structure. It requires configured Octagon MCP. CX Codex +1 260installs sec-10q-analysis sec-10q-analysis pulls financial metrics, segment revenue, and operating margins from quarterly SEC 10-Q filings using Octagon MCP. CX Codex +1 260installs historical-market-cap A skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode that pulls historical market capitalization data for any stock ticker via Octagon MCP. CX Codex +1 260installs ratings-snapshot The ratings-snapshot skill fetches an overall rating and key financial metrics (DCF, ROE, ROA, debt-to-equity, P/E, P/B) for public companies. Use it to screen stocks by fundamentals and compare companies side by side. CX Codex +1 260installs sec-annual-comparison sec-annual-comparison compares financial metrics and risk factors between annual 10-K filings using Octagon MCP. Use it to analyze year-over-year changes in revenue, profitability, risks, and business strategy. CX Codex +1 259installs stock-historical-index stock-historical-index — a skill to fetch full daily price history for market indices via Octagon MCP. Runs when analyzing index performance, calculating returns, and benchmarking individual stocks against the market. CX Codex +1 259installs price-target-consensus price-target-consensus fetches consensus price targets for any stock: average, median, high and low analyst projections. Use it to evaluate upside potential and measure how widely analysts' views diverge. CX Codex +1 259installs sec-mda-analysis sec-mda-analysis parses MD&A sections from SEC 10-K and 10-Q filings through the Octagon MCP server to track corporate strategy and risks. CX Codex +1 258installs

Project sponsors

Companies that keep this analytics open