Skip to main content

Autonomous AI agent with subprocess orchestration, dynamic tool creation, and a local-first web interface

Project description

Plutus — Autonomous AI Agent with Subprocess Orchestration

A better, easier-to-use AI agent that spawns subprocesses to edit code, analyze files, and create new tools on the fly.

FeaturesQuick StartArchitectureToolsDynamic ToolsConfiguration


What is Plutus?

Plutus is an autonomous AI agent system that gives Claude (or any LLM) the ability to spawn isolated subprocesses for file editing, code analysis, shell execution, and dynamic tool creation. Think of it as Claude Code on steroids — the AI can not only run commands and edit files, but also create entirely new tools at runtime to solve problems it wasn't originally designed for.

Key Differentiators

Feature OpenClaw Plutus
File editing Basic read/write Subprocess-isolated surgical edits with diff output
Code analysis None Full AST analysis (functions, classes, complexity, call graphs)
Subprocess spawning None Parallel worker pool with JSON protocol
Dynamic tool creation None Create, validate, and hot-load new Python tools at runtime
CLI experience Basic Rich interactive REPL with slash commands
Guardrails Basic 4-tier system (observer → autonomous) with audit logging
Planning None Built-in plan/step tracking with auto-progress

Features

Subprocess Orchestration

The agent spawns isolated worker subprocesses for every operation — file edits, code analysis, shell commands, and custom scripts all run in their own process with resource limits and timeouts.

Intelligent Code Editing

Surgical find/replace edits with diff output. The agent reads files, applies precise changes, and verifies the result — all in subprocess isolation.

Deep Code Analysis

AST-based analysis of Python files:

  • Function and class extraction with signatures
  • Cyclomatic complexity scoring (A–F ratings)
  • Import dependency mapping
  • Call graph generation
  • TODO/FIXME/HACK detection
  • Module summarization

Dynamic Tool Creation

The agent can write new Python tools at runtime:

  1. Writes the tool code
  2. Validates it (syntax check)
  3. Saves it to ~/.plutus/custom_tools/
  4. Hot-loads it into the tool registry
  5. Uses it immediately

4-Tier Guardrail System

  • Observer — Read-only, AI can only observe
  • Assistant — Every action requires user approval
  • Operator — Pre-approved actions run autonomously
  • Autonomous — Full control, no restrictions

Multiple Interfaces

  • Terminal REPL (plutus chat) — Rich interactive chat with slash commands
  • Single prompt (plutus run "...") — Execute one task and exit
  • Web UI (plutus start) — Full web interface with WebSocket streaming

Quick Start

Installation

Linux & macOS:

curl -fsSL https://useplutus.ai/install.sh | bash

Windows (PowerShell):

iwr -useb https://useplutus.ai/install.ps1 | iex

That's it — the installer handles everything (dependencies, setup wizard, and first launch).

Manual installation
# Clone the repository
git clone https://github.com/Crypt0nly/plutus.git
cd plutus

# Install with pip
pip install -e .

# Run setup wizard
plutus setup

First Run

# Interactive terminal chat
plutus chat

# Or run a single prompt
plutus run "Create a Python script that sorts a CSV file by the second column"

# Or launch the web UI
plutus start

Chat Commands

Inside plutus chat, use slash commands:

Command Description
/help Show available commands
/tools List all available tools
/plan Show current execution plan
/clear Start a new conversation
/tier Show or change guardrail tier
/workers Show active subprocesses
/exit Exit the chat

Architecture

┌─────────────────────────────────────────────────────┐
│                   Agent Runtime                      │
│  ┌──────────┐  ┌──────────┐  ┌──────────────────┐  │
│  │   LLM    │  │ Planner  │  │   Guardrails     │  │
│  │ (Claude) │  │          │  │ (4-tier system)  │  │
│  └────┬─────┘  └──────────┘  └──────────────────┘  │
│       │                                              │
│  ┌────▼──────────────────────────────────────────┐  │
│  │              Tool Registry                     │  │
│  │  ┌────────┐ ┌────────────┐ ┌───────────────┐  │  │
│  │  │ Shell  │ │ Code Editor│ │ Code Analysis │  │  │
│  │  └────────┘ └────────────┘ └───────────────┘  │  │
│  │  ┌────────────┐ ┌──────────────┐ ┌─────────┐  │  │
│  │  │ Subprocess │ │ Tool Creator │ │ Browser │  │  │
│  │  └────────────┘ └──────────────┘ └─────────┘  │  │
│  │  ┌──────────┐ ┌─────────┐ ┌─────────────────┐ │  │
│  │  │Filesystem│ │ Process │ │ Custom Tools... │ │  │
│  │  └──────────┘ └─────────┘ └─────────────────┘ │  │
│  └───────────────────┬───────────────────────────┘  │
│                      │                               │
│  ┌───────────────────▼───────────────────────────┐  │
│  │           Subprocess Manager                   │  │
│  │  ┌─────────────┐  ┌──────────────────────┐    │  │
│  │  │ Worker Pool │  │  JSON stdin/stdout    │    │  │
│  │  │ (max: 8)    │  │  protocol             │    │  │
│  │  └─────────────┘  └──────────────────────┘    │  │
│  └───────────────────────────────────────────────┘  │
│                      │                               │
│  ┌───────────────────▼───────────────────────────┐  │
│  │           Worker Subprocesses                  │  │
│  │  ┌──────┐ ┌──────────┐ ┌──────────┐ ┌──────┐ │  │
│  │  │Shell │ │File Edit │ │Code Anal.│ │Custom│ │  │
│  │  │Worker│ │Worker    │ │Worker    │ │Worker│ │  │
│  │  └──────┘ └──────────┘ └──────────┘ └──────┘ │  │
│  └───────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────┘

Subprocess Communication Protocol

Workers communicate via JSON over stdin/stdout (one JSON object per line):

Agent → Worker:  {"action": "edit", "path": "/file.py", "edits": [...]}
Worker → Agent:  {"success": true, "result": {"changes": 2, "diff": "..."}}

This design provides:

  • Isolation — each operation runs in its own process
  • Safety — crashes in workers don't affect the agent
  • Parallelism — multiple workers can run simultaneously
  • Simplicity — JSON protocol is easy to debug and extend

Tools

Built-in Tools

Tool Description
shell Execute shell commands
filesystem File system operations (legacy, still available)
code_editor Create, read, and edit files via subprocess
code_analysis AST-based Python code analysis via subprocess
subprocess Direct subprocess spawning for parallel tasks
tool_creator Create new tools at runtime
process System process management
system_info System information queries
browser Web browsing (Playwright)
clipboard Clipboard operations
desktop Desktop/window management
app_manager Application management

Code Editor Operations

read       — Read file content (with optional line range)
write      — Create or overwrite a file
append     — Append content to a file
edit       — Apply surgical find/replace edits
delete     — Delete a file or directory
move       — Move/rename a file
copy       — Copy a file or directory
mkdir      — Create directories
list       — List directory contents
find       — Find files by glob pattern
grep       — Search file contents with regex
diff       — Show diff between two files

Code Analysis Operations

analyze        — Full analysis (everything below combined)
find_functions — List all function/method definitions with signatures
find_classes   — List all class definitions with methods
find_imports   — Extract all import statements
find_todos     — Find TODO/FIXME/HACK/NOTE comments
complexity     — Calculate cyclomatic complexity per function
symbols        — Extract all top-level symbols
call_graph     — Build function call graph
summarize      — Generate human-readable summary

Dynamic Tool Creation

The agent can create new tools when it encounters a task that requires capabilities it doesn't have:

# Example: Agent creates a CSV processor tool
tool_creator(
    operation="create",
    tool_name="csv_processor",
    description="Process and transform CSV files",
    code="""
import csv
from pathlib import Path

def main(args):
    path = args.get('path', '')
    operation = args.get('operation', 'read')
    
    if operation == 'read':
        with open(path) as f:
            reader = csv.DictReader(f)
            rows = list(reader)
        return {'success': True, 'result': {'rows': rows, 'count': len(rows)}}
    
    elif operation == 'sort':
        column = args.get('column', '')
        with open(path) as f:
            reader = csv.DictReader(f)
            rows = sorted(list(reader), key=lambda r: r.get(column, ''))
        return {'success': True, 'result': {'rows': rows, 'count': len(rows)}}
    
    return {'success': False, 'error': f'Unknown operation: {operation}'}
"""
)

Created tools are:

  • Validated — syntax-checked before saving
  • Persisted — saved to ~/.plutus/custom_tools/ across sessions
  • Hot-loaded — immediately available in the tool registry
  • Isolated — executed in subprocess workers

Configuration

Config File: ~/.plutus/config.json

{
  "model": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-6",
    "temperature": 0.7,
    "max_tokens": 4096
  },
  "guardrails": {
    "tier": "operator",
    "audit_enabled": true
  },
  "agent": {
    "max_tool_rounds": 25
  },
  "planner": {
    "enabled": true,
    "auto_plan": true
  },
  "gateway": {
    "host": "127.0.0.1",
    "port": 7777
  }
}

Supported Providers

Provider Models Config
Anthropic Claude 4 Sonnet, Claude 4 Opus, etc. ANTHROPIC_API_KEY
OpenAI GPT-4.1, GPT-4.1-mini, etc. OPENAI_API_KEY
Ollama Llama 3.2, Mistral, etc. Local, no key needed
Custom Any OpenAI-compatible endpoint API_KEY + base URL

API Keys

Keys are stored securely in ~/.plutus/.secrets.json (chmod 600) and never exposed via the API. Set them via:

# Setup wizard
plutus setup

# Environment variable
export ANTHROPIC_API_KEY=sk-ant-...

# Or via the web UI settings page

CLI Reference

plutus                  # Show help
plutus start            # Launch web UI + API server
plutus chat             # Interactive terminal chat
plutus run "prompt"     # Run a single prompt
plutus setup            # Setup wizard
plutus status           # Show configuration
plutus tools            # List available tools
plutus set-tier <tier>  # Change guardrail tier
plutus audit            # Show audit log
plutus config-show      # Display full config as JSON

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Run specific test file
pytest tests/test_subprocess.py -v

# Lint
ruff check plutus/

Project Structure

plutus/
├── plutus/
│   ├── __init__.py
│   ├── __main__.py
│   ├── cli.py                      # CLI with chat REPL
│   ├── config.py                   # Configuration management
│   ├── core/
│   │   ├── agent.py                # Main agent runtime
│   │   ├── conversation.py         # Conversation management
│   │   ├── heartbeat.py            # Heartbeat system
│   │   ├── llm.py                  # LLM client (LiteLLM)
│   │   ├── memory.py               # SQLite memory store
│   │   ├── planner.py              # Plan management
│   │   └── subprocess_manager.py   # Subprocess orchestrator
│   ├── gateway/                    # Web API + WebSocket
│   ├── guardrails/                 # Permission tiers + audit
│   ├── skills/                     # YAML skill definitions
│   ├── tools/
│   │   ├── base.py                 # Tool base class
│   │   ├── registry.py             # Tool registry with hot-reload
│   │   ├── code_analysis.py        # AST-based code analysis
│   │   ├── code_editor.py          # File creation and editing
│   │   ├── subprocess_tool.py      # Direct subprocess spawning
│   │   ├── tool_creator.py         # Dynamic tool creation
│   │   ├── shell.py                # Shell commands
│   │   ├── filesystem.py           # File system operations
│   │   ├── process.py              # Process management
│   │   ├── browser.py              # Web browsing
│   │   └── ...
│   └── workers/
│       ├── shell_worker.py         # Shell command worker
│       ├── file_edit_worker.py     # File editing worker
│       ├── code_analysis_worker.py # Code analysis worker
│       └── custom_worker.py        # Dynamic tool worker
├── ui/                             # React web interface
├── bridge/                         # Local ↔ cloud workspace sync
├── shared/                         # Shared models and memory (used by local + cloud)
├── tests/
│   ├── test_subprocess.py          # 34 comprehensive tests
│   ├── test_config.py
│   ├── test_guardrails.py
│   └── test_tools.py
├── pyproject.toml
└── README.md

Cloud Version

A hosted, fully managed version of Plutus is available at useplutus.ai for users who want a zero-setup cloud experience. The cloud version includes:

  • Persistent cloud workspace with push/pull sync to your local Plutus
  • Multi-device access via any browser
  • Managed infrastructure — no API keys or server setup required
  • Priority support

The cloud backend is open-source and available to the community. Contributions, self-hosting, and custom deployments are welcome — check out the documentation to get started.

License

AGPL-3.0 License — see LICENSE for details.

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

plutus_ai-0.3.245-cp313-cp313-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

plutus_ai-0.3.245-cp313-cp313-macosx_10_13_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

plutus_ai-0.3.245-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

plutus_ai-0.3.245-cp312-cp312-manylinux_2_28_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

plutus_ai-0.3.245-cp312-cp312-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

plutus_ai-0.3.245-cp312-cp312-macosx_10_13_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

plutus_ai-0.3.245-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

plutus_ai-0.3.245-cp311-cp311-manylinux_2_28_x86_64.whl (8.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

plutus_ai-0.3.245-cp311-cp311-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

plutus_ai-0.3.245-cp311-cp311-macosx_10_9_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

File details

Details for the file plutus_ai-0.3.245-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 94229796cc4b7266c0214d23d95962dad224608bf1b48bc185ec245051e39de6
MD5 9747a29a030b846ef4be43d486873857
BLAKE2b-256 3e9906011d7f00e9e58fab8e7e6c132ae045095deb81ac22cffe0b0c4fa8547d

See more details on using hashes here.

File details

Details for the file plutus_ai-0.3.245-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 e8c9b3f5b3387b23fcc77ba9c8793616816a9d45aae09e1ec12043159f70b758
MD5 e51cc560e80d98f924fbf98dbf650acc
BLAKE2b-256 5dbe5ac4661e9cbfbfa8bc07845c1ba45479f60c080e2558d8668c3aa99fc3cc

See more details on using hashes here.

File details

Details for the file plutus_ai-0.3.245-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 348650a89f258e3c5cf7deea16bed6b0510648485461327c531f486db5d3351c
MD5 ad1466c77ca0cf254d9ac6390374c0d5
BLAKE2b-256 0ebef8b8330238adeb557bcbfd9659ae4ed6a1c4d30576b9a7228af3fd31f7b7

See more details on using hashes here.

File details

Details for the file plutus_ai-0.3.245-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a2e5575f5f7d10025b852013dcfa361e30532e520d1f6b9788ce199c243e167e
MD5 621e38d12c0f511ddbb7390ebc1369f7
BLAKE2b-256 c5e87b604a938d8cddc6fe4cbf40582045235d1e96fb59943c680068a18f148a

See more details on using hashes here.

File details

Details for the file plutus_ai-0.3.245-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 78a1e9ed82a73301e0e767201482e2e7f12a4c1309687c432464fb065de74223
MD5 272ff9295a1281936f099dc9f6e0e376
BLAKE2b-256 48ad3fb8168bd4facebb69aa6455b3f3598fe39a94bc182b5ed1a92e51bb5c43

See more details on using hashes here.

File details

Details for the file plutus_ai-0.3.245-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 38ba9dce9359148a366da3a02dcba1dd0d1ef80a32f178889d389c9b9b1ac4f8
MD5 28cc4e644eaeec2161b53b7f066005ff
BLAKE2b-256 ce55baa1476d7e0b7668b1f7b4ed693806b0df1fbaa5f2306ea7392684375b10

See more details on using hashes here.

File details

Details for the file plutus_ai-0.3.245-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 30b920dc3fe205e87d8ab64ee95996862fc5ae158efdbf41350ab3287238dd65
MD5 9817555e782a56df0da2ab637c539d25
BLAKE2b-256 d17aa7aa9f0476685b5a5d3d6b2d1d985016add65f4b790eca9bc8a1a7be6f00

See more details on using hashes here.

File details

Details for the file plutus_ai-0.3.245-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8b865740e28fcda96a4c105c20ceef1b4d3d6001ac6c2d4de51fcd6a4e7d374b
MD5 6d4c1e8b2f7d938623d98744a4bf0fcb
BLAKE2b-256 d4406b17f06e9cc07154b797c5925ea0c39b2434aced36220d503d8c56eda048

See more details on using hashes here.

File details

Details for the file plutus_ai-0.3.245-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a23af730a7b9b63b08b7f8e2d2a4de91e9a19db6067f83c318472db2655884e6
MD5 6b6e7f2a5091be78b562c47126ca8e3e
BLAKE2b-256 ee765fca83161bd19f93c21612b91bcc0385c3300fff02f798e22aca21c5a661

See more details on using hashes here.

File details

Details for the file plutus_ai-0.3.245-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for plutus_ai-0.3.245-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b4d03e8a154f410fababecfc2cc159643239e77c1563967e6b34e66930ea36eb
MD5 01b55e1d212f48d2df55b8ab5d8f2d52
BLAKE2b-256 a9f73a2d570825fb6745bf239ddad8b80a7c5803656f6ead2db41e0a62a2887f

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