Skip to content

Open source · MIT · Claude Code

Marketing Token Economy: AI marketing at the lowest cost

Marketing Token Economy is a free, MIT-licensed set of plain files for Claude Code: a drop-in block for CLAUDE.md or AGENTS.md, four subagents with fixed models, a hook that shows the cost of every answer, and a ledger for external API calls. It is the setup I use for ad creatives, competitor research, SEO content and UA analytics. The core rule: downgrade the work, never the final gate.

The reasoning behind the rules, with examples: how to cut Claude Code token costs for AI marketing work.

What is inside the repository

  • rules/CLAUDE-block.mdDrop-in block for CLAUDE.md or AGENTS.md: language routing, model routing, orchestration, token hygiene and money rules.
  • agents/Four subagents with fixed models: critic on Opus, builder and researcher on Sonnet, file-ops on Haiku.
  • hooks/usage-guard.pyClaude Code hook and status line: the cost of every answer at API list prices, plan usage, and a warning at 80% of the weekly or 5-hour window.
  • tools/cost_ledger.pyLogs every external call (images, voice, video, scraping) and prints one cost line per task.
  • templates/An English brief, a handoff note and a module card.
  • docs/cost-reference.mdWhere the money actually goes in creative production and research, with the mistakes that cost the most.
  • skills/marketing-token-economy/The same method packaged as an agent skill.

Downgrade the work, never the final gate

The strongest model decides and signs off. Cheaper models and scripts do the volume. External models draft images and copy variants cheaply, and only the approved pick is rendered on the top tier.

WorkWho does it
Positioning, approach pick, hooks, final copy, art direction, final QAMain thread
Independent sign-off of a batch, once per batchcritic (Opus)
HTML or Figma build of banners, posts and layoutsbuilder (Sonnet)
Competitor and account research, data processingresearcher (Sonnet) plus scripts
Renames, size checks, export packs, contact sheetsfile-ops (Haiku) or a script
Image drafts, copy variants, taggingExternal models through one wrapper with a ledger

Ten rules that save the most

  1. 01

    Talk in your language, prompt in English

    Dictated requests get rewritten into a short English brief before any agent or external model sees them.

  2. 02

    Cheapest model per task, set explicitly

    Opus for judgment (strategy, money, final QA), Sonnet for building and research, Haiku or a script for mechanical work.

  3. 03

    Inline by default

    One subagent when the job means reading many files. A fan-out only when someone asks for it.

  4. 04

    Short agent prompts

    English, 150 to 350 words, inputs as file paths, an explicit output path, a reply of 6 lines or less. Never paste datasets into a prompt.

  5. 05

    Data lives in files

    Scripts compute scores. The chat gets paths and five-line summaries, not tables.

  6. 06

    Contact sheets, not single files

    One image of 20 thumbnails at 1600 px or less instead of 20 screenshots. Read pages as text.

  7. 07

    Draft cheap, approve, render once

    At most 3 takes per asset, then one edit with a reference image.

  8. 08

    Quote before you spend

    One cost line before any paid batch; ask a human above about $2.

  9. 09

    One chat per task

    Hand off through a short handoff note. Resuming a long idle chat re-caches the whole context.

  10. 10

    Count finished results, not started jobs

    Checking a workflow by started entries once re-ran research three times and burned about 100M tokens.

Where the money actually goes

Rough figures from real runs in late 2026, from docs/cost-reference.md. Check current provider pricing before you rely on them.

  • Resuming a long idle chat re-caches the whole context: about $1 each time.
  • A 30 to 60 second video ad with AI live shots: most of the external cost is video generation, about $1 per 5-second clip; text to speech is under $0.01.
  • Scraping an ad library through an actor: about $0.50 to $0.75 per 1,000 ads, $0.10 to $1 for a full run.
  • The most expensive mistake: a research workflow re-run three times because it was checked by started entries, about 100M tokens.

Install in four commands

Clone

git clone https://github.com/ua5er/marketing-token-economy

Add the rules

cat marketing-token-economy/rules/CLAUDE-block.md >> your-repo/CLAUDE.md

Add the agents

mkdir -p your-repo/.claude/agents && cp marketing-token-economy/agents/*.md your-repo/.claude/agents/

Add the hook

cp marketing-token-economy/hooks/usage-guard.py ~/.claude/hooks/

Then wire the hook into ~/.claude/settings.json (Stop, UserPromptSubmit and the status line); the exact JSON is in the README. Log external calls with python3 tools/cost_ledger.py log and print a task total with report.

Questions

What is Marketing Token Economy?

A free, MIT-licensed set of rules, four subagents, a usage hook and a cost ledger that keeps AI marketing work in Claude Code cheap. You drop plain files into a repository and the agent follows them.

How does it lower Claude Code costs?

The strongest model only decides and signs off. Cheaper models and scripts do the volume, prompts stay short and in English, data stays in files, and every paid batch starts with a cost quote.

Does it work outside Claude Code?

The rules and templates are plain Markdown, so any agent that reads CLAUDE.md or AGENTS.md can follow them. The hook and the subagent files are written for Claude Code.

How do I see what an answer cost?

Install hooks/usage-guard.py and wire it into ~/.claude/settings.json. The status line shows the cost of every answer at API list prices and warns at 80% of a usage window.

Are the prices in the hook current?

They are public list prices at the time of writing. Check your provider's pricing page and edit the PRICES table in usage-guard.py.

Is it free for commercial use?

Yes. It is released under the MIT licence.

Want this running in your team's repos?

I set up the rules, agents and cost tracking for marketing teams that use Claude Code, then tune the model routing to your real workload. Related open source: the user acquisition skills and the cohort ROAS and LTV board.