{"id":29890643,"url":"https://github.com/forketyfork/claude-nein","last_synced_at":"2026-05-08T14:31:52.030Z","repository":{"id":305859723,"uuid":"1023664198","full_name":"forketyfork/claude-nein","owner":"forketyfork","description":" A native macOS menu bar application that monitors your Claude Code spending in real-time","archived":false,"fork":false,"pushed_at":"2025-12-26T05:53:29.000Z","size":10284,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T02:36:12.095Z","etag":null,"topics":["claude-code","macos-app","spending-tracker"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forketyfork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-07-21T13:57:55.000Z","updated_at":"2025-12-25T21:38:43.000Z","dependencies_parsed_at":"2025-07-22T11:44:05.289Z","dependency_job_id":"39c0e090-13e8-4109-9713-11f9df021536","html_url":"https://github.com/forketyfork/claude-nein","commit_stats":null,"previous_names":["forketyfork/claude-nein"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/forketyfork/claude-nein","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forketyfork%2Fclaude-nein","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forketyfork%2Fclaude-nein/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forketyfork%2Fclaude-nein/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forketyfork%2Fclaude-nein/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forketyfork","download_url":"https://codeload.github.com/forketyfork/claude-nein/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forketyfork%2Fclaude-nein/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32784339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","macos-app","spending-tracker"],"created_at":"2025-08-01T00:00:49.183Z","updated_at":"2026-05-08T14:31:52.021Z","avatar_url":"https://github.com/forketyfork.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"images/icon.png\" width=\"5%\"\u003e Claude Nein - Claude Code Spend Monitor\n\n[![Build status](https://github.com/forketyfork/claude-nein/actions/workflows/build.yml/badge.svg)](https://github.com/forketyfork/claude-nein/actions/workflows/build.yml)\n[![Latest Release](https://img.shields.io/github/v/release/forketyfork/claude-nein)](https://github.com/forketyfork/claude-nein/releases/latest)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![TypeScript](https://img.shields.io/badge/language-Swift-orange.svg)](https://www.swift.org/)\n\nA native macOS menu bar application that monitors your Claude Code spending in real-time, providing intuitive visual feedback and detailed breakdowns. Inspired by [ccusage](https://github.com/ryoppippi/ccusage/).\n\n\u003cimg src=\"images/ClaudeNein1.png\" width=\"40%\"\u003e \u003cimg src=\"images/ClaudeNein2.png\" width=\"40%\"\u003e\n\n## Overview\n\nClaude Nein lives in your macOS menu bar, keeping you constantly updated on your Claude Code API usage costs. It automatically discovers your Claude project log files, parses them efficiently, and presents a clear summary of your spending.\n\n## Installation\n\n1. Visit the [Releases](https://github.com/forketyfork/claude-nein/releases) page and download the `ClaudeNein-\u003cversion\u003e-unsigned.zip` asset from the latest release.\n2. Unzip the archive and move `ClaudeNein.app` to your `/Applications` folder.\n3. Reset the quarantine flag on the app: `xattr -d com.apple.quarantine /Applications/ClaudeNein.app`\n4. Open the app. On first run, the app will ask you for access to the Claude directories.\n\n## Features\n\n- **Real-Time Menu Bar Display** – today's spend appears in the menu bar and animates smoothly when the value changes.\n- **Detailed Spend Summaries** – the dropdown menu shows totals for today, this week and this month.\n- **Model‑Specific Costs** – see which models account for the most spend.\n- **Automatic \u0026 Efficient Monitoring** – uses FSEvents to watch Claude log files with minimal overhead.\n- **Persistent Data Storage** – usage is cached locally in Core Data so data survives restarts.\n- **Run at Startup Option** – enable automatic launch when you log in.\n- **Database Management** – built in \"Reload Database\" command clears and reloads cached usage.\n- **Spend Graphs** – interactive graph view showing spending trends by day, month, or year with navigation controls and switchable plot types (bar and cumulative).\n- **Secure \u0026 Private** – all processing happens on your Mac; the only network request fetches pricing information.\n- **Claude Directory Access Control** – you explicitly grant and revoke access only to the Claude log directories.\n- **Up‑to‑Date Pricing** – pricing data is pulled from LiteLLM with cached and bundled fallbacks, and the current data source is displayed in the menu.\n- **Comprehensive Logging** – centralized logging system for debugging and monitoring app behavior.\n\n## How It Works\n\n1.  **Permissions** – on first launch you grant read‑only access to the `~/.claude` and `~/.config/claude` directories via a clear Yes/No dialog.\n2.  **File Monitoring** – the app searches `~/.claude/projects` and `~/.config/claude/projects` for `.jsonl` logs and monitors them with FSEvents.\n3.  **Parsing** – changed files are parsed and deduplicated, extracting model names, timestamps and token counts including cache tokens.\n4.  **Data Storage**: Parsed usage entries are stored in a local Core Data database with intelligent deduplication to prevent duplicate entries.\n5.  **Cost Calculation**: Using the latest pricing data, it calculates the cost for each entry and aggregates spending data from the database.\n6.  **UI Update**: It displays the aggregated costs in the menu bar and detailed dropdown menu, with real-time updates as new data arrives.\n\n## Running From Sources\n\n1. Open `ClaudeNein.xcodeproj` in Xcode (15 or later).\n2. Select the **ClaudeNein** scheme.\n3. Build and run the project to launch the menu bar app.\n4. To run the unit tests use `xcodebuild test -scheme ClaudeNein -destination 'platform=macOS'`.\n\n## Technical Details\n\n-   **Language**: Swift\n-   **Framework**: SwiftUI for UI components, AppKit for menu bar integration\n-   **Platform**: macOS (menu bar app)\n-   **Data Storage**: Core Data for persistent local storage\n-   **Architecture**: The app runs as a background agent (`NSStatusItem`) managed by a central `MenuBarManager` class. It uses:\n    - `FileMonitor` for observing file system changes with FSEvents\n    - `DataStore` for Core Data persistence and spend calculations\n    - `PricingManager` for fetching and caching model pricing data\n    - `HomeDirectoryAccessManager` for handling secure file access permissions\n    - `GraphRenderer` for modular graph rendering with multiple plot types\n    - `SpendGraphView` for interactive spending visualization\n\n### Data Source\n\nThe app monitors Claude Code `.jsonl` files located in your Claude configuration directories, for example:\n\n- `~/.claude/projects/`\n- `~/.config/claude/projects/`\n\n### Project Structure\n\nThe project is organized as follows:\n\n```\nClaudeNein/\n├── ClaudeNeinApp.swift              # Main app entry point with MenuBarManager\n├── Models.swift                     # Data models (UsageEntry, SpendSummary, etc.)\n├── DataStore.swift                  # Core Data persistence layer for usage entries\n├── Model.xcdatamodeld/              # Core Data model definition\n├── FileMonitor.swift                # Monitors the file system for log changes\n├── HomeDirectoryAccessManager.swift # Handles permissions for home directory access\n├── DirectoryAccessManager.swift     # Additional directory access management\n├── SpendCalculator.swift            # Calculates spend totals and breakdowns\n├── PricingManager.swift             # Fetches and manages model pricing data\n├── JSONLParser.swift                # Parses `.jsonl` log files\n├── LiteLLMParser.swift              # Parses pricing data from LiteLLM source\n├── LaunchAtLoginManager.swift       # Manages launch at login functionality\n├── SpendGraphView.swift             # SwiftUI view for spending graphs\n├── GraphRenderer.swift              # Modular graph rendering system\n├── AboutView.swift                  # About dialog with app information\n├── Logger.swift                     # Centralized logging system\n└── Assets.xcassets/                 # App icons and assets\n```\n\n## Privacy \u0026 Security\n\nClaude Nein is designed with privacy as a priority:\n\n-   **Local Processing**: All log file parsing and calculations happen on your Mac.\n-   **Local Data Storage**: Usage data is stored locally in a Core Data database on your machine.\n-   **No Data Transmission**: No usage data or personal information is ever sent to any external server.\n-   **Limited Permissions**: The app only requests the read-only permissions necessary to access Claude's log files.\n-   **Transparent Pricing Updates**: The only network request made is to the public LiteLLM GitHub repository to fetch `model_prices_and_context_window.json`.\n\n## Contributing\n\nContributions are welcome! Please feel free to open an issue or submit a pull request.\n\n## Disclaimer\n\nThis is an unofficial, third-party application and is not affiliated with, authorized, or endorsed by Anthropic. Use at your own risk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforketyfork%2Fclaude-nein","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforketyfork%2Fclaude-nein","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforketyfork%2Fclaude-nein/lists"}