Skip to content
Back to skills

Abyousef739 Clawcache Free .

ASecurity

Smart LLM cost tracking and caching for Python

  • 4 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 12, 2026
ai-agentspythongobashsqlgitapisecurityperformancedocumentation

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add aibot88/sec_skill_store --skill abyousef739-clawcache-free-. --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Abyousef739 Clawcache Free .?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Abyousef739 Clawcache Free .
[![Security: A โ€” Skills Directory](https://www.skillsdirectory.com/api/skills/aibot88-abyousef739-clawcache-free/badge)](https://www.skillsdirectory.com/skills/aibot88-abyousef739-clawcache-free)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ClawCache Free
description: Smart LLM cost tracking and caching for Python
version: 0.2.0
author: ClawCache Team
category: Developer Tools
license: MIT
---

# ClawCache Free - LLM Cost Tracking & Caching

**ClawCache** is a production-ready Python library that helps you **track every penny** spent on LLM APIs and **automatically cache responses** to slash costs.

## ๐ŸŽฏ What You Get

### ๐Ÿ’ฐ Cost Tracking
- **Automatic logging** of every LLM API call with precise token counting
- **Daily CLI reports** showing spending, savings, and cache efficiency
- **Multi-provider support**: OpenAI, Anthropic, Mistral, Ollama, and more
- **2026 pricing** built-in for accurate cost calculations

### โšก Smart Caching
- **Exact-match caching** using SQLite (fast, reliable, local)
- **58.3% cache hit rate** proven in real-world scenarios
- **Automatic savings** - cached responses cost $0
- **Composite cache keys** for better accuracy (model + temperature + params)

## ๐Ÿ“Š Real-World Performance

Based on comprehensive simulation with **48 API calls** across 4 common use cases:

| Metric | Value |
|--------|-------|
| **Cache Hit Rate** | 58.3% |
| **Total Cost** | $0.0062 |
| **API Calls Saved** | 28 out of 48 |
| **Scenarios Tested** | Code Review, Data Analysis, Content Generation, QA Support |

### Scenario Breakdown

| Scenario | Calls | Cache Hits | Hit Rate |
|----------|-------|------------|----------|
| Code Review | 12 | 7 | 58.3% |
| Data Analysis | 12 | 8 | 66.7% |
| Content Generation | 12 | 7 | 58.3% |
| QA Support | 12 | 6 | 50.0% |

## ๐Ÿš€ Quick Start

### Installation

```bash
pip install clawcache
```

### Basic Usage

```python
from clawcache.free.cost import async_monitor_cost
from clawcache.free.cache_basic import BasicCache

# Initialize cache
cache = BasicCache()

# Decorate your LLM function
@async_monitor_cost
async def my_llm_call(prompt, model="gpt-4-turbo"):
    # Check cache first
    cached = await cache.aget(prompt, model=model)
    if cached:
        return cached.content
    
    # Make actual API call
    response = await openai.ChatCompletion.acreate(
        model=model,
        messages=[{"role": "user", "content": prompt}]
    )
    
    # Cache the response
    await cache.aset(prompt, response, model=model)
    return response

# Use it
result = await my_llm_call("Explain quantum computing")
```

### View Your Cost Report

ClawCache automatically tracks all your LLM spending:

```bash
# See today's detailed cost report
clawcache --report

# Output shows:
# - Money spent today
# - Money saved via cache
# - Total API calls
# - Cache hit rate
# - Efficiency metrics
```

## โœจ Features

### Cost Tracking & Monitoring
- โœ… **Automatic Cost Logging**: Every API call tracked with timestamp, model, tokens, and cost
- โœ… **Daily CLI Reports**: Shows spending, savings, and efficiency metrics
- โœ… **Accurate Token Counting**: Uses `tiktoken` when available
- โœ… **Multi-Provider Support**: OpenAI, Anthropic, Mistral, Ollama, etc.

### Smart Caching
- โœ… **Exact-Match Caching**: SQLite-based (fast and reliable)
- โœ… **Composite Cache Keys**: Cache by prompt + model + params
- โœ… **Async Support**: Full async/await compatibility
- โœ… **Automatic Savings**: Cached responses cost $0

### Security & Reliability
- โœ… **Secure**: Pickle opt-in (disabled by default)
- โœ… **Concurrent-Safe**: SQLite WAL mode
- โœ… **Cross-Platform**: Windows, macOS, Linux

## ๐Ÿ”’ Security

ClawCache takes security seriously:
- **Pickle opt-in**: Deserialization disabled by default to prevent RCE
- **SQLite WAL mode**: Safe concurrent access
- **File locking**: Cross-platform file locking for log integrity

## ๐Ÿ“– Configuration

Customize ClawCache behavior via environment variables:

```bash
export CLAWCACHE_HOME=/path/to/cache  # Default: ~/.clawcache
```

### Cache Key Specificity

ClawCache supports composite cache keys for better accuracy:

```python
# Cache by prompt + model + temperature
await cache.aset(
    prompt, 
    response, 
    model="gpt-4-turbo",
    temperature=0.7
)
```

### Supported Models (2026 Pricing)

| Model | Input ($/1M tokens) | Output ($/1M tokens) |
|-------|---------------------|----------------------|
| GPT-4 Turbo | $10.00 | $30.00 |
| GPT-3.5 Turbo | $0.50 | $1.50 |
| Claude 3.5 Sonnet | $3.00 | $15.00 |
| Claude 3 Haiku | $0.25 | $1.25 |

## ๐Ÿ’ก Use Cases

### 1. Code Review Assistant
```python
@async_monitor_cost
async def review_code(code_snippet):
    prompt = f"Review this code for bugs: {code_snippet}"
    return await llm_call(prompt, model="gpt-4-turbo")
```

### 2. Data Analysis
```python
@async_monitor_cost
async def analyze_data(dataset):
    prompt = f"Analyze this dataset: {dataset}"
    return await llm_call(prompt, model="claude-3-5-sonnet")
```

### 3. Content Generation
```python
@async_monitor_cost
async def generate_content(topic):
    prompt = f"Write a blog post about: {topic}"
    return await llm_call(prompt, model="gpt-3.5-turbo")
```

## ๐Ÿ“ˆ Cost Savings Projection

Based on typical usage patterns:
- **Without ClawCache**: $0.0062 for 48 calls
- **With ClawCache**: $0.0062 for first run, ~$0.0026 for subsequent runs (58% savings)
- **Annual Projection**: For 10,000 calls/month โ†’ **$3,600 saved/year**

## โญ Pro Version Coming Soon

Want even more savings and insights? ClawCache Pro will include:
- ๐Ÿ”ฎ **Semantic Caching**: Match similar queries (higher hit rates!)
- ๐Ÿ“Š **Advanced Analytics**: Detailed cost breakdowns and trends
- ๐Ÿ“ˆ **Visual Reports**: Beautiful charts and graphs
- ๐Ÿš€ **Social Sharing**: Share savings on Twitter, LinkedIn, Molbook with auto-generated charts
- โ˜๏ธ **Cloud Sync**: Sync cache across devices
- ๐ŸŽฏ **Team Analytics**: Track costs across your team

**Free**: Cost tracking with CLI reports + exact-match caching  
**Pro**: Adds social sharing with charts + semantic caching + advanced analytics

[Learn more](https://www.clawcache.com/pro)

## ๐Ÿค Contributing

Contributions welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Add tests for new features
4. Submit a pull request

## ๐Ÿ“„ License

MIT License - see [LICENSE](LICENSE) for details

## ๐Ÿ”— Links

- **Website**: [clawcache.com](https://clawcache.com)
- **GitHub**: [github.com/AbYousef739/-clawcache-free](https://github.com/AbYousef739/-clawcache-free)
- **Documentation**: [docs.clawcache.com](https://docs.clawcache.com)

---

**Made with โค๏ธ for the AI community**

*Save money. Track costs. Build better.*

Files in this skill

  • SKILL.md6.4 KB
  • source.json894 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading commentsโ€ฆ

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.