CLAUDE.md
classic/CLAUDE.mdCLAUDE.md
Quality
89/100
Scores the file, not the repository.Length
1,133 words
49 headings · 12 code blocksRepository
186k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# CLAUDE.md23This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.45## Project Overview67AutoGPT Classic is an experimental, **unsupported** project demonstrating autonomous GPT-4 operation. Dependencies will not be updated, and the codebase contains known vulnerabilities. This is preserved for educational/historical purposes.89## Repository Structure1011```12classic/13├── pyproject.toml # Single consolidated Poetry project14├── poetry.lock # Single lock file15├── forge/16│ └── forge/ # Core agent framework package17├── original_autogpt/18│ └── autogpt/ # AutoGPT agent package19├── direct_benchmark/20│ └── direct_benchmark/ # Benchmark harness package21└── benchmark/ # Challenge definitions (data, not code)22```2324All packages are managed by a single `pyproject.toml` at the classic/ root.2526## Common Commands2728### Setup & Install29```bash30# Install everything from classic/ directory31cd classic32poetry install33```3435### Running Agents36```bash37# Run forge agent38poetry run python -m forge3940# Run original autogpt server41poetry run serve --debug4243# Run autogpt CLI44poetry run autogpt45```4647Agents run on `http://localhost:8000` by default.4849### Benchmarking50```bash51# Run benchmarks52poetry run direct-benchmark run5354# Run specific strategies and models55poetry run direct-benchmark run \56 --strategies one_shot,rewoo \57 --models claude \58 --parallel 45960# Run a single test61poetry run direct-benchmark run --tests ReadFile6263# List available commands64poetry run direct-benchmark --help65```6667### Testing68```bash69poetry run pytest # All tests70poetry run pytest forge/tests/ # Forge tests only71poetry run pytest original_autogpt/tests/ # AutoGPT tests only72poetry run pytest -k test_name # Single test by name73poetry run pytest path/to/test.py # Specific test file74poetry run pytest --cov # With coverage75```7677### Linting & Formatting7879Run from the classic/ directory:8081```bash82# Format everything (recommended to run together)83poetry run black . && poetry run isort .8485# Check formatting (CI-style, no changes)86poetry run black --check . && poetry run isort --check-only .8788# Lint89poetry run flake8 # Style linting9091# Type check92poetry run pyright # Type checking (some errors are expected in infrastructure code)93```9495Note: Always run linters over the entire directory, not specific files, for best results.9697## Architecture9899### Forge (Core Framework)100The `forge` package is the foundation that other components depend on:101- `forge/agent/` - Agent implementation and protocols102- `forge/llm/` - Multi-provider LLM integrations (OpenAI, Anthropic, Groq, LiteLLM)103- `forge/components/` - Reusable agent components104- `forge/file_storage/` - File system abstraction105- `forge/config/` - Configuration management106107### Original AutoGPT108- `original_autogpt/autogpt/app/` - CLI application entry points109- `original_autogpt/autogpt/agents/` - Agent implementations110- `original_autogpt/autogpt/agent_factory/` - Agent creation logic111112### Direct Benchmark113Benchmark harness for testing agent performance:114- `direct_benchmark/direct_benchmark/` - CLI and harness code115- `benchmark/agbenchmark/challenges/` - Test cases organized by category (code, retrieval, data, etc.)116- Reports generated in `direct_benchmark/reports/`117118### Package Structure119All three packages are included in a single Poetry project. Imports are fully qualified:120- `from forge.agent.base import BaseAgent`121- `from autogpt.agents.agent import Agent`122- `from direct_benchmark.harness import BenchmarkHarness`123124## Code Style125126- Python 3.12 target127- Line length: 88 characters (Black default)128- Black for formatting, isort for imports (profile="black")129- Type hints with Pyright checking130131## Testing Patterns132133- Async support via pytest-asyncio134- Fixtures defined in `conftest.py` files provide: `tmp_project_root`, `storage`, `config`, `llm_provider`, `agent`135- Tests requiring API keys (OPENAI_API_KEY, ANTHROPIC_API_KEY) will skip if not set136137## Environment Setup138139Copy `.env.example` to `.env` in the relevant directory and add your API keys:140```bash141cp .env.example .env142# Edit .env with your OPENAI_API_KEY, etc.143```144145## Workspaces146147Agents operate within a **workspace** - a directory containing all agent data and files. The workspace root defaults to the current working directory.148149### Workspace Structure150151```152{workspace}/153├── .autogpt/154│ ├── autogpt.yaml # Workspace-level permissions155│ ├── ap_server.db # Agent Protocol database (server mode)156│ └── agents/157│ └── AutoGPT-{agent_id}/158│ ├── state.json # Agent profile, directives, action history159│ ├── permissions.yaml # Agent-specific permission overrides160│ └── workspace/ # Agent's sandboxed working directory161```162163### Key Concepts164165- **Multiple agents** can coexist in the same workspace (each gets its own subdirectory)166- **File access** is sandboxed to the agent's `workspace/` directory by default167- **State persistence** - agent state saves to `state.json` and survives across sessions168- **Storage backends** - supports local filesystem, S3, and GCS (via `FILE_STORAGE_BACKEND` env var)169170### Specifying a Workspace171172```bash173# Default: uses current directory174cd /path/to/my/project && poetry run autogpt175176# Or specify explicitly via CLI (if supported)177poetry run autogpt --workspace /path/to/workspace178```179180## Settings Location181182Configuration uses a **layered system** with three levels (in order of precedence):183184### 1. Environment Variables (Global)185186Loaded from `.env` file in the working directory:187188```bash189# Required190OPENAI_API_KEY=sk-...191192# Optional LLM settings193SMART_LLM=gpt-4o # Model for complex reasoning194FAST_LLM=gpt-4o-mini # Model for simple tasks195EMBEDDING_MODEL=text-embedding-3-small196197# Optional search providers (for web search component)198TAVILY_API_KEY=tvly-...199SERPER_API_KEY=...200GOOGLE_API_KEY=...201GOOGLE_CUSTOM_SEARCH_ENGINE_ID=...202203# Optional infrastructure204LOG_LEVEL=DEBUG # DEBUG, INFO, WARNING, ERROR205DATABASE_STRING=sqlite:///agent.db # Agent Protocol database206PORT=8000 # Server port207FILE_STORAGE_BACKEND=local # local, s3, or gcs208```209210### 2. Workspace Settings (`{workspace}/.autogpt/autogpt.yaml`)211212Workspace-wide permissions that apply to **all agents** in this workspace:213214```yaml215allow:216 - read_file({workspace}/**)217 - write_to_file({workspace}/**)218 - list_folder({workspace}/**)219 - web_search(*)220221deny:222 - read_file(**.env)223 - read_file(**.env.*)224 - read_file(**.key)225 - read_file(**.pem)226 - execute_shell(rm -rf:*)227 - execute_shell(sudo:*)228```229230Auto-generated with sensible defaults if missing.231232### 3. Agent Settings (`{workspace}/.autogpt/agents/{id}/permissions.yaml`)233234Agent-specific permission overrides:235236```yaml237allow:238 - execute_python(*)239 - web_search(*)240241deny:242 - execute_shell(*)243```244245## Permissions246247The permission system uses **pattern matching** with a **first-match-wins** evaluation order.248249### Permission Check Order2502511. Agent deny list → **Block**2522. Workspace deny list → **Block**2533. Agent allow list → **Allow**2544. Workspace allow list → **Allow**2555. Session denied list → **Block** (commands denied during this session)2566. **Prompt user** → Interactive approval (if in interactive mode)257258### Pattern Syntax259260Format: `command_name(glob_pattern)`261262| Pattern | Description |263|---------|-------------|264| `read_file({workspace}/**)` | Read any file in workspace (recursive) |265| `write_to_file({workspace}/*.txt)` | Write only .txt files in workspace root |266| `execute_shell(python:**)` | Execute Python commands only |267| `execute_shell(git:*)` | Execute any git command |268| `web_search(*)` | Allow all web searches |269270Special tokens:271- `{workspace}` - Replaced with actual workspace path272- `**` - Matches any path including `/`273- `*` - Matches any characters except `/`274275### Interactive Approval Scopes276277When prompted for permission, users can choose:278279| Scope | Effect |280|-------|--------|281| **Once** | Allow this one time only (not saved) |282| **Agent** | Always allow for this agent (saves to agent `permissions.yaml`) |283| **Workspace** | Always allow for all agents (saves to `autogpt.yaml`) |284| **Deny** | Deny this command (saves to appropriate deny list) |285286### Default Security287288Out of the box, the following are **denied by default**:289- Reading sensitive files (`.env`, `.key`, `.pem`)290- Destructive shell commands (`rm -rf`, `sudo`)291- Operations outside the workspace directory292
Also in Significant-Gravitas/AutoGPT
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| Significant-Gravitas/AutoGPTautogpt_platform/frontend/src/tests/AGENTS.md · 186k | AGENTS.md | teststylearchtypes+2 | 81/100 | 3 days ago | |
| Significant-Gravitas/AutoGPT.github/copilot-instructions.md · 186k | Copilot instructions | setupbuildtestlint-format+10 | 88/100 | 3 days ago | |
| Significant-Gravitas/AutoGPTAGENTS.md · 186k | AGENTS.md | teststylearchgit+1 | 87/100 | 3 days ago | |
| Significant-Gravitas/AutoGPTautogpt_platform/AGENTS.md · 186k | AGENTS.md | setuptestarchtesting-strategy+3 | 77/100 | 3 days ago | |
| Significant-Gravitas/AutoGPTautogpt_platform/backend/AGENTS.md · 186k | AGENTS.md | setuptestlint-formatstyle+9 | 81/100 | 3 days ago | |
| Significant-Gravitas/AutoGPTautogpt_platform/backend/backend/copilot/graphiti/AGENTS.md · 186k | AGENTS.md | styleperformance | 66/100 | 3 days ago | |
| Significant-Gravitas/AutoGPTautogpt_platform/frontend/AGENTS.md · 186k | AGENTS.md | setupbuildtestlint-format+7 | 96/100 | 3 days ago | |
| Significant-Gravitas/AutoGPTclassic/direct_benchmark/CLAUDE.md · 186k | CLAUDE.md | setuptestlint-formatarch+4 | 78/100 | 3 days ago | |
| Significant-Gravitas/AutoGPTclassic/forge/CLAUDE.md · 186k | CLAUDE.md | teststylearchtypes+3 | 73/100 | 3 days ago | |
| Significant-Gravitas/AutoGPTclassic/original_autogpt/CLAUDE.md · 186k | CLAUDE.md | testarchuiperformance+2 | 90/100 | 3 days ago | |
| Significant-Gravitas/AutoGPT.claude/skills/vercel-react-best-practices/AGENTS.md · 186k | AGENTS.md | buildlint-formatstyledependencies+4 | 61/100 | 3 days ago |
Diff against autogpt_platform/frontend/src/tests/AGENTS.md Diff against .github/copilot-instructions.md Diff against AGENTS.md Diff against autogpt_platform/AGENTS.md Diff against autogpt_platform/backend/AGENTS.md Diff against autogpt_platform/backend/backend/copilot/graphiti/AGENTS.md Diff against autogpt_platform/frontend/AGENTS.md Diff against classic/direct_benchmark/CLAUDE.md Diff against classic/forge/CLAUDE.md Diff against classic/original_autogpt/CLAUDE.md Diff against .claude/skills/vercel-react-best-practices/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| dotCMS/corecore-web/CLAUDE.md · 949 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 949 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | today | |
| khrnchn/sedekah-jeCLAUDE.md · 89 | CLAUDE.md | testlint-formatstylearch+6 | 97/100 | 3 days ago |
