analyze

analyze is a command for coding agents from peerjakobsen/smartspender. It costs 7 tokens per session (1,221 once invoked), scanned A, original, MIT.

A command for sorting financial transactions into spending categories and finding recurring subscriptions. It reads transaction data and uses previously saved corrections, merchant names, and subscription decisions when available.

In plain words
What is it for?
Use it after transactions have been synced to categorize new records and identify recurring charges. It requires transaction data in transactions.csv and uses categorized.csv plus optional learning files.
Why use it?
It reduces the manual work of reviewing uncategorized transactions and helps keep categories consistent over time. It also checks for new merchant or subscription patterns.

Command

Part of the smartspender plugin — 13 skills, 19 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/peerjakobsen/smartspender/analyze
Clone the repo
git clone --depth 1 https://github.com/peerjakobsen/smartspender

Or install smartspender, the plugin that ships this one along with the rest of its 13 skills, 19 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for analyze

README.md
[![agentmods](https://agentmods.dev/badge/commands/peerjakobsen/smartspender/analyze.svg)](https://agentmods.dev/commands/peerjakobsen/smartspender/analyze)
Your own site
<a href="https://agentmods.dev/commands/peerjakobsen/smartspender/analyze"><img src="https://agentmods.dev/badge/commands/peerjakobsen/smartspender/analyze.svg" alt="Measured on agentmods" height="20"></a>
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,221 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00007 $0.01221
Opus 5 $0.00003 $0.00611
Sonnet 5 $0.00001 $0.00244
Haiku 4.5 $0.00001 $0.00122

Measured 3d ago against content hash 6f100a27470e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

analyze scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/analyze.md · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/smartspender:analyze

Trigger

  • /smartspender:analyze
  • "Analyser mine transaktioner"
  • "Kategoriser mit forbrug"
  • "Analyze my spending"

Arguments

None.

Prerequisites

  • Transactions synced (transactions.csv has data)

Workflow

  1. Load user memory skill:

    • Load skills/user-memory/SKILL.md for learning detection
    • Read learnings/categorization.md for previously learned category corrections
    • Read learnings/subscriptions.md for subscription confirmations/denials
    • Read learnings/merchants.md for merchant aliases
  2. Read all transactions from transactions.csv

  3. Read existing categorized transactions from categorized.csv (by tx_id)

  4. Read merchant-overrides.csv (if it exists) — these are learned categorization rules from previous user corrections

  5. Identify uncategorized transactions: tx_ids present in transactions.csv but not in categorized.csv

  6. If no uncategorized transactions found, skip to step 8 (still check for new overrides to learn)

  7. For each uncategorized transaction, apply categorization using skills/categorization/SKILL.md: a. Normalize the raw_text for pattern matching b. Check merchant-overrides.csv first — if raw_text (normalized) matches a raw_pattern, use that override's merchant/category/subcategory (confidence 1.0) c. If no override match, check against the merchant pattern database (exact match -> confidence 1.0) d. If no exact match, try partial pattern match (confidence 0.8) e. If no pattern match, use intelligent classification from transaction context (confidence 0.5-0.7) f. If still unmatched, assign to "Andet" category (confidence 0.0) g. Detect transaction type from description prefix (Dankort-kob, PBS, Overforsel, etc.) h. For known subscription merchants, set is_recurring to TRUE

  8. Append categorized rows to categorized.csv (create file with header row if it doesn't exist)

  9. Learn from manual corrections: scan categorized.csv for rows where manual_override is TRUE. For each, look up the original raw_text in transactions.csv. If no corresponding raw_pattern exists in merchant-overrides.csv yet, append a new override row with the corrected merchant/category/subcategory

  10. Run subscription detection using skills/subscription-detection/SKILL.md: a. Group categorized transactions by merchant b. For each merchant with >=3 occurrences, check the 5 subscription criteria c. Calculate frequency and annual cost for detected subscriptions

  11. Read existing subscriptions from subscriptions.csv

  12. For newly detected subscriptions not already in the file, append rows

  13. For existing subscriptions, update last_seen date and amount if changed

  14. Calculate monthly aggregations and write to monthly-summary.csv: a. Group by month (YYYY-MM) and category b. Compute total, transaction_count, avg_transaction c. Compute vs_prev_month and vs_prev_month_pct where previous month data exists

  15. Append the analysis event to action-log.csv:

    • action_type: analyze
    • target: all
    • status: completed
    • details: "{N} transactions categorized, {M} subscriptions detected"

Read the full file on GitHub · 119 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 119 lines · 7 tokens per session scan A 6f100a27470e

Subscribe to this mod's changes

analyze is a command published in the GitHub repository peerjakobsen/smartspender (5 stars, last pushed 7mo ago), licensed MIT. It adds 7 tokens to every session and 1,221 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.