Agent skill

Oraclecloud Cost Tuning

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Track OCI spend with the Usage API and set up budget alerts.

MITAuto-check passedDevOps & Cloud

Install Oraclecloud Cost Tuning

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill oraclecloud-cost-tuning -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace oraclecloud-cost-tuning --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/oraclecloud-cost-tuning .claude/skills/oraclecloud-cost-tuning && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
oraclecloud-cost-tuning
GitHub stars
2.8k
Token cost
~2.6k tokens
SKILL.md length
541 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Track OCI spend with the Usage API and set up budget alerts.

  • Works in 5 steps: Query Usage with the Usage API → Break Down Cost by Compartment and Shape → Create a Budget with Alert Rules → …
  • Monitoring Oracle Cloud costs
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 4 more sections
  • Calls pip

What it does

Oraclecloud Cost Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Track OCI spend with the Usage API and set up budget alerts. Use when monitoring Oracle Cloud costs, creating budgets, analyzing spend by compartment or service, or optimizing Universal Credits consumption. Trigger with "oraclecloud cost", "oci budget", "oci usage api", "oci spending", "oracle cloud cost tuning".

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/one-pager.md`). Compatibility notes: Designed for Claude Code

It sits in DevOps & Cloud, covering Cloud cost optimization. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Monitoring Oracle Cloud costs
  • Creating budgets
  • Analyzing spend by compartment
  • Optimizing Universal Credits consumption

Example prompts

  • “oraclecloud cost”
  • “oci budget”
  • “oci usage api”
  • “/oraclecloud-cost-tuning”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(pip:*), Grep

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Query Usage with the Usage API
  2. Break Down Cost by Compartment and Shape
  3. Create a Budget with Alert Rules
  4. Forecast Budget with Projected Spend
  5. Cost Optimization Strategies

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(pip:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.oracle.com
    • oracle.com
    • ocistatus.oraclecloud.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Oraclecloud Cost Tuning loads about 2.6k tokens when it runs, and up to ~3.1k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 541 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 541 words, ~2,642 tokens.

Download SKILL.mdSave it as .claude/skills/oraclecloud-cost-tuning/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
oraclecloud-cost-tuning
description
Track OCI spend with the Usage API and set up budget alerts. Use when monitoring Oracle Cloud costs, creating budgets, analyzing spend by compartment or service, or optimizing Universal Credits consumption. Trigger with "oraclecloud cost", "oci budget", "oci usage api", "oci spending", "oracle cloud cost tuning".
allowed-tools
Read, Write, Edit, Bash(pip:*), Grep
compatibility
Designed for Claude Code
version
1.8.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, oraclecloud, oci

Oracle Cloud Cost Tuning

Overview

Track OCI spending programmatically using the Usage API and set up budget alerts before Universal Credits run out unexpectedly. OCI pricing varies by shape, region, and commitment level, and the Cost Analysis tool in the Console is buried and confusing. This skill uses the Usage API to query spend by compartment, service, and shape, creates budgets with alert rules, and covers optimization strategies including Always Free tier resources, preemptible instances, and reserved capacity.

Purpose: Get visibility into OCI spending through code, set proactive budget alerts, and identify cost optimization opportunities.

Prerequisites

  • OCI tenancy with an API signing key in ~/.oci/config
  • Python 3.8+ with pip install oci
  • Tenancy OCID (root compartment) for tenancy-wide cost queries
  • IAM policy granting read usage-reports in the tenancy
  • Notification topic OCID for budget alert delivery (see oraclecloud-observability)

Instructions

Step 1: Query Usage with the Usage API

The Usage API returns cost and usage data broken down by configurable dimensions:

python
import oci
from datetime import datetime, timedelta

config = oci.config.from_file("~/.oci/config")
usage_api = oci.usage_api.UsageapiClient(config)

# Query last 30 days of spend by service
response = usage_api.request_summarized_usages(
    oci.usage_api.models.RequestSummarizedUsagesDetails(
        tenant_id=config["tenancy"],
        time_usage_started=(datetime.utcnow() - timedelta(days=30)).isoformat() + "Z",
        time_usage_ended=datetime.utcnow().isoformat() + "Z",
        granularity="DAILY",
        query_type="COST",
        group_by=["service"]
    )
)

total_cost = 0.0
for item in response.data.items:
    cost = item.computed_amount or 0
    total_cost += cost
    if cost > 0:
        print(f"{item.service}: ${cost:.2f} ({item.currency})")

print(f"\nTotal 30-day spend: ${total_cost:.2f}")
Step 2: Break Down Cost by Compartment and Shape

Identify which compartments and shapes are driving your bill:

python
# Cost by compartment
response = usage_api.request_summarized_usages(
    oci.usage_api.models.RequestSummarizedUsagesDetails(
        tenant_id=config["tenancy"],
        time_usage_started=(datetime.utcnow() - timedelta(days=30)).isoformat() + "Z",
        time_usage_ended=datetime.utcnow().isoformat() + "Z",
        granularity="MONTHLY",
        query_type="COST",
        group_by=["compartmentName", "skuName"]
    )
)

for item in response.data.items:
    cost = item.computed_amount or 0
    if cost > 1.0:  # Filter noise
        print(f"{item.compartment_name} | {item.sku_name}: ${cost:.2f}")
Step 3: Create a Budget with Alert Rules

Budgets warn you before spend exceeds a threshold. Create them via SDK instead of hunting through the Console:

python
budget_client = oci.budget.BudgetClient(config)

# Create a monthly budget for a specific compartment
budget = budget_client.create_budget(
    oci.budget.models.CreateBudgetDetails(
        compartment_id=config["tenancy"],
        target_type="COMPARTMENT",
        targets=["ocid1.compartment.oc1..example"],
        amount=500.0,
        reset_period="MONTHLY",
        display_name="Dev Environment Budget",
        description="Monthly budget for dev compartment"
    )
).data

print(f"Budget created: {budget.id}")

# Add alert rule at 80% threshold
budget_client.create_alert_rule(
    budget_id=budget.id,
    create_alert_rule_details=oci.budget.models.CreateAlertRuleDetails(
        type="ACTUAL",
        threshold=80.0,
        threshold_type="PERCENTAGE",
        display_name="80% Warning",
        recipients="oncall@example.com",
        message="Dev budget has reached 80% of $500 monthly limit."
    )
)

# Add critical alert at 95%
budget_client.create_alert_rule(
    budget_id=budget.id,
    create_alert_rule_details=oci.budget.models.CreateAlertRuleDetails(
        type="ACTUAL",
        threshold=95.0,
        threshold_type="PERCENTAGE",
        display_name="95% Critical",
        recipients="oncall@example.com",
        message="CRITICAL: Dev budget at 95%. Review immediately."
    )
)
print("Alert rules created: 80% warning + 95% critical")
Step 4: Forecast Budget with Projected Spend

Set a forecast-based alert that warns you if your current burn rate will exceed the budget:

python
budget_client.create_alert_rule(
    budget_id=budget.id,
    create_alert_rule_details=oci.budget.models.CreateAlertRuleDetails(
        type="FORECAST",
        threshold=100.0,
        threshold_type="PERCENTAGE",
        display_name="Forecast Overspend",
        recipients="oncall@example.com",
        message="Projected spend will exceed monthly budget based on current usage."
    )
)
print("Forecast alert created: warns if burn rate exceeds budget")
Step 5: Cost Optimization Strategies

Apply these strategies to reduce OCI spending:

Always Free tier resources — run dev/test workloads for free:

  • 2 AMD Compute VMs (1/8 OCPU, 1 GB each) or 4 Arm A1 VMs (24 GB total)
  • 200 GB total block storage, 10 GB object storage
  • 1 Autonomous Database (20 GB), 10 Mbps load balancer
  • Monitoring: 500 million ingestion datapoints, 1 billion retrieval datapoints

Preemptible instances — up to 50% cheaper for fault-tolerant batch jobs:

python
compute = oci.core.ComputeClient(config)

compute.launch_instance(
    oci.core.models.LaunchInstanceDetails(
        compartment_id="ocid1.compartment.oc1..example",
        availability_domain="Uocm:US-ASHBURN-AD-1",
        shape="VM.Standard.E4.Flex",
        shape_config=oci.core.models.LaunchInstanceShapeConfigDetails(
            ocpus=4.0,
            memory_in_gbs=16.0
        ),
        preemptible_instance_config=oci.core.models.PreemptibleInstanceConfigDetails(
            preemption_action=oci.core.models.TerminatePreemptionAction(
                type="TERMINATE",
                preserve_boot_volume=False
            )
        ),
        source_details=oci.core.models.InstanceSourceViaImageDetails(
            image_id="ocid1.image.oc1..example",
            source_type="image"
        ),
        create_vnic_details=oci.core.models.CreateVnicDetails(
            subnet_id="ocid1.subnet.oc1..example"
        ),
        display_name="batch-worker-preemptible"
    )
)
print("Preemptible instance launched — up to 50% cost savings")

Reserved capacity — commit for 1 or 3 years for predictable discounts. Savings vary by shape and term length, typically 30–60% off on-demand pricing.

Show full SKILL.md (218 more words)Show less

Output

Successful completion produces:

  • Usage API queries showing cost breakdown by service, compartment, and SKU
  • A monthly budget with alert rules at 80% and 95% thresholds
  • A forecast-based alert for projected overspend
  • Cost optimization patterns: Always Free resources, preemptible instances, and reserved capacity guidance

Error Handling

ErrorCodeCauseSolution
NotAuthenticated401Bad API key or wrong tenancyVerify ~/.oci/config fields match your tenancy
NotAuthorizedOrNotFound404Missing read usage-reports policyAdd: Allow group X to read usage-reports in tenancy
TooManyRequests429Rate limited on Usage APIReduce query frequency; cache daily results
InvalidParameter400Invalid date range or granularityEnsure dates are ISO format with Z suffix; use DAILY or MONTHLY
InternalError500OCI Usage API service issueCheck OCI Status and retry
ServiceError status -1N/ATimeout on large cost queriesNarrow date range or reduce group_by dimensions

Examples

Quick cost check with OCI CLI:

bash
# List all budgets in your tenancy
oci budgets budget list --compartment-id $OCI_TENANCY_OCID

# Get current month spend summary
oci usage-api usage-summary request-summarized-usages \
  --tenant-id $OCI_TENANCY_OCID \
  --time-usage-started "$(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%SZ)" \
  --time-usage-ended "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
  --granularity MONTHLY \
  --query-type COST

Daily cost tracker script:

python
import oci
from datetime import datetime, timedelta

config = oci.config.from_file("~/.oci/config")
usage_api = oci.usage_api.UsageapiClient(config)

# Yesterday's spend
yesterday = datetime.utcnow() - timedelta(days=1)
response = usage_api.request_summarized_usages(
    oci.usage_api.models.RequestSummarizedUsagesDetails(
        tenant_id=config["tenancy"],
        time_usage_started=yesterday.replace(hour=0, minute=0).isoformat() + "Z",
        time_usage_ended=yesterday.replace(hour=23, minute=59).isoformat() + "Z",
        granularity="DAILY",
        query_type="COST",
        group_by=["service"]
    )
)

daily_total = sum(i.computed_amount or 0 for i in response.data.items)
print(f"Yesterday's spend: ${daily_total:.2f}")
for item in sorted(response.data.items, key=lambda x: x.computed_amount or 0, reverse=True)[:5]:
    print(f"  {item.service}: ${item.computed_amount or 0:.2f}")

Resources

Next Steps

After cost monitoring is in place, review oraclecloud-performance-tuning to right-size instances based on actual metrics, or see oraclecloud-observability to route budget alerts through the same notification topics as your infrastructure alarms.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/.curated/oraclecloud-cost-tuning of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/one-pager.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Oraclecloud Cost Tuning next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Oraclecloud Cost Tuning compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Oraclecloud Cost Tuning this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.6kAutomated safety check: PassMIT
Vercel Optimize Auditvercel-labs/agent-skills32k8 repos~4.3kAutomated safety check: PassNone
Cloud Cost Optimizationwshobson/agents40k14 repos~1.7kAutomated safety check: PassMIT
Kubernetes SpecialistJeffallan/claude-skills12k1 repos~2.1kAutomated safety check: PassMIT
Trigger.dev Cost Savings Auditpapermark/papermark9.2k—~1.3kAutomated safety check: PassCustom licence
Axiom Cost Controlopenclaw/clawhub9.5k—~1.7kAutomated safety check: PassMIT

Similar skills

  • Vercel Optimize Audit

    vercel-labs/agent-skills

    Official

    Runs a metrics-first audit of a deployed Vercel project, gating investigations on real signals to produce ranked, citation-backed cost and performance recommendations.

    32k GitHub starsUsed in 8 repos~4.3k tokens
    DevOps & CloudAuto-check passed
  • Cuts cloud spend across AWS, Azure, GCP and OCI with cost tagging, rightsizing, commitment and spot pricing models, and architecture changes.

    40k GitHub starsUsed in 14 repos~1.7k tokens
    DevOps & CloudAuto-check passed
  • Kubernetes Specialist

    Jeffallan/claude-skills

    Creates and checks Kubernetes manifests, Helm charts, RBAC and network policies, and helps debug pod problems, with kubectl checks and rollback steps.

    12k GitHub starsUsed in 1 repo~2.1k tokens
    DevOps & CloudAuto-check passed
  • Audits Trigger.dev tasks, schedules and run history for wasteful machine sizes, retries, polling and cron frequency to cut spend.

    9.2k GitHub stars~1.3k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Axiom Cost Control

    openclaw/clawhub

    Finds unused data in Axiom by analyzing query patterns, then deploys a cost dashboard and ingest monitors to keep spend under the contract limit.

    9.5k GitHub stars~1.7k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Spotinfo

    alexei-led/spotinfo

    Query Spot/preemptible VM prices, savings and interruption risk across AWS, GCP and Azure with the spotinfo CLI.

    164 GitHub stars~1.8k tokensUpdated 5 days ago
    DevOps & CloudAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Oraclecloud Cost Tuning

What does Oraclecloud Cost Tuning do?

Track OCI spend with the Usage API and set up budget alerts. Oraclecloud Cost Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Track OCI spend with the Usage API and set up budget alerts.

When should I use Oraclecloud Cost Tuning?

Oraclecloud Cost Tuning fits situations like: monitoring Oracle Cloud costs; creating budgets; analyzing spend by compartment; optimizing Universal Credits consumption.

How do I install Oraclecloud Cost Tuning in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill oraclecloud-cost-tuning -a claude-code`. Or copy the skill folder (skills/.curated/oraclecloud-cost-tuning in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/oraclecloud-cost-tuning in your project. Claude Code loads it when a task matches its description.

How do I install Oraclecloud Cost Tuning in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill oraclecloud-cost-tuning -a codex`. Or copy the skill folder (skills/.curated/oraclecloud-cost-tuning in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/oraclecloud-cost-tuning in your project. Codex loads it when a task matches its description.

Can I use Oraclecloud Cost Tuning in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill oraclecloud-cost-tuning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/oraclecloud-cost-tuning, .gemini/skills/oraclecloud-cost-tuning, .github/skills/oraclecloud-cost-tuning and .opencode/skills/oraclecloud-cost-tuning in your project.

What does Oraclecloud Cost Tuning need to run?

Going by SKILL.md and its folder, Oraclecloud Cost Tuning needs the command-line tools its instructions call (pip). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(pip:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Oraclecloud Cost Tuning access the network?

SKILL.md names 3 domains. As links in the text: docs.oracle.com, oracle.com and ocistatus.oraclecloud.com. This is read from the text; nothing was executed.

Is Oraclecloud Cost Tuning safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Oraclecloud Cost Tuning use?

Oraclecloud Cost Tuning is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Oraclecloud Cost Tuning use?

About 2.6k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 430 tokens, read only when the agent opens those files.

What are the alternatives to Oraclecloud Cost Tuning?

Skills that share tags, products or a category with Oraclecloud Cost Tuning: Vercel Optimize Audit (vercel-labs/agent-skills, 32k stars), Cloud Cost Optimization (wshobson/agents, 40k stars), Kubernetes Specialist (Jeffallan/claude-skills, 12k stars) and Trigger.dev Cost Savings Audit (papermark/papermark, 9.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Oraclecloud Cost Tuning?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.