Goal of this document: A self-contained, step-by-step blueprint that any developer (or Sonnet+medium running in fresh context) can follow to build the product from current state → production launch. Each numbered step in §13 is designed to fit in one Sonnet medium turn.
The current D:\ClaudeTokenCheker is a Next.js webapp. The engine inside src/lib/ is excellent - pure TypeScript, framework-agnostic, well-factored. The shell is wrong. Reasons:
- Real users (Android, iOS, Flutter, React Native, JS, business teams) can't and won't upload multi-GB project directories into a browser.
node_modules,Pods,.gradle,build/,target/etc. should never be counted as input tokens - a browser can't filter them efficiently.- Business teams won't
npm installa webapp - they want a one-click installer. - Power devs want it in their terminal, in their IDE, in their CI, and inside the AI itself (MCP).
Solution: keep the engine, replace the shell with many shells. One shared core, many thin wrappers. Free OSS to capture an emerging market quickly.
Brand & command name: ctok (short, memorable, available on npm). Tagline: "Lighthouse for Claude prompts."
Three jobs the user gets done every time:
- Estimate - "How many tokens will this prompt + these files use?" (input + output ranges, USD, % of Claude plan quota, % of 200k context window).
- Recommend - "Which model + effort should I pick for the best ROI?" (Haiku/Sonnet/Opus × low/med/high/xhigh).
- Refine - "Rewrite my prompt to be tighter, clearer, and cheaper while keeping intent." (the killer differentiator - multi-pass heuristic refiner).
A fourth implicit job: Educate - every output explains why. Devs trust tools that show their work.
| Persona | Where they live | Primary surface |
|---|---|---|
| Android dev | Android Studio + bash/pwsh | CLI + JetBrains plugin (P2) |
| iOS dev | Xcode + zsh | CLI + Xcode source ext (P3) |
| Flutter / RN dev | VS Code + any shell | CLI + VS Code ext (P2) |
| Frontend / Backend JS | VS Code/Cursor + node | CLI + VS Code ext (P2) |
| Business / PM / Designer | Slack + browser | Web playground + Desktop app + Slack bot (P3) |
| AI-powered dev (Claude Code, Cursor, Zed) | their AI tool | MCP server |
| Casual user testing claude.ai | Chrome/Edge | Browser extension |
ctok/ (new repo, or restructured current repo)
├── package.json # workspaces root, pnpm
├── pnpm-workspace.yaml
├── turbo.json # turborepo for caching builds
├── tsconfig.base.json
├── packages/
│ ├── core/ # @ctok/core - pure TS engine (lifted from src/lib/)
│ ├── scanner/ # @ctok/scanner - filesystem scanner with smart excludes
│ ├── refiner/ # @ctok/refiner - heuristic prompt refiner (the killer feature)
│ ├── quota/ # @ctok/quota - Claude plan & quota tracker
│ ├── cli/ # @ctok/cli - Commander.js CLI + interactive REPL
│ ├── web/ # @ctok/web - Next.js web playground (ctok-cli.github.io/ctok)
│ ├── desktop/ # @ctok/desktop - Tauri wrapper around web UI
│ ├── mcp/ # @ctok/mcp - Model Context Protocol server
│ └── browser-ext/ # @ctok/browser-ext - Chrome MV3 extension
├── apps/ # ready for shells we don’t treat as libs
│ └── (vscode, jetbrains, raycast, … - Phase 2/3)
└── docs/ # docusaurus or astro site
Why monorepo: every shell imports @ctok/core directly. Bug in the estimator? Fix once, every shell gets it. New model price? Update core/pricing.ts, ship a patch. This is the only way to keep many shells in sync.
Package manager: pnpm + Turborepo. Faster than npm workspaces, better caching, supports the cross-package symlinks every shell needs.
| Current file | New location | Action |
|---|---|---|
types.ts |
core/src/types.ts |
Copy. Add RefinedPrompt, QuotaUsage, ProjectScan types. |
pricing.ts |
core/src/pricing.ts |
Copy. |
estimator/* |
core/src/estimator/* |
Copy unchanged. |
recommender/* |
core/src/recommender/* |
Copy unchanged. |
reducer/* |
core/src/reducer/* |
Copy unchanged. |
utils.ts→core/src/utils.ts- dropclsxandtailwind-mergeimports. KeepformatNumber,formatUsd,uid,clamp,truncate.store.ts→ DELETE. Zustand + localStorage is browser-only. Replace with a pure orchestrator:Returns a single object with// core/src/analyze.ts export function analyze(input: EstimatorInput): AnalysisResult { … }
{ tokens, cost, contextPct, recommendation, suggestions, refined }. Pure function. Every shell calls this.
core/src/quota.ts- given a plan name (pro/max5x/max20x/team/enterprise/api) and current estimated tokens, return{ percentOfDaily, percentOf5HourWindow, remaining, …}. Plan limits as a typed table (will need verification from Anthropic docs).core/src/scanner.ts- in@ctok/scanneractually; called from CLI/desktop. See §6.core/src/refiner.ts- in@ctok/refineractually; called from every shell. See §7.
A core differentiator. The user gestured at this specifically: "every JavaScript framework has node_modules… LLMs don't read it unless necessary." We must auto-exclude per language.
Walk up from cwd, look for marker files:
| Marker | Project type | Auto-excludes |
|---|---|---|
package.json |
Node/JS/TS | node_modules, .next, dist, build, .turbo, out, coverage, .cache, .vercel |
pubspec.yaml |
Flutter / Dart | build/, .dart_tool/, .flutter-plugins, .pub-cache |
Podfile or *.xcodeproj |
iOS | Pods/, DerivedData/, .build/, *.xcworkspace, xcuserdata/ |
build.gradle* or settings.gradle* |
Android / Gradle | build/, .gradle/, app/build/, local.properties |
Cargo.toml |
Rust | target/ |
go.mod |
Go | vendor/ (only if present) |
requirements.txt / pyproject.toml |
Python | __pycache__/, venv/, .venv/, env/, *.egg-info/, .pytest_cache, .mypy_cache |
Gemfile |
Ruby | vendor/, .bundle/ |
composer.json |
PHP | vendor/ |
pom.xml / build.gradle |
JVM | target/, .gradle/, out/ |
Package.swift |
Swift package | .build/, .swiftpm/ |
*.csproj / *.sln |
.NET | bin/, obj/ |
mix.exs |
Elixir | _build/, deps/ |
.git/, .svn/, .hg/, .DS_Store, Thumbs.db, *.lock, *.lock.json, package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, Podfile.lock, *.min.js, *.min.css, *.map, *.tsbuildinfo, binaries (detected by extension allowlist: text-only files).
- Respect
.gitignore- parse and apply. - Support
.ctokignore- same syntax as.gitignore, ctok-specific overrides. - Flag
--include node_modulesetc. for when user genuinely wants it.
type ProjectScan = {
root: string;
projectType: ProjectType;
totalFiles: number;
totalBytes: number;
estimatedTokens: number;
byExtension: Record<string, { files: number; tokens: number }>;
topHeavyFiles: Array<{ path: string; tokens: number }>;
excluded: { files: number; tokens: number; reasons: Record<string, number> };
};CLI can render this as a tree, a table, or JSON.
This is the killer feature. It must give the "best refinement and good approach to save tokens" (user's exact words). Engineer it as a serious multi-pass pipeline, not a regex hack.
// refiner/src/index.ts
export function refine(input: RefineInput): RefineResult {
const passes = [
pass.fillerStrip, // 7.2
pass.vagueVerbReplace, // 7.3
pass.structureScaffold, // 7.4
pass.dedup, // 7.5
pass.fileRefCompression, // 7.6
pass.outputFormatHint, // 7.7
pass.negativeCollapse, // 7.8
pass.specificityScore, // 7.9
];
…
return { original, refined, passes: appliedPasses, savedTokens, savedPct, specificityScore, warnings };
}Curated regex list of low-signal phrases. Conservative - only strip when surrounding sentence still parses:
please,kindly,if you can,if possible,i was wondering,could you,would you mindmake sure,be sure to,it's important that,it would be great ifvery,really,quite,just,actually,basically,essentiallyas you know,as i mentioned,for your information,feel free toi think,i believe,i feel like,in my opinion
Each removal records token savings.
Maintain a dictionary mapping vague verbs to better alternatives with context awareness:
| Vague | Replace with (suggested) |
|---|---|
handle X |
validate / persist / transform / dispatch X (offer top 3 by context keywords) |
deal with X |
same as above |
work on X |
implement / refactor / debug X |
improve X |
optimize / refactor / extend / clarify X |
fix it |
name the symptom + expected behavior |
make it better |
name a measurable axis (performance? readability?) |
something like X |
concrete example |
etc. / and so on |
list explicitly OR drop |
The refiner suggests - never silently rewrites. User chooses to accept (interactive CLI/Web UI) or accepts all (--auto).
If the prompt has no clear structure, suggest restructuring into:
GOAL: <one sentence, imperative>
CONTEXT: <what the AI needs to know>
CONSTRAINTS: <bullets>
OUTPUT: <format expected>
Detection: prompts that are ≥3 sentences AND lack any heading/colon-prefixed sections.
Token savings: typically negative on tiny prompts, positive on long rambling ones because it forces the user to delete redundant context.
Fingerprint each "paragraph" or pasted block. If two blocks have ≥80% shingle overlap, flag the duplicate. Common cases:
- Same stack trace pasted twice.
- Same file content pasted in "context" and "the code".
- Repeated descriptions of the same problem.
If the prompt contains a code block ≥300 tokens AND the user is in a project (scanner ran), suggest replacing the pasted code with a reference: see src/foo.ts:42-90. Claude Code can read it directly; saves the pasted tokens entirely.
Detect missing output spec. If the prompt asks for code/data/list but doesn't say how to return it, suggest adding Return only the diff / Return as JSON: {…} / Return a numbered list. Output constraints cut output tokens dramatically.
don't do X, don't do Y, don't do Z → bulleted Do NOT:\n- X\n- Y\n- Z. Same tokens, but clearer to the model, often improves output quality enough to avoid a retry.
A composite score reflecting how well-formed the final prompt is:
- +20 has explicit goal verb
- +15 names concrete entities (files, functions, fields)
- +15 has measurable success criterion
- +15 has output format spec
- +10 lists constraints
- +10 names what NOT to do (when relevant)
- +15 references existing code paths instead of pasting
Show score before/after refinement. This becomes a shareable metric and a social hook ("My prompt scored 38 → 82 - saved 4,200 tokens with ctok 🚀").
Build a refiner test corpus under packages/refiner/test/corpus/ with ~50 real prompts and their expected refinements. Run on every PR. This is what guarantees quality over time.
Sources to seed the corpus:
- Anthropic Cookbook examples
- Public Claude prompt-engineering guides
- Synthetic "bad prompts" (vague, rambling, redundant)
- Real prompts the user wants to refine (collected from session history)
ctok # Interactive REPL - prompt for input, scan cwd, full report
ctok check "<prompt>" # One-shot estimate; reads stdin if "<prompt>" is "-"
ctok check -f prompt.md # Read prompt from file
ctok scan # Scan cwd, show token map + heavy files (no prompt needed)
ctok scan --json # Same, JSON output (for piping)
ctok refine "<prompt>" # Run refiner only; print refined version + savings
ctok refine -i # Interactive: each suggestion → accept/reject
ctok model "<prompt>" # Print recommended model + effort + why
ctok serve [--port 31337] # Launch local web UI (the existing Next.js app)
ctok history # Show last N estimations
ctok history --csv # Export to CSV
ctok diff <id1> <id2> # Compare two history entries
ctok config # Open config in $EDITOR
ctok config set plan max20x # Set plan
ctok config get plan # Read plan
ctok init # Generate .ctokignore + CLAUDE.md template
ctok doctor # Diagnose install - node version, plan config, claude home detection
ctok --version
ctok --help
- Default: pretty TTY output (tables, colors, sparklines via
chalk+cli-table3+ora). --jsonflag on every command → machine-readable for piping.--quiet→ only critical warnings.--no-color→ CI-friendly.
- Commander.js - command/flag parser. Familiar, stable.
- Prompts (by terkelg) - interactive prompts.
- Chalk - colors.
- cli-table3 - tables.
- Ora - spinners.
- fast-glob - file walking (scanner).
- ignore (npm package) -
.gitignoreparser.
| Channel | Audience | Implementation |
|---|---|---|
npm i -g @ctok/cli |
Node users | publish to npm |
| Standalone .exe / .dmg / AppImage / .deb / .rpm | non-Node users | pkg or bun build --compile; attach to GitHub Releases |
brew install ctok |
macOS power users | Homebrew formula in homebrew-ctok tap |
scoop install ctok |
Windows power users | Scoop bucket |
winget install ctok |
Windows modern | winget manifest |
curl ctok-cli.github.io/ctok/install.sh | sh |
Linux/macOS one-liner | shell installer that detects OS/arch and pulls right binary |
iwr ctok-cli.github.io/ctok/install.ps1 | iex |
Windows PowerShell one-liner | PS installer |
Reuse 95% of the current Next.js code. Changes:
- Delete the project-upload UI (don't ask users to upload folders).
- Add prompt + optional file-content textarea. Hosted version is for prompt analysis, not project analysis.
- Replace direct calls to
lib/*with imports from@ctok/coreand@ctok/refiner. - Add a public showcase page with examples (the 5 scenarios already in README.md).
- Deploy to Vercel at ctok-cli.github.io/ctok (or whatever domain is available; verify before purchase).
- Include a
<CLIPrompt>banner: "For full project analysis install the CLI:npm i -g @ctok/cli".
Tech stays: Next.js App Router + Tailwind + the existing components. Drop Zustand + localStorage entirely (replace with React state + URL hash for shareable analyses).
- Tauri 2.x (Rust-based shell, ~10 MB installer, secure, cross-platform). Bundles the React UI from
packages/web(extracted into a static export) inside a native window. - Adds local FS access (drag-drop project folder → uses
@ctok/scannernatively). - Distributes signed installers via GitHub Releases (
.exewith code signing cert,.dmgnotarized,.AppImage+.deb+.rpm). - Auto-updater via Tauri's built-in updater.
Why Tauri over Electron: 10MB vs 150MB+, faster startup, lower memory, fewer "Electron is bloat" complaints.
Implements Model Context Protocol server. Exposes tools:
estimate(prompt, files?)→AnalysisResultrefine(prompt)→RefineResultrecommend_model(prompt)→{ model, effort, reasoning }scan_project(path)→ProjectScan
Distribute via npm: npx -y @ctok/mcp. Users add one entry to their Claude Code / Cursor / Zed config:
{
"mcpServers": {
"ctok": { "command": "npx", "args": ["-y", "@ctok/mcp"] }
}
}Submit to MCP registry and Anthropic's MCP directory. Strong distribution lever - every Claude Code user is a target.
- Manifest V3, vanilla TS + Preact (~10kb runtime).
- Content scripts on
claude.ai/*,chat.openai.com/*,cursor.sh/*. - Reads the textarea, runs
@ctok/coreanalysis in-extension (no API calls - fully offline). - Floating widget shows live token count, estimated cost, refiner suggestions on click.
- Publish to Chrome Web Store, Edge Add-ons, Firefox AMO.
Each step is small enough to finish in one focused conversation with Sonnet 4.6 at medium effort. Steps are ordered so each depends only on prior steps.
Step 1 - Restructure repo into pnpm workspaces monorepo.
- Add
pnpm-workspace.yaml,turbo.json, rootpackage.jsonwith workspaces. - Create
packages/core/,packages/cli/,packages/web/,packages/refiner/,packages/scanner/,packages/quota/,packages/mcp/,packages/desktop/,packages/browser-ext/directories with placeholderpackage.jsoneach. - Move existing Next.js code into
packages/web/. - Verify
pnpm install+pnpm -F @ctok/web devstill serves the old UI onlocalhost:3000.
Step 2 - Extract @ctok/core.
- Copy
src/lib/types.ts,pricing.ts,estimator/*,recommender/*,reducer/*intopackages/core/src/. - Strip clsx/twMerge from
utils.ts. - Delete
store.ts- write newpackages/core/src/analyze.tswith pureanalyze(input)orchestrator. - Configure tsup or unbuild to emit ESM + CJS + d.ts.
- Write Vitest unit tests for
analyze()covering the 5 scenarios from README.md. - Make
@ctok/webimport from@ctok/coreinstead of its ownlib/. Web UI must still work identically.
Step 3 - Build @ctok/scanner.
- Implement project-type detection from §6.1.
- Implement universal + per-type excludes from §6.1-6.2.
- Wire
.gitignoreparsing viaignorepackage. - Read
.ctokignoreif present. - Use
fast-globfor fs walk. - Return
ProjectScanshape from §6.4. - Tests: fixture projects under
packages/scanner/test/fixtures/(a fake Node project, Flutter project, iOS project, Android project, Rust project). Assert counts/excludes.
Step 4 - Build @ctok/refiner - pipeline + first 4 passes (filler, vague-verb, structure, dedup).
- Pipeline scaffold in
packages/refiner/src/index.ts. - Each pass is its own file under
packages/refiner/src/passes/. - Seed test corpus with ~15 prompts in
packages/refiner/test/corpus/. - Snapshot tests on the refined output (CI fails if output drifts unexpectedly).
Step 5 - @ctok/refiner - remaining 4 passes (file-ref compression, output-format hint, negative collapse, specificity score).
- Implement the four passes.
- Expand corpus to ~35 prompts.
- Tune until specificity score correlates with token savings (sanity-check on corpus).
Step 6 - Build @ctok/quota.
- Maintain a typed table of Claude plan limits (Pro / Max5x / Max20x / Team / Enterprise / API). Verify exact numbers from Anthropic docs before publish.
- Attempt to detect user's plan from
~/.claude/config files (if present); else fall back to user config. - Function:
getQuotaImpact(estimatedTokens, model, effort, plan)→{ percentOfDailyBudget, percentOf5HourWindow, …}. - Conservative: print "estimated" disclaimers everywhere because exact remaining quota isn't reliably exposed today.
Step 7 - Build @ctok/cli MVP.
- Wire Commander.js commands from §8.1.
- Implement:
check,scan,refine,model,history,config,init,doctor,--version,--help. - Implement REPL when invoked without args.
- All commands call
@ctok/core,@ctok/scanner,@ctok/refiner,@ctok/quota. - Pretty TTY output via chalk + cli-table3 + ora.
--jsonflag for piping.- Test on Windows PowerShell, cmd, WSL, macOS zsh, Linux bash.
Step 8 - CLI binary packaging.
- Configure
pkg(orbun build --compile) to emitctok.exe,ctok-macos-arm64,ctok-macos-x64,ctok-linux-x64,ctok-linux-arm64. - Set up GitHub Actions workflow
release.ymlthat onv*tag: builds all binaries, signs the Windows one (code sign cert needed; for MVP can ship unsigned with warning), notarizes the macOS ones, attaches to GitHub Release. - Write
install.shandinstall.ps1that detect OS/arch and download the right binary into~/.ctok/bin/. - Create Homebrew tap
ctok-cli/homebrew-ctokand Scoop manifest. Submit winget manifest.
Step 9 - Repurpose @ctok/web as the public playground.
- Strip project-upload UI (keep file-paste only).
- Add landing page hero + 5 example scenarios.
- Add "Install the CLI" banner.
- Switch state from Zustand+localStorage to React state + URL hash (for shareable links).
- Deploy to Vercel under
ctok-cli.github.io/ctok. Use AI Gateway if/when we add LLM refiner in Phase 2 (per session knowledge update; default"provider/model"strings).
Step 10 - Build @ctok/mcp.
- Implement MCP server with the 4 tools listed in §11.
- Test against Claude Code locally: add it to
~/.claude.json, verify tools appear. - Publish to npm as
@ctok/mcpso users cannpx -y @ctok/mcpfrom their MCP config. - Submit to MCP registry.
Step 11 - Build @ctok/desktop (Tauri).
- Scaffold Tauri 2 project pointing at the static export of
@ctok/web. - Add native drag-drop folder → invoke scanner via a Tauri command (Rust) that shells out to bundled Node, OR (cleaner) port
@ctok/scannerinvocations through Tauri's Rust fs APIs directly. - Configure Tauri's auto-updater.
- Set up GitHub Actions to build & sign installers for Windows, macOS, Linux.
Step 12 - Build @ctok/browser-ext.
- Manifest V3 + Preact.
- Content scripts on
claude.ai/*,chat.openai.com/*,cursor.sh/*,chat.deepseek.com/*,gemini.google.com/*. - Floating overlay widget showing live token count + cost + "Refine" button.
- Submit to Chrome Web Store, Edge Add-ons, Firefox AMO.
Step 13 - Launch prep.
- Polish docs site (Astro Starlight or Docusaurus) under
docs/. - Record 60-second demo video.
- Write launch posts: HN, Product Hunt, r/programming, r/ClaudeAI, dev.to, Twitter/X.
- Set up GitHub issue templates, contributing guide, code of conduct.
- Install scripts (
install.sh,install.ps1) - OS/arch-detecting one-liners. - Add anonymous opt-in telemetry skeleton (PostHog or Plausible) - disabled by default.
- VS Code extension (~3 days using
@ctok/coredirectly). - JetBrains plugin (covers Android Studio, IntelliJ, AppCode, WebStorm - ~5 days, Kotlin + bundled Node).
- GitHub Action (~1 day; wraps the CLI in a
node20action). - Raycast extension (~1 day).
- Slack bot (~3 days).
- Discord bot (~3 days).
- Optional LLM-powered refiner mode (
ctok refine --llm) - adds Anthropic API call via Vercel AI Gateway, user supplies key. - Xcode source editor extension (~5 days; Swift wrapper that pipes to bundled CLI).
- Neovim plugin + Zed extension (~2 days each).
- Vitest unit tests in every package. Target ≥85% coverage on
core,refiner,scanner,quota. - Refiner corpus tests - snapshot the refined output for ~50 real prompts. PR-blocking.
- CLI integration tests - spawn the built CLI binary in a test fixture project, assert exit code + stdout snapshot.
- Cross-platform CI - GitHub Actions matrix: Windows / macOS-13 / macOS-14 / Ubuntu / on Node 20 + 22 + 24.
- Manual QA checklist for shells without robust automation (desktop, browser ext).
- Every command shows progress (ora spinner) for anything >200ms.
- Errors are helpful, never stack-trace dumps. Use a custom error class with
code,message,hint. --debugprints internals; otherwise silent on success.- Zero color noise - colors only for status (green ok, yellow warn, red danger).
ctok doctoris a first-class debugging entry point.
- No telemetry in MVP. Add opt-in later.
- No network calls in MVP other than
ctok serve(localhost) and binary auto-update checks. - Refiner is fully offline.
- Quota detection reads
~/.claude/config only if present, never uploads it. - Browser extension: zero remote calls.
- Sign installers properly before launch (Windows: real code-sign cert; macOS: notarize via Apple Developer ID).
Phase 1 launch: 100% free, MIT. Phase 2 freemium tier (after ≥1k stars or ≥10k weekly downloads - whichever first):
- Free forever: CLI, web, desktop, MCP, browser ext, IDE extensions, heuristic refiner.
- Pro ($5-8 / mo): LLM-powered refiner with ctok-hosted API (no key needed), cloud history sync, team budgets, Slack alerts on budget burn.
- Team ($15 / user / mo): org dashboards, SSO, audit logs, shared CLAUDE.md templates.
- Use Vercel AI Gateway for hosted LLM-refiner inference.
| Risk | Mitigation |
|---|---|
| Tokenizer accuracy drift as Anthropic models change | core/estimator/tokenize.ts is one function; swap in count_tokens API call when stable. |
| Refiner output feels generic / unhelpful | Refiner test corpus + specificity score guardrails + dogfood internally. |
| Plan/quota numbers wrong (Anthropic doesn't publish hard limits) | Print "estimated" everywhere; let users override. |
| Windows code-signing cost ($300/yr) | Ship unsigned with SmartScreen warning at first; buy cert when revenue justifies. |
| macOS notarization friction | Apple Developer Program ($99/yr) required Day 1 for desktop app. |
| MCP API changes pre-1.0 | Pin to current MCP SDK version; update on each spec release. |
| User confusion over many shells | Single docs site, single brand, single command name (ctok). |
| Audit: Vercel CLI is not installed locally | Install before deploying web: npm i -g vercel (per session knowledge update). |
Run on a fresh Windows 11 box, a fresh macOS box, and a fresh Ubuntu box:
- CLI install.
npm i -g @ctok/cli && ctok --versionshows version.ctok doctorreports green. - Project scan.
cdinto a real Flutter project, runctok scan. Confirmbuild/,.dart_tool/,.pub-cacheexcluded; lib/ included. - Prompt estimate.
ctok check "refactor the auth middleware to use Postgres sessions"shows tokens, cost, model recommendation, effort recommendation. - Refine.
ctok refine "please can you kindly help me to handle the auth thing somehow"outputs a cleaned-up version + specificity score before/after + token savings. - Web. Open
ctok-cli.github.io/ctok, paste same prompt, identical recommendation appears. - Desktop. Install signed installer, drag-drop the Flutter project, confirm identical scan results.
- MCP. Add to Claude Code config, restart, ask Claude to "estimate tokens for this prompt" - confirms tool is callable.
- Browser ext. Open
claude.ai, start typing in the prompt box, confirm overlay shows live token count.
If all 8 pass on all 3 OSes → ship.
- Use the existing GitHub repo (or rename to
ctok). - One issue per numbered Step (1-13). Label
phase-1/phase-2/phase-3. - Project board: To Do / In Progress / Review / Done.
- Each PR closes its Step issue.
- Cut a release after each step group:
v0.1.0after Step 6 (engine),v0.2.0after Step 10 (CLI + MCP + web),v1.0.0after Step 13 (launch).
When you start executing with Sonnet+medium, the very first turn should accomplish Step 1 only:
Restructure the current
D:\ClaudeTokenChekerdirectory into a pnpm workspaces monorepo. Addpnpm-workspace.yaml,turbo.json, a rootpackage.jsonwith workspaces config. Move the existing Next.js code intopackages/web/. Create empty placeholderpackage.jsonfiles inpackages/core/,packages/cli/,packages/refiner/,packages/scanner/,packages/quota/,packages/mcp/,packages/desktop/,packages/browser-ext/. Verify thatpnpm installsucceeds andpnpm -F @ctok/web devserves the existing UI onlocalhost:3000unchanged.
Each subsequent turn should pick up the next numbered Step from §13. Mark each Step done by closing the corresponding GitHub issue and updating this file's checkboxes:
- Step 1 - Monorepo restructure
- Step 2 - Extract
@ctok/core - Step 3 - Build
@ctok/scanner - Step 4 - Refiner pipeline + 4 passes
- Step 5 - Refiner remaining 4 passes
- Step 6 - Build
@ctok/quota - Step 7 - CLI MVP
- Step 8 - CLI binary packaging
- Step 9 - Web playground
- Step 10 - MCP server
- Step 11 - Desktop (Tauri)
- Step 12 - Browser extension
- Step 13 - Launch prep
This plan is the single source of truth. Update it as Steps complete or scope changes.