Stop guessing. Start optimizing.
A bookmarklet that displays the most efficient purchase in Cookie Clicker using Cookie Monster's payback period calculations.
The Problem: Cookie Clicker has dozens of buildings and upgrades. Manually calculating which purchase gives the best return is tedious and error-prone.
The Solution: This bookmarklet analyzes all available purchases and tells you exactly what to buy next, with optional auto-purchasing.
| Feature | What It Does |
|---|---|
| Best Purchase Display | Shows the optimal item based on Payback Period (lower = better) |
| Auto-Purchase | Automatically buys the best item when you can afford it |
| Golden Cookie Handling | Auto-clicks golden/wrath cookies, prioritizes golden upgrades |
| Lucky Bank Protection | Reserves cookies for max Lucky rewards (phase-aware scaling) |
| Wrinkler Management | Tracks wrinkler rewards, suggests when to pop for faster progress |
- Open Cookie Clicker
- Click your bookmarklet
- A floating panel appears showing your best purchase
The optimizer uses Cookie Monster's Payback Period (PP) metric to rank purchases:
- Time to afford the item (if you don't have enough cookies)
- Time to pay for itself through increased CpS
- Synergies from achievements and bonuses
Lower PP = Better purchase
flowchart TD
A[Start Optimizer] --> B{Cookie Monster loaded?}
B -->|No| C[Load Cookie Monster]
C --> D[Wait for initialization]
D --> B
B -->|Yes| E[Start refresh loop]
E --> F[Every 200ms]
F --> G[Click golden/wrath cookies if enabled]
G --> H{Purchase detected?}
H -->|Yes| I[Find best purchase]
H -->|No| J{2 seconds elapsed?}
J -->|Yes| I
J -->|No| F
I --> K[Update display]
K --> L{Auto-purchase enabled?}
L -->|No| F
L -->|Yes| M{Gold ON & golden upgrade affordable?}
M -->|Yes| N[Buy golden upgrade]
M -->|No| O{Best item affordable?}
O -->|Yes| P[Buy best item]
O -->|No| F
N --> F
P --> F
Visit the Installation Page and drag the bookmarklet to your bookmarks bar.
- Copy the entire contents of
bookmarklet.txt - Create a new bookmark in your browser
- Name it "CC Optimizer"
- Paste the copied text as the bookmark URL
// Copy contents of dist/main.global.js and paste into DevTools Console (F12)| Control | Action |
|---|---|
| Auto: OFF/ON | Toggle automatic purchasing |
| Gold: OFF/ON | Toggle golden cookie auto-clicking |
| Wrath: OFF/ON | Include wrath cookies (visible when Gold ON) |
| Wrnk: OFF/ON | Auto-pop wrinklers when beneficial (visible during Grandmapocalypse) |
| Drag header | Move panel anywhere |
| Click X | Close panel |
| Click bookmarklet again | Toggle off |
CCOptimizerStop() |
Stop from console |
When enabled, automatically buys the best PP item as soon as affordable. Disabled by default.
When Gold: ON:
- Auto-clicks golden cookies instantly
- Auto-clicks reindeer during Christmas season
- Shows "Golden Priority" section for spawn-rate upgrades
- Prioritizes golden upgrades when combined with Auto
- Wrath toggle appears for red cookies
Test with: new Game.shimmer('golden') or new Game.shimmer('reindeer') in console
Reserves cookies for max Lucky + Frenzy rewards. Scales by game phase:
| Phase | CpS Range | Bank Protection | Golden Upgrade Priority |
|---|---|---|---|
| Early | < 1M | 0% (disabled) | Only if < 30 min |
| Mid | 1M - 100M | Scales 0% → 100% | Up to 4 hours |
| Late | > 100M | 100% (full) | Up to 12 hours |
Why? Lucky gives min(15% of bank, 900 × CpS). During Frenzy, you need 42,000 × base CpS banked for max reward.
During Grandmapocalypse:
- Shows wrinkler count and pop reward
- Highlights shiny wrinklers (3.3× reward, never auto-popped)
- Suggests when popping enables faster purchases
The optimizer recommends "One mind" to trigger Stage 1 Grandmapocalypse, which provides:
- Wrinklers (6× passive CpS multiplier)
- 67% Golden Cookies (only 33% Wrath Cookies)
This is the optimal balance for active players who click golden cookies.
The optimizer blocks Stage 2+ upgrades to prevent further progression:
- Communal brainsweep
- Arcane sugar
- Elder Pact
These would increase Wrath Cookie rate to 66-100%, disrupting golden cookie combos. If you want full Grandmapocalypse, purchase these manually.
The optimizer never recommends the Golden Switch. While it provides +50% passive CpS, it completely disables golden cookies. For active/semi-active play, golden cookie combos (Lucky + Frenzy) provide more value than the passive boost.
| Feature | This Optimizer | Cookie Monster Only | Manual Play |
|---|---|---|---|
| Best purchase recommendation | ✅ Floating panel | ❌ Mental math | |
| Auto-purchasing | ✅ One click | ❌ Manual | ❌ Manual |
| Golden cookie handling | ✅ Auto-click + prioritize | ❌ Watch constantly | |
| Lucky bank management | ✅ Phase-aware auto | ❌ Guesswork | |
| Wrinkler optimization | ✅ Pop suggestions | ❌ Guesswork | |
| Setup time | ✅ ~5 seconds | N/A |
bun install # Install dependencies (first time)
bun run build # Build TypeScript + generate bookmarklet
bun test # Run tests
bun run typecheck # Type checkingSee DEVELOPMENT.md for detailed project structure and workflows.
| Path | Purpose |
|---|---|
src/ |
TypeScript source code |
dist/main.global.js |
Bundled JavaScript |
bookmarklet.txt |
Generated minified bookmarklet |
# Check browser console for errors (F12 → Console)
# Ensure you're on orteil.dashnet.org/cookieclicker/If you see "Timeout waiting for Cookie Monster":
- Refresh the Cookie Clicker page
- Wait for game to fully load
- Click bookmarklet again
- Check if Auto: ON is enabled (green)
- If Gold: ON, it may be saving for a golden upgrade
- Check Lucky Bank status - may be protecting cookie reserve
That's up to you. This tool automates decisions but doesn't hack the game. It uses the same calculations Cookie Monster provides - just with automation.
Cookie Monster has years of refinement on its PP calculations, accounting for synergies, achievements, and edge cases. Why reinvent the wheel?
Yes! By default, auto-purchase is OFF. The panel just shows recommendations - you decide when to buy.
No, this is for the web version only.
- Cookie Monster - Powers the PP calculations
- Cookie Clicker by Orteil
