From 8bac356951b27340ef951d30647e2e1b54917925 Mon Sep 17 00:00:00 2001 From: b4tchkn Date: Sat, 20 Jun 2026 21:18:17 +0900 Subject: [PATCH] chore: remove ccusage-analyzer plugin Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_0168JRvT1naWrCDfAUchh8S3 --- .claude-plugin/marketplace.json | 7 +- CLAUDE.md | 3 +- .../.claude-plugin/plugin.json | 9 -- .../skills/analyze-usage/SKILL.md | 115 ------------------ 4 files changed, 2 insertions(+), 132 deletions(-) delete mode 100644 plugins/ccusage-analyzer/.claude-plugin/plugin.json delete mode 100644 plugins/ccusage-analyzer/skills/analyze-usage/SKILL.md diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 8d193ee..8b36c65 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -20,12 +20,7 @@ "source": "./plugins/qa-toolbox", "description": "A plugin that provides QA workflow tools for test case generation and quality assurance." }, - { - "name": "ccusage-analyzer", - "source": "./plugins/ccusage-analyzer", - "description": "Analyze Claude Code usage and costs using ccusage CLI to provide insights on token consumption and spending patterns." - }, - { +{ "name": "claude-code-best-practice", "source": "./plugins/claude-code-best-practice", "description": "A plugin that audits and automatically improves Claude Code configuration files (CLAUDE.md, settings.json, agents, skills) based on established best practices." diff --git a/CLAUDE.md b/CLAUDE.md index 5018738..5527640 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -26,7 +26,6 @@ Each skill is a single `SKILL.md` with YAML frontmatter: `name`, `description`, |--------|--------| | git-toolbox | check-github-ci, create-draft-pr, semantic-commit, semantic-branch, pr-auto-update, ai-review-triage | | qa-toolbox | create-dev-check-list-android, copy-simple-qa-cases | -| ccusage-analyzer | analyze-usage | | claude-code-best-practice | claude-md-best-practice, settings-audit, skill-audit, subagent-audit, subagent-driven-prompt-tuning, grilling | ## Adding a New Plugin @@ -48,7 +47,7 @@ allowed-tools: Bash(git *), Bash(gh *), Read, Grep --- ``` -Common `allowed-tools` patterns: `Bash(git *)`, `Bash(gh *)`, `Bash(npx ccusage*)`, `Read`, `Grep`, `Glob` +Common `allowed-tools` patterns: `Bash(git *)`, `Bash(gh *)`, `Read`, `Grep`, `Glob` ## Conventions diff --git a/plugins/ccusage-analyzer/.claude-plugin/plugin.json b/plugins/ccusage-analyzer/.claude-plugin/plugin.json deleted file mode 100644 index 5439af8..0000000 --- a/plugins/ccusage-analyzer/.claude-plugin/plugin.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "ccusage-analyzer", - "description": "Analyze Claude Code usage and costs using ccusage CLI to provide insights on token consumption and spending patterns.", - "version": "0.1.0", - "author": { - "name": "Kakeru Nakabachi", - "email": "baaaakkrad@gmail.com" - } -} diff --git a/plugins/ccusage-analyzer/skills/analyze-usage/SKILL.md b/plugins/ccusage-analyzer/skills/analyze-usage/SKILL.md deleted file mode 100644 index d40d0a7..0000000 --- a/plugins/ccusage-analyzer/skills/analyze-usage/SKILL.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -name: analyze-usage -description: Analyze Claude Code usage and costs using ccusage CLI. Provides daily/monthly reports with cost summaries, trend analysis, and optimization insights. -argument-hint: "[--monthly] [--session] [--since YYYYMMDD] [--until YYYYMMDD] [--breakdown]" -allowed-tools: Bash(npx ccusage*) ---- - -# Usage & Cost Analyzer - -Analyze Claude Code token usage and costs via ccusage CLI, providing actionable insights on spending patterns and optimization opportunities. - -## Arguments - -- `--monthly` — Show monthly aggregated report (default: daily) -- `--session` — Show session-level breakdown -- `--since YYYYMMDD` — Start date filter (e.g., `--since 20260301`) -- `--until YYYYMMDD` — End date filter (e.g., `--until 20260310`) -- `--breakdown` — Include per-model cost breakdown -- No arguments — Show recent daily report - -## Steps - -### 1. Parse Arguments - -Parse `$ARGUMENTS` to determine: - -- **Report type**: `daily` (default), `monthly` (if `--monthly`), or `session` (if `--session`) -- **Date range**: Extract `--since` and `--until` values if present -- **Breakdown**: Whether `--breakdown` is specified - -### 2. Execute ccusage - -Build and run the appropriate ccusage command: - -```bash -# Base command pattern -npx ccusage --json [--since YYYYMMDD] [--until YYYYMMDD] -``` - -- Daily report: `npx ccusage daily --json` -- Monthly report: `npx ccusage monthly --json` -- Session report: `npx ccusage session --json` -- Add `--since` / `--until` flags if date filters were specified - -If the command fails, inform the user that ccusage may not be installed and suggest running `npm install -g ccusage` or using `npx ccusage` directly. - -### 3. Analyze Results - -Parse the JSON output and compute: - -- **Total cost** (USD) and **total tokens** (input + output) -- **Cache hit rate**: cached read tokens / total input tokens -- **Per-period breakdown**: cost and token counts for each day/month/session -- **Peak usage**: identify the highest-cost period -- **Average cost** per period -- **Spike detection**: flag periods where cost exceeds 2x the average -- **Model breakdown** (if `--breakdown`): cost and token usage per model - -### 4. Output Report - -Format the analysis as markdown with the following structure: - -```markdown -## Usage Report ({report-type}: {date-range}) - -### Summary - -| Metric | Value | -|--------|-------| -| Total Cost | $X.XX | -| Total Tokens | X,XXX,XXX | -| Cache Hit Rate | XX.X% | -| Peak Day/Month | YYYY-MM-DD ($X.XX) | -| Average Cost/Day | $X.XX | - -### Breakdown - -| Date | Input Tokens | Output Tokens | Cache Read | Cost | -|------|-------------|---------------|------------|------| -| ... | ... | ... | ... | $X.XX | - -### Model Breakdown (if --breakdown) - -| Model | Input Tokens | Output Tokens | Cost | Share | -|-------|-------------|---------------|------|-------| -| ... | ... | ... | $X.XX | XX% | - -### Insights - -- {Trend observations: increasing/decreasing/stable} -- {Spike alerts if any periods exceed 2x average} -- {Cache efficiency assessment} -- {Optimization recommendations} -``` - -## Insights Generation Guidelines - -Provide actionable insights based on the data: - -- **Cache efficiency**: If cache hit rate < 50%, suggest reviewing project structure for better cache utilization -- **Cost spikes**: Highlight days/sessions with unusually high costs and note what might cause them -- **Model usage**: If multiple models are used, note cost differences and suggest model selection optimization -- **Trend**: Note if costs are trending up/down over the period - -## Error Handling - -- If `npx ccusage` is not available, inform the user and suggest installation -- If no data is found for the specified date range, report that clearly -- If JSON parsing fails, show the raw output and explain the issue - -## Notes - -- Requires ccusage CLI (`npm install -g ccusage` or use via `npx`) -- ccusage reads from local Claude Code JSONL log files -- Cost calculations are estimates based on public API pricing