This file contains project-specific configuration and preferences for Claude Code when working with the ElizaOS codebase.
- Working Directory:
/Users/{user}/Documents/GitHub/eliza - Git Repository: Yes
- Main Branch:
develop - Project Type: TypeScript Monorepo
- Package Manager:
bun(CRITICAL: Never use npm or pnpm) - Node Version: 23.3.0
- Monorepo Tools: Turbo, Lerna
ElizaOS is organized as a monorepo with the following key packages:
packages/core-@elizaos/core- Foundation runtime, types, agents, and databasepackages/cli-@elizaos/cli- Command-line interface and agent runtimepackages/client- Frontend React GUI that displays through the CLIpackages/app- Tauri-based desktop/mobile applicationpackages/server- Server components and API
packages/plugin-bootstrap- Default event handlers, actions, and providerspackages/plugin-sql- DatabaseAdapter for Postgres and PGLitepackages/plugin-starter- Template for creating new pluginspackages/project-starter- Template for new projectspackages/project-tee-starter- TEE (Trusted Execution Environment) project template
packages/autodoc- Documentation generation toolspackages/docs- Official documentation (Docusaurus)packages/create-eliza- Project scaffolding tool
bun install # Install dependencies
bun run build # Build all packages (excludes docs)
bun run build:docs # Build documentation only
bun run build:cli # Build CLI package specifically
bun run build:core # Build core package specifically
bun run build:client # Build client package specificallybun start # Start CLI with agent runtime
bun run start:debug # Start with debug logging
bun run start:app # Start Tauri application
bun run dev # Development mode with auto-rebuildbun test # Run tests (excludes plugin-starter, docs, sql plugin)
bun run test:client # Test client package only
bun run test:core # Test core package only
bun run test:app # Test app package onlybun run lint # Run linting and prettier
bun run format # Format code with prettier
bun run format:check # Check formatting without changes
bun run pre-commit # Run pre-commit linting scriptbun run migrate # Run database migrations
bun run migrate:generate # Generate new migrationsbun run docker:build # Build Docker image
bun run docker:run # Run Docker container
bun run docker:bash # Access container shell
bun run docker:start # Start container
bun run docker # Build, run, and access containerbun run release # Full release process
bun run release:alpha # Release alpha version- NEVER USE
npmORpnpm - ALWAYS USE
bunFOR ALL PACKAGE MANAGEMENT AND SCRIPT EXECUTION - IF A COMMAND DOESN'T WORK: Check
package.jsonin the relevant package directory for correct script names - Use
bunfor global installs:bun install -g @elizaos/cli
- ALWAYS USE
ghCLI FOR GIT AND GITHUB OPERATIONS - Use
ghcommands for creating PRs, issues, releases, etc. - WHEN USER PROVIDES GITHUB WORKFLOW RUN LINK: Use
gh run view <run-id>andgh run view <run-id> --logto get workflow details and failure logs - NEVER ADD CO-AUTHOR CREDITS: Do not include "Co-Authored-By: Claude" or similar co-authoring credits in commit messages or PR descriptions
- Base Branch:
develop(NOTmain) - Create PRs against
developbranch - Main branch is used for releases only
- The
elizaosCLI is built frompackages/cli - INTENDED FOR: Production use by developers/users of the project
- DO NOT USE THE
elizaosCLI WITHIN THEelizaMONOREPO ITSELF - The
elizaosCLI is for external consumers, NOT internal monorepo development - For monorepo development: Use
buncommands directly
- Central Dependency: Everything depends on
@elizaos/coreorpackages/core - No Circular Dependencies: Core cannot depend on other packages
- Import Pattern: Use
@elizaos/corein package code,packages/corein internal references
- Channel → Room Mapping: Discord/Twitter/GUI channels become "rooms"
- Server → World Mapping: Servers become "worlds" in agent memory
- UUID System: All IDs swizzled with agent's UUID into deterministic UUIDs
- Actions: Define agent capabilities and response mechanisms
- Providers: Supply dynamic contextual information (agent's "senses")
- Evaluators: Post-interaction cognitive processing
- Tasks: Manage deferred, scheduled, and interactive operations
- Services: Enable AI agents to interact with external platforms
- Plugins: Modular extensions for enhanced capabilities
- ORM: Drizzle ORM with IDatabaseAdapter interface
- Adapters: PGLite (local development), PostgreSQL (production)
- Default: PGLite for lightweight development
- Understand requirement completely
- Research all affected files and components
- Create detailed implementation plan
- Identify all possible risks and negative outcomes
- Write comprehensive tests first when possible
- Implement solution iteratively
- Never use stubs or incomplete code
- Continue until all stubs are replaced with working code
- Test thoroughly - models hallucinate frequently
- Test Framework: Vitest
- E2E Tests: Use actual runtime, cannot use vitest state
- Unit Tests: Use vitest with standard primitives
- Always verify tests pass before declaring changes correct
- First attempts are usually incorrect - test thoroughly
- CHECK IF ALL RELEVANT TESTS ARE PASSING
- Run package-specific tests if working on a specific package
- Run
bun testin monorepo root to test almost all packages - Run
bun run buildto ensure code builds successfully - Run
bun run lintto check code formatting and style - REFLECT: Are all tests passing? Did you cut any corners? Are there any build issues?
# Full test suite (recommended)
bun test
# Package-specific testing
cd packages/core && bun test
cd packages/cli && bun test
cd packages/client && bun test
# Build verification
bun run build- TypeScript with proper typing for all new code
- Use functional programming patterns; avoid classes
- Prefer iteration and modularization over code duplication
- Comprehensive error handling required
- Clear separation of concerns
- Variables:
camelCase(e.g.,isLoading,hasError) - Functions:
camelCase(e.g.,searchResultsvsdata) - React Components:
PascalCase(e.g.,DashboardMenu) - Props Interfaces:
PascalCaseending withProps(e.g.,DashboardMenuProps) - File Names: Match main export (e.g.,
DashboardMenu.tsx,dashboardLogic.ts)
- Follow existing patterns in codebase
- Use descriptive variable and function names
- Comment complex logic
- Don't comment change notes
- Never omit code or add "// ..." as it risks breaking the codebase
# Model Provider (at least one required)
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key
# Database (optional - defaults to PGLite)
POSTGRES_URL=your_postgres_connection_string
# Logging
LOG_LEVEL=info # Options: fatal, error, warn, info, debug, trace# Discord
DISCORD_APPLICATION_ID=
DISCORD_API_TOKEN=
# Telegram
TELEGRAM_BOT_TOKEN=
# Twitter
TWITTER_TARGET_USERS=
TWITTER_DRY_RUN=false
# Blockchain
EVM_PRIVATE_KEY=
SOLANA_PRIVATE_KEY=package.json- Root monorepo configurationturbo.json- Turbo build pipeline configurationlerna.json- Lerna publishing configurationtsconfig.json- TypeScript configuration.cursorrules- Cursor IDE development rules
packages/core/src/types/index.ts- All core type definitionspackages/core/src/runtime.ts- Main runtime implementationpackages/cli/src/index.ts- CLI entry point.env.example- Environment variable template
README.md- Main project documentationAGENTS.md- Comprehensive agent documentation (45k+ tokens)CHANGELOG.md- Version historyscripts/dev-instructions.md- Developer context and guidance
- Bug Fixes: First identify the bug, research ALL related files, create complete change plan
- Impact Analysis: Identify all possible errors and negative outcomes from changes
- Documentation: Create thorough implementation plan BEFORE writing any code
- Risk Assessment: Thoroughly outline all risks and offer multiple approaches
- Never use stubs, fake code, or incomplete implementations
- Always continue writing until all stubs are replaced with finished, working code
- No POCs: Never deliver proof-of-concepts - only finished, detailed code
- Iteration: Work on files until they are perfect, testing and fixing until all tests pass
- Models hallucinate frequently - thorough testing is critical
- Verify tests are complete and passing before declaring changes correct
- First attempts are usually incorrect - test thoroughly
- Write tests before implementation when possible
- Each agent has a fully separate and unique set of UUIDs to describe the same world, rooms, etc
- Uses deterministic UUID generation
- All IDs swizzled with agent's UUID for consistency
- All components integrate through the runtime
- Services are the state management layer
- Actions drive agent behavior
- Providers supply context
- Evaluators enable learning and reflection
- HTTP routes with "public" exposed as HTML tabs (must have "name" property)
- Plugin compatibility through
/specs(currently defaulting to v2) - Maintain backwards compatibility in changes
- Consider migration paths for proposed changes
- Build Failures: Check TypeScript errors with
bun run build - Test Failures: Run
bun testand check individual package tests - Import Errors: Verify correct use of
@elizaos/corevspackages/core - Environment Issues: Check
.envfile against.env.example
- Agent perspective is key for all abstractions
- Services maintain system state
- Access pattern:
getService(serviceName) - Services can call each other, actions can access services
- Check existing documentation in
packages/docs/ - Review
.cursorrulesfor architectural guidance - Look at existing patterns in similar packages
- Test changes thoroughly before considering complete
This configuration file should be referenced at the start of any ElizaOS development session to ensure proper setup and adherence to project standards.