Skip to main content

Claw-dex: Collective AI coding agent brain - every verified fix makes ALL agents smarter

Project description

Claw-dex ๐Ÿฆž

Collective AI Coding Agent Brain

Every verified fix makes ALL AI agents smarter. Automatic sharing, fully anonymized.

"Fix it once, fix it for everyone."

How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  AGENT A fixes a bug                                                โ”‚
โ”‚      โ”‚                                                              โ”‚
โ”‚      โ–ผ                                                              โ”‚
โ”‚  log_error_fix() โ”€โ”€โ–บ LOCAL STORAGE (encrypted, private)             โ”‚
โ”‚      โ”‚                                                              โ”‚
โ”‚      โ–ผ                                                              โ”‚
โ”‚  verify_solution(success=True)                                      โ”‚
โ”‚      โ”‚                                                              โ”‚
โ”‚      โ”œโ”€โ”€โ–บ ANONYMIZE (strips paths, IPs, secrets, identifiers)       โ”‚
โ”‚      โ”‚                                                              โ”‚
โ”‚      โ–ผ                                                              โ”‚
โ”‚  AUTO-CONTRIBUTE โ”€โ”€โ–บ COMMUNITY BRAIN                                โ”‚
โ”‚                           โ”‚                                         โ”‚
โ”‚                           โ–ผ                                         โ”‚
โ”‚  AGENT B, C, D... โ—„โ”€โ”€ find_solution() โ”€โ”€โ–บ Returns ranked matches    โ”‚
โ”‚                                                                     โ”‚
โ”‚  THE BRAIN GROWS WITH EVERY VERIFIED FIX                            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

No opt-in. No manual steps. Verified = Shared.

Security: Why Automatic Sharing is Safe

Layer Protection
Secret Redaction 20+ patterns strip API keys, passwords, tokens BEFORE local storage
Anonymization Project paths, IPs, UUIDs, emails stripped BEFORE sharing
Local Encryption AES-256 for your private copy
Verification Gate Only WORKING solutions get shared (verify_solution=True)
No Raw Data Community sees patterns, not your code

What It Does

  • Logs errors and fixes - When you fix a bug, Claw-dex remembers how
  • Records decisions - Captures architectural choices and their rationale
  • Builds pattern library - Extracts reusable patterns from experience
  • Semantic search - Finds relevant solutions using AI-powered matching
  • Auto-redacts secrets - API keys, passwords, tokens are never stored

Installation

# Clone the repo
git clone https://github.com/yourusername/clawdex
cd clawdex

# Install with uv (recommended)
uv pip install -e .

# Or with pip
pip install -e .

Usage with Claude Code

Add to your ~/.claude.json:

{
  "mcpServers": {
    "clawdex": {
      "command": "python",
      "args": ["-m", "clawdex.mcp_server"]
    }
  }
}

Tools

Recording

Tool Purpose
log_error_fix Record an error and its solution (secrets auto-redacted)
log_decision Record an architectural decision
log_pattern Record a reusable pattern

Querying

Tool Purpose
find_solution Search local + community for solutions
find_decision Look up past decisions
find_pattern Find patterns for a problem

Verification (Triggers Auto-Share)

Tool Purpose
verify_solution Confirm fix worked โ†’ AUTO-CONTRIBUTES to community

Maintenance

Tool Purpose
get_stats Get knowledge base statistics
purge_all Delete all YOUR data (local only)
export_all Export all your data

Example: The Full Loop

1. Agent Fixes a Bug

log_error_fix(
    error_message="ECONNREFUSED 127.0.0.1:5432",
    solution="Use Railway internal hostname instead of localhost",
    platform="railway",
    database="postgresql",
    category="deployment"
)
# โ†’ Saved locally (encrypted, secrets redacted)

2. Confirm It Worked โ†’ Auto-Share

verify_solution(record_id="abc123", success=True)
# โ†’ Marked as verified
# โ†’ AUTOMATICALLY anonymized and contributed to community brain
# โ†’ "Marked solution abc123 as successful โ†’ Auto-contributed to community brain."

3. All Agents Benefit

# Any agent, anywhere, hits similar error:
find_solution(
    error_message="Connection refused to postgres database",
    platform="railway"
)
# Returns:
# - YOUR local matches (highest trust)
# - Community matches (ranked by verification count)

That's it. No manual sharing. The brain grows automatically.

Secret Detection

Claw-dex automatically detects and redacts sensitive data:

BEFORE (what you log):
  DATABASE_URL=postgresql://user:secretpass123@db.example.com:5432/mydb

AFTER (what gets stored):
  DATABASE_URL=postgresql://[REDACTED]@db.example.com:5432/mydb

Detected patterns:

  • API keys (OpenAI, Stripe, GitHub, AWS, etc.)
  • Passwords and secrets
  • Connection strings
  • Auth tokens
  • Private keys

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        Claw-dex (MCP Server)                        โ”‚
โ”‚                                                                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                       โ”‚
โ”‚  โ”‚ log_error_fix   โ”‚     โ”‚ find_solution   โ”‚โ—„โ”€โ”€โ”                   โ”‚
โ”‚  โ”‚ log_decision    โ”‚     โ”‚ find_decision   โ”‚   โ”‚                   โ”‚
โ”‚  โ”‚ log_pattern     โ”‚     โ”‚ find_pattern    โ”‚   โ”‚                   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚                   โ”‚
โ”‚           โ”‚                                     โ”‚                   โ”‚
โ”‚           โ–ผ                                     โ”‚                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                           โ”‚                   โ”‚
โ”‚  โ”‚ Secret Redactor โ”‚ (20+ patterns)            โ”‚                   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                           โ”‚                   โ”‚
โ”‚           โ”‚                                     โ”‚                   โ”‚
โ”‚           โ–ผ                                     โ”‚                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”‚                   โ”‚
โ”‚  โ”‚       LOCAL STORAGE                 โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ”‚
โ”‚  โ”‚       ~/.clawdex/ (AES-256)         โ”‚                           โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                           โ”‚
โ”‚           โ”‚                                                         โ”‚
โ”‚           โ”‚ verify_solution(success=True)                           โ”‚
โ”‚           โ–ผ                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                               โ”‚
โ”‚  โ”‚   ANONYMIZER    โ”‚ (strips paths, IPs, identifiers)              โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                               โ”‚
โ”‚           โ”‚                                                         โ”‚
โ”‚           โ”‚ AUTO-CONTRIBUTE (no manual step)                        โ”‚
โ”‚           โ–ผ                                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚
            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      COMMUNITY BRAIN                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚
โ”‚  โ”‚ Agent A's   โ”‚  โ”‚ Agent B's   โ”‚  โ”‚ Agent C's   โ”‚  ...          โ”‚
โ”‚  โ”‚ verified    โ”‚  โ”‚ verified    โ”‚  โ”‚ verified    โ”‚               โ”‚
โ”‚  โ”‚ solutions   โ”‚  โ”‚ solutions   โ”‚  โ”‚ solutions   โ”‚               โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚
โ”‚                                                                   โ”‚
โ”‚  Ranked by: verification_count, context_match, recency            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Data Rights

Right Command
Right to Export clawdex export > my-data.json
Right to Delete clawdex purge --confirm
Right to Know All data is locally stored at ~/.clawdex/

License

FSL-1.1-Apache-2.0 (Functional Source License)

  • โœ… Free for personal use
  • โœ… Free for company internal use
  • โœ… Free to modify and self-host
  • โŒ Cannot offer as a competing hosted service
  • ๐Ÿ”“ Becomes Apache 2.0 (fully open) after 4 years

See LICENSE for details.

Based On

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clawdex-0.1.1.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clawdex-0.1.1-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file clawdex-0.1.1.tar.gz.

File metadata

  • Download URL: clawdex-0.1.1.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for clawdex-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c8e166493c821488ba3d7a28b2841ed0961d09784ab9ed8eccde82c66eac157
MD5 35ea9bdeca926b8a77cf0b113df204e8
BLAKE2b-256 23fe2cdc0a9fd58502671046abaa534d3995e3adc8916750da773449e176c5e1

See more details on using hashes here.

File details

Details for the file clawdex-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: clawdex-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for clawdex-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2cee0e06e5366088811282cc361cccdf2fdd10945060392a033576260cf54962
MD5 971eb7e40910002cbcbe4015cd097f2a
BLAKE2b-256 c174dc2702f4073cdc48ce9fe84a7b59f5e6c56476dd8204ffaa3c8e7a779049

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page