Skip to main content

AI-powered developer workflows for Claude with cost optimization, multi-agent orchestration, and workflow automation.

Project description

Attune AI

AI-powered developer workflows with cost optimization and intelligent routing.

Run code review, debugging, testing, and release workflows from your terminal or Claude Code. Smart tier routing saves 34-86% on LLM costs.

PyPI Downloads Downloads/month Downloads/week Tests Coverage Security Python License

pip install attune-ai[developer]

What's New in v2.4.1

  • Security: macOS path validation bypass (CWE-22) - Fixed _validate_file_path() in 5 modules where /etc -> /private/etc symlink bypassed system directory checks
  • Healthcare Domain Plugin - Clinical decision support agents with FHIR resources, waveform analysis, audit logging, and SMART on FHIR auth
  • Redis pubsub thread leak fix - PubSubManager.close() now joins listener threads, preventing daemon thread leaks
  • Rebranding to Attune AI - Removed legacy "Empathy Framework" references, deleted wizard-based CLI
  • Windows CI stability - Fixed timestamp collisions, encoding, case sensitivity, and PowerShell compatibility

Key Features

Claude-Native Architecture

Attune AI is built exclusively for Anthropic/Claude, unlocking features impossible with multi-provider abstraction:

  • Prompt Caching - 90% cost reduction on repeated prompts
  • Flexible Context - 200K via subscription, up to 1M via API for large codebases
  • Extended Thinking - Access Claude's internal reasoning process
  • Advanced Tool Use - Optimized for agentic workflows

Multi-Agent Orchestration

Full support for custom agents and Anthropic LLM agents:

  • Agent Teams - Pre-built teams for release prep (4 agents) with extensible agent framework
  • Agent Coordination Dashboard - Real-time monitoring with 6 coordination patterns
  • Progressive Tier Escalation - Agents start cheap and escalate only when needed
  • Inter-Agent Communication - Heartbeats, signals, events, and approval gates
  • Redis Production Patterns - scan_iter() for safe key enumeration, pipeline batching, pub/sub reconnection with exponential backoff

Modular Architecture

Clean, maintainable codebase built for extensibility:

  • Small, Focused Files - No file exceeds 1,000 lines; logic extracted into mixins and utilities
  • Cross-Platform CI - Tested on Ubuntu, macOS, and Windows with Python 3.10-3.13
  • 13,800+ Tests - Security, unit, integration, and behavioral test coverage at 80%+ coverage

Intelligent Cost Optimization

  • $0 in Claude Code - Workflows run as skills through Claude's Task tool
  • Smart Tier Routing - Automatically selects the right model for each task
  • Authentication Strategy - Routes between subscription and API based on codebase size

Socratic Workflows

Workflows guide you through discovery instead of requiring upfront configuration:

  • Interactive Discovery - Asks targeted questions to understand your needs
  • Context Gathering - Collects relevant code, errors, and constraints
  • Dynamic Agent Creation - Assembles the right team based on your answers

Quick Start

1. Install

pip install attune-ai

2. Setup Slash Commands

attune setup

This installs /attune to ~/.claude/commands/ for Claude Code.

3. Use in Claude Code

Just type:

/attune

Socratic discovery guides you to the right workflow.

Or use shortcuts:

/attune debug      # Debug an issue
/attune test       # Run tests
/attune security   # Security audit
/attune commit     # Create commit
/attune pr         # Create pull request

CLI Usage

Run workflows directly from terminal:

attune workflow run release-prep           # 4-agent release readiness check
attune workflow run security-audit --path ./src
attune workflow run test-gen --path ./src
attune telemetry show

Need all features?

pip install attune-ai[developer]

This adds multi-LLM support, agents, and memory features.


Command Hubs

Workflows are organized into hubs for easy discovery:

Hub Command Description
Developer /dev Debug, commit, PR, code review, quality
Testing /testing Run tests, coverage analysis, benchmarks
Documentation /docs Generate and manage documentation
Release /release Release prep, security scan, publishing
Workflows /workflows Automated analysis (security, bugs, perf)
Plan /plan Planning, TDD, code review, refactoring
Agent /agent Create and manage custom agents

Natural Language Routing:

/workflows "find security vulnerabilities"  # → security-audit
/workflows "check code performance"         # → perf-audit
/plan "review my code"                      # → code-review

Cost Optimization

Skills = $0 (Claude Code)

When using Claude Code, workflows run as skills through the Task tool - no API costs:

/dev           # $0 - uses your Claude subscription
/testing       # $0
/release       # $0

API Mode (CI/CD, Automation)

For programmatic use, smart tier routing saves 34-86%:

Tier Model Use Case Cost
CHEAP Haiku Formatting, simple tasks ~$0.005
CAPABLE Sonnet Bug fixes, code review ~$0.08
PREMIUM Opus Architecture, complex design ~$0.45
# Track API usage and savings
attune telemetry savings --days 30

MCP Server Integration

Attune AI includes a Model Context Protocol (MCP) server that exposes all workflows as native Claude Code tools:

  • 10 Tools Available - security_audit, bug_predict, code_review, test_generation, performance_audit, release_prep, and more
  • Automatic Discovery - Claude Code finds tools via .claude/mcp.json
  • Natural Language Access - Describe your need and Claude invokes the appropriate tool
# Verify MCP integration
echo '{"method":"tools/list","params":{}}' | PYTHONPATH=./src python -m attune.mcp.server

Agent Coordination Dashboard

Real-time monitoring with 6 coordination patterns:

  • Agent heartbeats and status tracking
  • Inter-agent coordination signals
  • Event streaming across agent workflows
  • Approval gates for human-in-the-loop
  • Quality feedback and performance metrics
  • Demo mode with test data generation
# Launch dashboard (requires Redis 7.x or 8.x)
python examples/dashboard_demo.py
# Open http://localhost:8000

Redis 8.4 Support: Full compatibility with RediSearch, RedisJSON, RedisTimeSeries, RedisBloom, and VectorSet modules.


Authentication Strategy

Intelligent routing between Claude subscription and Anthropic API:

# Interactive setup
python -m attune.models.auth_cli setup

# View current configuration
python -m attune.models.auth_cli status

# Get recommendation for a file
python -m attune.models.auth_cli recommend src/module.py

Automatic routing:

  • Small/medium modules (<2000 LOC) → Claude subscription (free)
  • Large modules (>2000 LOC) → Anthropic API (pay for what you need)

Installation Options

# Base install (CLI + workflows)
pip install attune-ai

# Full developer experience (multi-LLM, agents, memory)
pip install attune-ai[developer]

# With semantic caching (70% cost reduction)
pip install attune-ai[cache]

# Enterprise (auth, rate limiting, telemetry)
pip install attune-ai[enterprise]

# Development
git clone https://github.com/Smart-AI-Memory/attune-ai.git
cd attune-ai && pip install -e .[dev]

What's in each option:

Option What You Get
Base CLI, workflows, Anthropic SDK
[developer] + OpenAI, Google AI, LangChain agents, memory
[cache] + Semantic similarity caching
[enterprise] + JWT auth, rate limiting, OpenTelemetry

Environment Setup

In Claude Code: No setup needed - uses your Claude subscription.

For CLI/API usage:

export ANTHROPIC_API_KEY="sk-ant-..."  # Required for CLI workflows
export REDIS_URL="redis://localhost:6379"  # Optional: for memory features

Security

  • Path traversal protection on all file operations (_validate_file_path() on 22 write operations)
  • JWT authentication with rate limiting
  • PII scrubbing in telemetry
  • HIPAA/GDPR compliance options
  • Automated security scanning (517 findings remediated to 0 across codebase)
# Run security audit
attune workflow run security-audit --path ./src

See SECURITY.md for vulnerability reporting.


Documentation


Contributing

See CONTRIBUTING.md for guidelines.


License

Apache License 2.0 - Free and open source. Use it, modify it, build commercial products with it. Details →


Acknowledgements

Special thanks to:

  • Anthropic - For Claude AI and the Model Context Protocol
  • LangChain - Agent framework powering our orchestration
  • FastAPI - Modern Python web framework

View Full Acknowledgements →


Built by Smart AI Memory · Docs · Issues

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

attune_ai-2.4.1.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

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

attune_ai-2.4.1-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file attune_ai-2.4.1.tar.gz.

File metadata

  • Download URL: attune_ai-2.4.1.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for attune_ai-2.4.1.tar.gz
Algorithm Hash digest
SHA256 6e443053bd123133d2977f2df2e41601849b51a5f3452f6a784141becb136ae4
MD5 9840317e625dacddab6d2bcf09061f66
BLAKE2b-256 5747a8fee41ae12eaf79102c9305a5c68a15513d23c0e358b491a12ba077c3a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for attune_ai-2.4.1.tar.gz:

Publisher: publish-pypi.yml on Smart-AI-Memory/attune-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file attune_ai-2.4.1-py3-none-any.whl.

File metadata

  • Download URL: attune_ai-2.4.1-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for attune_ai-2.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e48f6b2ed93b37c969fa9f95274e7fcd10beb35731aeb12f813a977dcf9c04cd
MD5 d6a2561b3174f224ba4557071d5340a9
BLAKE2b-256 2e127c2ec5bd6e2f1bcb5feace7a4a705f75afbf9ccd54ef5351fcd6cade84f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for attune_ai-2.4.1-py3-none-any.whl:

Publisher: publish-pypi.yml on Smart-AI-Memory/attune-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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