agentleFS
flipaceflipace/claudit/CLAUDE.md

claudit

CLAUDE.md9 starsChanged 11 months agoMITView on GitHub

A native desktop application that provides real-time usage analytics for Claude Code. Currently available for macOS only. Note: This project was mostly coded by Claude Code itself. Claudit runs an HTTP server on localhost:3456 that receives events from Claude Code hooks. Supported Events: API Endpoints: Payload Schema: Claude Code Settings Hook Config:

  • Installs packages
  • Sends data out
  • Commits and pushes

The file

We split this CLAUDE.md into the rules it gives an agent

10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Port Fallback: If port 3456 is busy, the server tries ports 3457-3466.

    line 134
  2. Very specific:

    Add the command in src-tauri/src/lib.rs:

    line 173
  3. Very specific:

    When matching project folders to paths from ~/.claude.json, use encode_path_to_folder():

    line 238
  4. Very specific:

    Use cn() for conditional classnames

    line 248
  5. Distinctive:

    Keep components simple and composable

    line 249
  6. Distinctive:

    2-column master-detail: Use for items with content to preview (agents, commands)

    line 264
  7. Distinctive:

    Card grid: Use for items without preview content (MCP servers, plugins)

    line 269
  8. Very specific:

    Commit with message: Release vX.Y.Z

    line 288
  9. Very specific:

    Create and push git tag: git tag vX.Y.Z && git push origin vX.Y.Z

    line 290
  10. Very specific:

    Add these to your ~/.claude/settings.json for faster Tauri development:

    line 294

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Claudit - Claude Code Usage Monitor

A native desktop application that provides real-time usage analytics for Claude Code. Currently available for macOS only.

Note: This project was mostly coded by Claude Code itself.

Tech Stack

  • Framework: Tauri 2 (Rust backend + webview)
  • Frontend: React 18, Vite, TypeScript
  • Styling: Tailwind CSS 3
  • Charts: Recharts
  • Data Fetching: TanStack Query
  • Animations: Motion (import from "motion/react")
  • Icons: Lucide React

Commands

pnpm install        # Install dependencies
pnpm dev           # Run in development mode
pnpm build         # Build for production

Project Structure

claudit/
├── packages/
│   └── frontend/           # React frontend
│       └── src/
│           ├── domains/    # Feature-based organization
│           │   ├── analytics/   # Dashboard with charts & stats
│           │   ├── settings/    # App preferences UI
│           │   ├── projects/    # Project browser & AI suggestions
│           │   ├── agents/      # Claude agents browser
│           │   ├── plugins/     # Claude plugins browser
│           │   ├── config/      # Claude config viewer
│           │   ├── analysis/    # Deep usage analysis
│           │   ├── backup/      # Backup management
│           │   └── shared/      # Shared components
│           ├── components/      # Reusable UI components
│           └── lib/             # Utilities
├── src-tauri/              # Rust backend
│   └── src/
│       ├── services/       # Core services
│       │   ├── usage.rs    # JSONL parsing
│       │   ├── analytics.rs # Stats calculation
│       │   ├── hooks.rs    # HTTP server for hooks
│       │   ├── settings.rs # Preferences
│       │   └── config.rs   # Claude config & project management
│       ├── tray.rs         # System tray menu
│       └── lib.rs          # Main entry & Tauri commands
├── landing/                # Landing page (claudit.cloud.neschkudla.at)
└── scripts/                # Build utilities (icon generation, local release)

Architecture

Data Flow

  1. Claude Code writes usage data to ~/.claude/projects/**/*.jsonl
  2. UsageReader parses JSONL files and deduplicates entries
  3. AnalyticsService calculates stats, costs, burn rates
  4. Tray menu displays live stats, updates every 30s
  5. Analytics window shows interactive charts

Hook System

Claudit runs an HTTP server on localhost:3456 that receives events from Claude Code hooks.

Supported Events:

EventTriggerPurpose
StopClaude finishes main responseTriggers notification
SubagentStopSubagent finishesTriggers notification
PostToolUseAfter tool executionGranular tracking (Bash only)

API Endpoints:

# Health check
curl http://localhost:3456/
# Response: {"status":"ok"}

# Send hook event
curl -X POST http://localhost:3456/hook \
  -H "Content-Type: application/json" \
  -d '{"event": "Stop"}'
# Response: {"success":true}

Payload Schema:

interface HookEvent {
  event: "Stop" | "SubagentStop" | "PostToolUse" | "PreToolUse" | "UserPromptSubmit";
  tool?: string;      // Tool name (for PostToolUse)
  context?: string;   // Optional context
  timestamp?: string; // ISO timestamp
}

Claude Code Settings Hook Config:

{
  "hooks": {
    "Stop": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "curl -s -X POST http://localhost:3456/hook -H \"Content-Type: application/json\" -d '{\"event\": \"Stop\"}' > /dev/null 2>&1 &"
      }]
    }],
    "SubagentStop": [{
      "matcher": "*",
      "hooks": [{
        "type": "command",
        "command": "curl -s -X POST http://localhost:3456/hook -H \"Content-Type: application/json\" -d '{\"event\": \"SubagentStop\"}' > /dev/null 2>&1 &"
      }]
    }],
    "PostToolUse": [{
      "matcher": "Bash",
      "hooks": [{
        "type": "command",
        "command": "curl -s -X POST http://localhost:3456/hook -H \"Content-Type: application/json\" -d \"{\"event\": \"PostToolUse\", \"tool\": \"$CLAUDE_TOOL_NAME\"}\" > /dev/null 2>&1 &"
      }]
    }]
  }
}

Port Fallback: If port 3456 is busy, the server tries ports 3457-3466.

Token Pricing (per 1M tokens)

  • claude-sonnet-4: $3 input, $15 output
  • claude-opus-4: $15 input, $75 output
  • Other models: $3 input, $15 output (default)

Features

Core Analytics

  • Real-time token consumption in menu bar
  • Cost tracking with burn rate ($/hour)
  • 5-hour session block tracking
  • Per-project and per-model breakdowns
  • Analytics dashboard with interactive charts
  • Notifications when Claude finishes responding

Project Management

  • Browse all Claude Code projects with usage stats
  • View CLAUDE.md content with markdown rendering
  • Browse project-specific commands and MCP servers
  • AI Suggestions: Get Claude-powered suggestions to improve project workflow
  • Set custom project images
  • One-click open in Finder or editor

Configuration Browser

  • View and explore Claude config (~/.claude.json)
  • Browse installed agents (global and project-specific)
  • Browse installed plugins with marketplace info
  • Deep analysis of usage patterns

Backup & Export

  • Backup Claude configuration and history
  • Export usage data for analysis

Key Patterns

Adding a Tauri command

  1. Add the command in src-tauri/src/lib.rs:
#[tauri::command]
fn my_command(arg: String) -> Result<String, String> {
    Ok(format!("Hello {}", arg))
}
  1. Register it in the invoke handler:
.invoke_handler(tauri::generate_handler![greet, my_command])
  1. Call from frontend:
import { invoke } from "@tauri-apps/api/core";
const result = await invoke<string>("my_command", { arg: "world" });

Window dragging (frameless window)

The header is set up for window dragging in Tauri. The headerRef and mouse handlers in App.tsx enable:

  • Click and drag to move window
  • Double-click to toggle maximize
  • Buttons/inputs are excluded from drag behavior

System tray

The tray is configured in src-tauri/src/tray.rs:

  • Live stats display (tokens, costs, burn rate)
  • Click "Analytics" or Cmd+A to open dashboard
  • App minimizes to tray when closed (doesn't quit)

JSONL Entry Format

Each line in the JSONL files has this structure:

{
  "type": "assistant",
  "timestamp": "2024-01-01T12:00:00Z",
  "sessionId": "session-id",
  "message": {
    "role": "assistant",
    "model": "claude-sonnet-4-20250514",
    "usage": {
      "input_tokens": 1000,
      "output_tokens": 500,
      "cache_creation_input_tokens": 0,
      "cache_read_input_tokens": 200
    }
  },
  "uuid": "unique-id"
}

Project Folder Encoding

Claude Code stores JSONL files in ~/.claude/projects/{encoded-path}/. The encoding:

  • / is replaced with -
  • Literal - in paths are NOT escaped (encoding is lossy/ambiguous)

Examples:

  • /Users/foo/project → -Users-foo-project
  • /Users/foo-bar/project → -Users-foo-bar-project (ambiguous with /Users/foo/bar/project)

When matching project folders to paths from ~/.claude.json, use encode_path_to_folder():

fn encode_path_to_folder(path: &str) -> String {
    path.replace('/', "-")
}

Style Guide

  • Dark theme by default
  • Use cn() for conditional classnames
  • Keep components simple and composable
  • Glassy/frosted look: bg-zinc-900/50 backdrop-blur-sm border border-zinc-800/50

Icon Color Conventions

Entity TypeColorUsage
Commands/Terminaltext-emerald-500Action-oriented items, slash commands
Agents/Botstext-primaryPrimary feature (Bot icon)
MCP Serverstext-blue-500Infrastructure/services (Server icon)
Plugins (enabled)text-emerald-500Active state
Projects/Folderstext-amber-500Directories, project folders

Layout Patterns

2-column master-detail: Use for items with content to preview (agents, commands)

  • Left panel: w-80 shrink-0 border-r border-border
  • Right panel: flex-1 min-w-0 flex flex-col bg-zinc-900/30
  • List items: gap-3 p-3 rounded-lg bg-zinc-900/50 border border-zinc-800/50

Card grid: Use for items without preview content (MCP servers, plugins)

  • Grid: grid gap-3 md:grid-cols-2
  • Cards: p-4 rounded-lg bg-zinc-900/50 border border-zinc-800/50

Tab styling: bg-zinc-800/50 rounded-lg p-0.5 container with active state bg-primary text-primary-foreground

Release Checklist

IMPORTANT: Always update ALL changelogs when releasing a new version!

  1. Update version in:
    • package.json
    • src-tauri/Cargo.toml
    • src-tauri/tauri.conf.json
  2. Update changelogs:
    • CHANGELOG.md (project root)
    • landing/changelog.html (landing page - add new release section)
  3. Commit with message: Release vX.Y.Z
  4. Create and push git tag: git tag vX.Y.Z && git push origin vX.Y.Z

Claude Code Allowed Tools

Add these to your ~/.claude/settings.json for faster Tauri development:

{
  "permissions": {
    "allow": [
      "Bash(cargo build:*)",
      "Bash(cargo run:*)",
      "Bash(cargo check:*)",
      "Bash(cargo clean:*)",
      "Bash(pnpm tauri dev:*)",
      "Bash(pnpm tauri build:*)",
      "Bash(pnpm --filter frontend tsc:*)"
    ]
  }
}

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.