whatisgithub

What is claude-code-proxy?

sdey09/claude-code-proxy — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · ops devopsComplexity · 3/5Setup · moderate

In one sentence

A local proxy that records Claude Code's API traffic to SQLite and a self-hosted Grafana dashboard.

Mindmap

mindmap
  root((claude-code-proxy))
    What it does
      Intercepts Claude Code API calls
      Logs prompts and responses
      Emits metrics to Grafana
    Tech stack
      Python
      aiohttp
      SQLite
      Grafana
      Prometheus
    Use cases
      Track Claude Code costs
      Review past prompts
      Route to internal AI gateway
    Audience
      Developers
      DevOps teams
    Setup
      Configure upstreams.yaml
      make up
      Set ANTHROPIC_BASE_URL

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Track token usage and cost of Claude Code sessions on a local Grafana dashboard.

USE CASE 2

Store every Claude Code prompt and response locally for later review.

USE CASE 3

Route Claude Code traffic to an internal Databricks AI Gateway instead of Anthropic directly.

What is it built with?

PythonaiohttpSQLiteGrafanaPrometheus

How does it compare?

sdey09/claude-code-proxy0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity3/52/54/5
Audienceops devopsgeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Requires Docker-style stack (make up) plus editing .env and upstreams.yaml before first use.

No license information is stated in the explanation.

So what is it?

claude-code-local-observability is a local proxy tool that sits between Claude Code and Anthropic's API, letting a developer see and record every request and response Claude Code makes. It runs on your own machine, intercepting API calls, saving prompts and responses into a local SQLite database, and sending metrics into a local Grafana dashboard stack, without sending that data to any external observability service. To use it, a developer copies an example environment file and edits a routing configuration file called upstreams.yaml, which decides where each request should be sent based on the model name being called. Requests can be routed either straight to Anthropic's API or to a Databricks AI Gateway, useful for teams that have their own internal routing setup. The observability stack, which includes Grafana, Prometheus, and an OpenTelemetry collector, is started with a single make command, and the proxy itself is started separately with a Python command using the uv tool, or through a convenience script that starts both at once. Once running, Claude Code is pointed at the local proxy by setting a base URL in its settings file, and the proxy passes requests through with no added delay by writing the streamed response back to Claude Code while also logging it. Every request is recorded with details like the model used, token counts, and cost, which can be queried directly from the SQLite database with a simple query. Removing the base URL setting reverts Claude Code to talking to Anthropic directly. This tool is aimed at developers or teams who want visibility into their own Claude Code usage, such as tracking costs or reviewing past prompts and responses, without routing that data through a company's existing monitoring pipeline. It requires some comfort with editing YAML configuration and running local services.

Copy-paste prompts

Prompt 1
Help me set up sdey09/claude-code-proxy locally and point Claude Code at it.
Prompt 2
Show me how to configure upstreams.yaml to route one model to a Databricks gateway.
Prompt 3
Explain how this proxy captures Claude Code requests to SQLite without adding latency.
Prompt 4
Write a SQL query against claude-proxy.db to sum daily Claude Code cost by model.

Frequently asked questions

What is claude-code-proxy?

A local proxy that records Claude Code's API traffic to SQLite and a self-hosted Grafana dashboard.

What language is claude-code-proxy written in?

Mainly Python. The stack also includes Python, aiohttp, SQLite.

What license does claude-code-proxy use?

No license information is stated in the explanation.

How hard is claude-code-proxy to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is claude-code-proxy for?

Mainly ops devops.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.