Skip to content

Kitolochi/claudelog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

ClaudeLog

Track your Claude usage. Understand your AI spend. Ship faster.

ClaudeLog is a developer-focused analytics platform that connects to Anthropic's Admin APIs to track token usage, costs, and Claude Code activity — then generates daily AI-powered reports with actionable insights.

Status: Blocked — waiting for Anthropic to re-enable OAuth for third-party applications. See Current Blocker below.


The Problem

Developers and teams using Claude have no unified way to:

  • Track token spend across projects, models, and team members
  • Understand usage patterns — which models are used most, when, and by whom
  • Get daily summaries of what was built with Claude Code
  • Spot cost anomalies before they become budget problems
  • Measure ROI on AI tooling investment

Anthropic's console shows basic usage, but there's no tool that combines usage analytics, cost tracking, and AI-generated productivity reports in one place.

Planned Features

  • Usage Dashboard — Real-time and historical token consumption by model, user, and project
  • Cost Tracking — Dollar-level spend breakdowns with budget alerts and forecasting
  • Claude Code Analytics — Track coding sessions, lines changed, and developer productivity
  • Daily Reports — AI-generated summaries of what your team built, key metrics, and recommendations
  • Team Management — Per-developer usage views with role-based access
  • Historical Trends — Week-over-week and month-over-month comparisons
  • AI Recommendations — Suggestions to optimize model selection, reduce costs, and improve workflows
  • Slack/Email Digests — Scheduled report delivery to your team's channels

Architecture

┌─────────────────────────────────────────────────────────────┐
│                        ClaudeLog                            │
│                                                             │
│  ┌───────────┐  ┌──────────────┐  ┌──────────────────────┐  │
│  │  Next.js  │  │   Clerk      │  │   shadcn/ui          │  │
│  │  15 App   │──│   Auth       │  │   Components         │  │
│  │  Router   │  │              │  │   + Recharts          │  │
│  └─────┬─────┘  └──────────────┘  └──────────────────────┘  │
│        │                                                     │
│  ┌─────▼──────────────────────────────────────────────────┐  │
│  │              API Routes / Server Actions                │  │
│  └─────┬──────────────────────────────────┬───────────────┘  │
│        │                                  │                  │
│  ┌─────▼─────────┐              ┌─────────▼──────────────┐  │
│  │  Drizzle ORM  │              │  Inngest               │  │
│  │  + Neon       │              │  Background Jobs       │  │
│  │  Postgres     │              │  - Sync usage data     │  │
│  │               │              │  - Generate reports    │  │
│  └───────────────┘              │  - Send digests        │  │
│                                 └─────────┬──────────────┘  │
│                                           │                  │
└───────────────────────────────────────────┼──────────────────┘
                                            │
                              ┌─────────────▼──────────────┐
                              │   Anthropic Admin APIs     │
                              │                            │
                              │  - GET /usage              │
                              │  - GET /cost               │
                              │  - GET /claude-code-usage  │
                              └────────────────────────────┘

Anthropic API Integration

ClaudeLog relies on three Anthropic Admin API endpoints:

Endpoint Purpose Key Data
GET /v1/organizations/{org_id}/usage Token consumption Input/output tokens by model, user, project
GET /v1/organizations/{org_id}/cost Dollar spend Cost breakdowns by model and time period
GET /v1/organizations/{org_id}/claude-code-usage Code analytics Session duration, lines changed, tools used

These endpoints require an Organization Admin API key and return paginated JSON with hourly/daily granularity. ClaudeLog would sync this data on a schedule via Inngest cron jobs, storing snapshots in Postgres for historical analysis and trend computation.

Current Blocker

In January 2026, Anthropic discontinued OAuth support for third-party applications.

This means ClaudeLog cannot implement the originally planned user flow:

  1. User signs in with Claude OAuth
  2. ClaudeLog receives scoped API token
  3. App reads usage data on behalf of the user

What would need to change

For ClaudeLog to work as designed, one of the following would need to happen:

  • Anthropic re-enables third-party OAuth with scoped read-only access to Admin APIs
  • Anthropic introduces API key delegation — a way for org admins to grant limited, scoped access to third-party tools
  • Anthropic launches a partner/marketplace program that provides vetted apps with API access

Until then, the only workaround is asking users to manually paste their Admin API key into ClaudeLog, which raises security concerns and isn't a viable product experience.

Timeline

  • Jan 2026: Anthropic bans third-party OAuth
  • Now: Monitoring Anthropic's developer platform announcements for changes
  • If unblocked: MVP could ship within 2-3 weeks of OAuth/key delegation becoming available

Tech Stack

Layer Technology Rationale
Framework Next.js 15 (App Router) Server components, API routes, edge runtime
Database Neon Postgres Serverless, branching, scales to zero
ORM Drizzle Type-safe, lightweight, great DX
Auth Clerk Multi-tenant, org management, SSO
UI shadcn/ui + Tailwind CSS Composable components, full control
Charts Recharts Composable, React-native charting
Background Jobs Inngest Cron jobs, retries, event-driven workflows
AI Reports Claude API (Sonnet) Generating daily summaries and recommendations
Deployment Vercel Zero-config Next.js hosting

Data Model

┌──────────────┐     ┌──────────────────┐     ┌─────────────────┐
│ Organization │────<│ Member           │     │ UsageSnapshot   │
│──────────────│     │──────────────────│     │─────────────────│
│ id           │     │ id               │     │ id              │
│ name         │     │ orgId            │     │ orgId           │
│ anthropicOrg │     │ userId           │     │ date            │
│ plan         │     │ role             │     │ model           │
│ createdAt    │     │ joinedAt         │     │ inputTokens     │
└──────┬───────┘     └──────────────────┘     │ outputTokens    │
       │                                       │ requests        │
       │         ┌──────────────────┐          └─────────────────┘
       │         │ CostSnapshot     │
       ├────────<│──────────────────│          ┌─────────────────┐
       │         │ id               │          │ DailyReport     │
       │         │ orgId            │          │─────────────────│
       │         │ date             │          │ id              │
       │         │ model            │          │ orgId           │
       │         │ costUsd          │          │ date            │
       │         │ breakdown        │          │ summary         │
       │         └──────────────────┘          │ metrics (json)  │
       │                                       │ recommendations │
       └──────────────────────────────────────<│ generatedAt     │
                                               └─────────────────┘

       ┌──────────────────┐
       │ CodeSession      │
       │──────────────────│
       │ id               │
       │ orgId            │
       │ userId           │
       │ startedAt        │
       │ duration         │
       │ linesChanged     │
       │ toolsUsed (json) │
       └──────────────────┘

Getting Started

This project is not yet buildable. The instructions below document the intended setup for when development begins.

# Clone the repo
git clone https://github.com/Kitolochi/claudelog.git
cd claudelog

# Install dependencies
pnpm install

# Set up environment variables
cp .env.example .env.local
# Add your keys: CLERK_*, DATABASE_URL, ANTHROPIC_API_KEY, INNGEST_*

# Run database migrations
pnpm db:push

# Start development server
pnpm dev

Contributing

This project is in the design phase. If you're interested in contributing once development begins, please star the repo and watch for updates.

If you have ideas or feedback on the architecture, open an issue — all input is welcome.

License

MIT

About

Track your Claude usage. Understand your AI spend. Ship faster.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors