A sophisticated AI coding agent that enables autonomous development through direct Elisp evaluation and agent-to-agent communication.
Efrit v0.3.0 features advanced session management and performance optimizations:
- π Session-Based Architecture: Multi-step operations with Claude-controlled flow and context preservation
- β‘ Async Execution: Non-blocking commands with queue management for responsive interaction
- π Performance Optimizations: Response caching, memory management, and API call tracking
- π€ Multi-Channel Support: Support for different API channels (default, ai-efrit) with channel-specific keys
- π§ Self-Enhancing Capabilities: AI agents can debug, test, and enhance Efrit's functionality
- π¬ Unified Interface: Claude decides whether commands run synchronously or asynchronously
- π Bug Fixes: Fixed critical syntax errors, API key selection, and model configuration
Zero client-side intelligence - Claude makes all decisions about execution mode and flow.
Efrit provides multiple interfaces for AI-powered Emacs development:
- efrit-chat - Multi-turn conversational interface for complex discussions
- efrit-do - Synchronous natural language command execution
- efrit-do-async - π Asynchronous command execution with session management
- efrit-unified-do - π Claude decides sync/async execution mode
- efrit-remote-queue - File-based channel for AI agent communication
- efrit-streamlined-send - Streamlined chat interface
- Direct Elisp Evaluation: Full access to Emacs' native programmability
- Session Management: Multi-step operations with context preservation
- Async Execution: Non-blocking commands with automatic queue processing
- Performance Optimized: Response caching, memory management, API tracking
- Tool Integration: Manipulate buffers, execute functions, interact with environment
- Safety-First Design: Comprehensive error handling and confirmation systems
- Session Protocol: Claude controls multi-step execution flow
- Work Log Compression: Efficient context management for long sessions
- Performance Monitoring: Track API call times and cache hit rates
- Remote Queue System: AI agents communicate via JSON file exchange
- Autonomous Operation: AI can spawn and control its own Emacs instances
- Self-Enhancement: Agents can modify and improve Efrit's source code
- Emacs: Version 28.1 or later
- Anthropic API Key: Get yours from Anthropic Console
- Internet Connection: Required for Claude API access
-
Clone the repository:
git clone https://github.com/steveyegge/efrit.git cd efrit -
Add to your Emacs configuration (
~/.emacs.d/init.el):(add-to-list 'load-path "/path/to/efrit/lisp") (require 'efrit)
-
Configure your API key in
~/.authinfo:machine api.anthropic.com login personal password YOUR_API_KEY_HERE -
Restart Emacs and test with
M-x efrit-chat
Efrit organizes all user data under a single configurable directory (default: ~/.emacs.d/.efrit/):
~/.emacs.d/.efrit/
βββ cache/ # Temporary cache files
βββ context/ # Context persistence (efrit-do)
β βββ efrit-do-context.el
βββ queues/ # AI-to-efrit communication
β βββ requests/ # Incoming AI requests
β βββ processing/ # Currently processing
β βββ responses/ # Completed responses
β βββ archive/ # Archived communications
βββ queue-ai/ # Autonomous AI communication
βββ logs/ # Debug and activity logs
βββ sessions/ # Session persistence data
βββ workspace/ # Autonomous workspace
βββ auto-saves/ # Emacs auto-save files
βββ backups/ # Backup files
βββ startup.log # Startup logging
Key Benefits:
- ποΈ Organized: All efrit data in one predictable location
- βοΈ Configurable: Easily change location via
efrit-data-directory - π« Version Control Safe: Excluded from git via
.efrit/in.gitignore - π Dashboard Ready: Structured for easy monitoring and management
Customization:
;; Custom location (set before loading efrit)
(setq efrit-data-directory "~/my-custom-efrit-data")
(require 'efrit)Migration: Existing scattered efrit files (~/.emacs.d/efrit-*) are automatically migrated to the organized structure on first load.
Maintenance:
- Safe to delete individual subdirectories to reset specific components
- Queue directories auto-recreate as needed
- Context files can be manually backed up/restored
Start the remote queue to allow AI agents to interact with Efrit:
;; In Emacs
(efrit-remote-queue-start) ; or C-c C-e qThis creates ~/.emacs.d/.efrit/queues/ for AI agent communication.
M-x efrit-chat ; Conversational interface
M-x efrit-do ; Synchronous command execution
M-x efrit-do-async ; Asynchronous command execution
M-x efrit-unified-do ; Let Claude decide sync/async
M-x efrit-streamlined-send ; Streamlined chat mode
M-x efrit-performance-show-stats ; View performance statisticsKey Bindings:
C-c C-e c- Chat interfaceC-c C-e d- Sync command executionC-c C-e D- Async command executionC-c C-e u- Unified (Claude decides)C-c C-e s- Streamlined chatC-c C-e q- Start queueC-c C-e Q- Queue statusC-c C-e A- Async status
Here's efrit creating four different poems about IDEs in separate buffers with a single request:
This demonstrates efrit's ability to handle complex, multi-part requests through natural language commands.
AI agents write JSON requests to the queue directory:
{
"id": "req_001",
"type": "eval",
"content": "(+ 40 2)"
}Efrit processes and responds with JSON results:
{
"id": "req_001",
"status": "success",
"result": "42"
}See QUEUE_USAGE_EXAMPLE.md for detailed integration examples.
Human Interaction:
M-x efrit-do
> write an ode in one buffer, and a sonnet in another, both about Vim
AI Agent Interaction:
# Any AI agent can now interact with Efrit
efrit = EfritQueue()
result = efrit.send_request("command", "split window and open dired")
print(f"β {result['status']}")Efrit is becoming a platform for autonomous AI development:
- Human-Friendly: Rich interactive interfaces for users
- Agent-Friendly: File-based communication channel for AI systems
- Self-Enhancing: AI agents can improve Efrit's own capabilities
- Zero Client Intelligence: All AI processing happens in Claude, Efrit is pure executor
- efrit.el - Main entry point and coordination
- efrit-chat.el - Conversational interfaces
- efrit-do.el - Synchronous natural language command execution
- efrit-async.el - π Asynchronous execution with session management
- efrit-unified.el - π Claude-controlled execution mode selection
- efrit-context.el - π Context capture and work log compression
- efrit-performance.el - π Caching, memory management, and stats
- efrit-protocol.el - π Shared protocols and tool dispatch
- efrit-remote-queue.el - Agent communication system
- efrit-tools.el - Core Elisp evaluation engine
- β File-based Agent Communication - Complete
- β Autonomous AI Development Environment - Complete
- π Self-Enhancement Capabilities - Next Phase
Transform Efrit from a user assistant into an autonomous AI development platform where:
- AI agents enhance Efrit's functionality independently
- Multiple AI systems can collaborate through Efrit
- Users benefit from continuously improving capabilities
;; Standard Efrit settings
(setq efrit-model "claude-3-5-sonnet-20241022")
(setq efrit-max-tokens 8192)
;; π Performance settings
(setq efrit-performance-cache-ttl 300) ; Cache for 5 minutes
(setq efrit-performance-max-sessions 10) ; Memory management
(setq efrit-async-max-work-log-entries 50) ; Prevent memory growth
;; π Agent communication settings
(setq efrit-remote-queue-directory "~/.emacs.d/efrit-queue")
(setq efrit-remote-queue-max-concurrent 10)
;; Start agent communication on load (optional)
(add-hook 'after-init-hook #'efrit-remote-queue-start)See AUTONOMOUS_AI_PLAN.md for autonomous development architecture.
make compile # Build
make test # Run testsSee CONTRIBUTING.md for detailed guidelines.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Efrit: Autonomous AI development meets the power of Emacs.