New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

claude-code-langcache

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

claude-code-langcache

Semantic caching skill for Claude Code using Redis LangCache

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
1
-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

claude-code-langcache

Semantic caching skill for Claude Code using Redis LangCache.

Reduce LLM costs and latency by caching responses for semantically similar queries, with built-in privacy and security guardrails.

For OpenClaw users: See openclaw-langcache

Features

  • Semantic similarity matching - Cache hits for similar (not just identical) queries
  • Hard block enforcement - Automatically blocks caching of sensitive data:
    • Temporal info (today, tomorrow, deadlines, appointments)
    • Credentials (API keys, passwords, tokens, OTP)
    • Identifiers (emails, phone numbers, account IDs)
    • Personal context (relationships, private conversations)
  • Category-aware thresholds - Different similarity thresholds for factual Q&A vs style transforms
  • CLI and Python integration - Use from shell scripts or embed in Python agents

Installation

npm install -g claude-code-langcache

The skill will be automatically installed to ~/.claude/skills/langcache/

Via Git

git clone https://github.com/manvinder01/claude-code-langcache.git /tmp/claude-code-langcache
cp -r /tmp/claude-code-langcache/skills/langcache ~/.claude/skills/

Configuration

Set your Redis LangCache credentials:

export LANGCACHE_HOST=your-instance.redis.cloud
export LANGCACHE_CACHE_ID=your-cache-id
export LANGCACHE_API_KEY=your-api-key

Get these from Redis Cloud Console after creating a LangCache instance.

Usage

Automatic (via Claude Code)

The skill triggers automatically when you mention:

  • "cache LLM responses"
  • "semantic caching"
  • "reduce API costs"
  • "configure LangCache"

Or invoke manually with /langcache

CLI

# Search for cached response
~/.claude/skills/langcache/scripts/langcache.sh search "What is Redis?"

# With similarity threshold
~/.claude/skills/langcache/scripts/langcache.sh search "What is Redis?" --threshold 0.9

# Store a response
~/.claude/skills/langcache/scripts/langcache.sh store "What is Redis?" "Redis is an in-memory data store..."

# Check if content would be blocked
~/.claude/skills/langcache/scripts/langcache.sh check "What's on my calendar today?"
# Output: BLOCKED: temporal_info

Caching Policy

Cacheable (white-list)

CategoryExamplesThreshold
Factual Q&A"What is X?", "How does Y work?"0.90
Definitions / docsAPI docs, command help0.90
Command explanations"What does git rebase do?"0.92
Reply templates"polite no", "follow-up", "intro"0.88
Style transforms"make this warmer/shorter"0.85

Never Cached (hard blocks)

CategoryExamples
Temporaltoday, tomorrow, deadline, ETA, "in 20 minutes"
CredentialsAPI keys, passwords, tokens, OTP/2FA
Identifiersemails, phone numbers, account IDs, UUIDs
Personal"my wife said", private conversations, relationships

File Structure

~/.claude/skills/langcache/
├── SKILL.md              # Skill definition and instructions
├── scripts/
│   └── langcache.sh      # CLI wrapper with policy enforcement
├── references/
│   ├── api-reference.md  # Complete REST API documentation
│   └── best-practices.md # Optimization techniques
└── examples/
    ├── basic-caching.sh      # Simple cache workflow
    └── agent-integration.py  # Python integration pattern

Requirements

  • Claude Code
  • Redis Cloud account with LangCache enabled
  • Node.js 18+ (for npm installation)
  • jq and curl (for CLI usage)

License

MIT License - see LICENSE for details.

Resources

Keywords

claude-code

FAQs

Package last updated on 03 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts