Skip to content

Latest commit

 

History

History
1169 lines (829 loc) · 22.6 KB

File metadata and controls

1169 lines (829 loc) · 22.6 KB

Tools

Claude VM supports installing various development tools during template creation. This guide covers all available tools, what they provide, and how to configure them.

Table of Contents

Available Tools

Tool What it Provides Use Case
git Git identity, signing config Any git repository
docker Docker Engine, Docker Compose Containerized development
node Node.js LTS, npm JavaScript/TypeScript projects
python Python 3, pip Python development
rust Rust toolchain, cargo, clippy Rust development
chromium Chromium browser, DevTools Web scraping, browser testing
gpg GPG agent forwarding, key sync Signed commits, encryption
gh GitHub CLI, authentication GitHub operations
rtk Token compression for LLM command outputs Reduce token costs by 60-90%
mise Polyglot tool manager (Bun, Node, Python) Install and manage runtimes
debug-that Universal debugger CLI for AI agents Debug Node, Bun, Python, C/C++
nyolo PreToolUse hook for permission enforcement Restrict Claude Code tool access

Note: Network isolation is configured separately via [security.network] - see Network Isolation below.

Installing Tools

During Setup

Install tools when creating a template:

# Install specific tools
claude-vm setup --git --docker --node

# Install all tools
claude-vm setup --all

Via Configuration

Define tools in .claude-vm.toml:

[tools]
git = true
docker = true
node = true
python = false  # Explicitly disabled

Default: All tools are false if not specified.

Precedence

CLI flags override configuration:

# Config enables docker, CLI disables it
# .claude-vm.toml: docker = true

claude-vm setup --git --node  # Only git and node installed

Tool Details

Git

Installs:

  • Git identity configuration (name, email)
  • Commit signing setup (GPG or SSH)
  • Git configuration from host

Configuration:

[tools]
git = true

CLI:

claude-vm setup --git

What it does:

  1. Copies user.name and user.email from host
  2. Detects and configures commit signing
  3. Provides context about git configuration

Commit Signing:

  • GPG signing: Requires gpg tool enabled
  • SSH signing: Requires SSH agent forwarding (-A flag)

Context provided:

Git configured:

- User: John Doe <john@example.com>
- Signing: GPG (requires --gpg capability)

Usage:

claude-vm shell
$ git config user.name   # Your name from host
$ git config user.email  # Your email from host

Docker

Installs:

  • Docker Engine
  • Docker Compose
  • Docker daemon configuration

Configuration:

[tools]
docker = true

CLI:

claude-vm setup --docker

What it does:

  1. Installs Docker Engine
  2. Installs Docker Compose v2
  3. Configures Docker daemon
  4. Starts Docker service
  5. Adds user to docker group

Context provided:

Docker available:

- Version: Docker 24.0.7
- Compose: Docker Compose v2.23.0
- Status: Running

Usage:

claude-vm shell
$ docker ps                    # List containers
$ docker-compose up -d         # Start services
$ docker build -t myapp .      # Build images

Node.js

Installs:

  • Node.js (LTS version)
  • npm (latest)
  • Node environment

Configuration:

[tools]
node = true

CLI:

claude-vm setup --node

What it does:

  1. Installs Node.js LTS (currently 20.x)
  2. Installs npm
  3. Configures npm global directory

Context provided:

Node.js available:

- Version: v20.10.0
- npm: 10.2.3
- Global packages: ~/.npm-global

Usage:

claude-vm shell
$ node --version              # Check Node version
$ npm install                 # Install dependencies
$ npm run build               # Run build scripts

Python

Installs:

  • Python 3
  • pip
  • Python development headers

Configuration:

[tools]
python = true

CLI:

claude-vm setup --python

What it does:

  1. Installs Python 3 (latest from Ubuntu repos)
  2. Installs pip
  3. Installs python3-dev for native extensions

Context provided:

Python available:

- Version: Python 3.10.12
- pip: 22.0.2
- Location: /usr/bin/python3

Usage:

claude-vm shell
$ python3 --version           # Check Python version
$ pip install -r requirements.txt  # Install packages
$ python3 app.py              # Run Python scripts

Rust

Installs:

  • Rustup (Rust toolchain manager)
  • Rust stable toolchain (rustc, cargo)
  • rustfmt (code formatter)
  • clippy (linter)

Configuration:

[tools]
rust = true

CLI:

claude-vm setup --rust

What it does:

  1. Installs Rustup via official installer (https://sh.rustup.rs)
  2. Installs stable Rust toolchain as default
  3. Adds rustfmt and clippy components
  4. Configures PATH to include $CARGO_HOME/bin

Context provided:

Rustup version: rustup 1.27.0 (2024-12-12)
Rust version: rustc 1.83.0 (90b35a623 2024-11-26)
Cargo version: cargo 1.83.0 (5ffbef321 2024-10-29)
Rustfmt version: rustfmt 1.8.0-stable (90b35a623 2024-11-26)
Clippy version: clippy 0.1.83 (90b35a62 2024-11-26)
Installed toolchains: stable-aarch64-unknown-linux-gnu (default)

Usage:

claude-vm shell
$ rustc --version              # Check Rust version
$ cargo new my-project         # Create new Rust project
$ cargo build                  # Build project
$ cargo test                   # Run tests
$ cargo fmt                    # Format code
$ cargo clippy                 # Run linter

Toolchain Management:

Rustup allows managing multiple Rust versions:

# Install nightly toolchain
$ rustup toolchain install nightly

# Use nightly for current directory
$ rustup override set nightly

# Update toolchains
$ rustup update

Notes:

  • Rust is installed per-user in ~/.cargo and ~/.rustup
  • Installation is idempotent - running setup multiple times is safe
  • Stable toolchain is used by default, suitable for most development
  • The capability ensures rustfmt and clippy are always available

Chromium

Installs:

  • Chromium browser
  • Chrome DevTools Protocol support
  • Browser automation tools

Configuration:

[tools]
chromium = true

CLI:

claude-vm setup --chromium

What it does:

  1. Installs Chromium browser
  2. Configures for headless operation
  3. Sets up Chrome DevTools MCP server

Context provided:

Chromium available:

- Version: Chromium 118.0.5993.0
- Headless: Supported
- DevTools: Available via MCP

Usage:

claude-vm shell
$ chromium --version          # Check version
$ chromium --headless --dump-dom https://example.com

Useful for:

  • Web scraping
  • Browser automation
  • Screenshot generation
  • Testing web applications

Troubleshooting:

If your project defines a chromium MCP configuration, it will be used instead of the one provided by Claude VM, which can prevent Chromium from starting.

GPG

Installs:

  • GPG agent forwarding setup
  • Public key synchronization
  • Signing configuration

Configuration:

[tools]
gpg = true

CLI:

claude-vm setup --gpg

What it does:

  1. Forwards GPG agent socket from host
  2. Syncs public keys to VM
  3. Configures GPG for git commit signing
  4. Sets up agent socket paths

Context provided:

GPG available:

- Agent: Forwarded from host
- Keys: [Your Key ID]
- Signing: Enabled for git commits

Usage:

claude-vm shell
$ gpg --list-keys             # List available keys
$ git commit -S -m "msg"      # Sign commit
$ gpg --sign file.txt         # Sign file

Important: Your private key stays on host - only the agent is forwarded.

GitHub CLI

Installs:

  • GitHub CLI (gh)
  • GitHub authentication
  • Git credential helper

Configuration:

[tools]
gh = true

CLI:

claude-vm setup --gh

What it does:

  1. Installs GitHub CLI
  2. Configures git credential helper
  3. Syncs authentication from host

Context provided:

GitHub CLI available:

- Version: gh 2.40.0
- Authenticated: Yes
- User: @yourusername

Usage:

claude-vm shell
$ gh repo list                # List repositories
$ gh pr create                # Create pull request
$ gh issue list               # List issues
$ gh api /user                # Make API calls

RTK (Rust Token Killer)

Installs:

  • RTK CLI proxy
  • Token compression for common development commands
  • Optional hook-first mode for transparent rewriting
  • Analytics tracking

Configuration:

Simple syntax (enable with defaults):

[tools]
rtk = true  # Enable with hook_mode = true (default)

Advanced syntax (customize settings):

[tools.rtk]
# Presence of section enables RTK
# Hook mode defaults to true

# Disable hook-first mode (requires explicit rtk prefix)
hook_mode = false

CLI:

# Enable during setup
claude-vm setup --rtk

# Or add to existing template
# Edit .claude-vm.toml and run setup again

What it does:

  1. Installs RTK via official install script
  2. Configures hook-first mode (optional, enabled by default)
  3. Sets up automatic command rewriting for supported tools
  4. Tracks token savings analytics

Hook-First Mode:

When enabled (default), RTK automatically rewrites commands:

# With hook_mode = true (default):
$ git status                  # Automatically becomes: rtk git status
$ cargo test                  # Automatically becomes: rtk cargo test

# With hook_mode = false:
$ rtk git status             # Explicit prefix required
$ rtk cargo test             # Explicit prefix required

Context provided:

RTK (Rust Token Killer) version: rtk 0.1.0
Status: ✓ Installed and ready

Hook-first mode: ✓ Enabled (transparent command rewriting)

Token Savings Analytics:
  Total saved: 1.2M tokens (67% reduction)
  Commands optimized: 342
  Top savings: git (45%), cargo (32%), pytest (15%)

Run 'rtk gain --graph' for 30-day visualization

Supported: git, cargo, vitest, pytest, tsc, go, eslint, biome, ruff, etc.

Usage:

claude-vm shell

# With hook-first mode (default):
$ git status                  # Output compressed automatically
$ cargo test                  # Test output compressed automatically
$ npm run build               # Build output compressed automatically

# Without hook-first mode:
$ rtk git status             # Compress git status output
$ rtk cargo test             # Compress test output
$ rtk npm run build          # Compress build output

# View analytics:
$ rtk gain                   # Show token savings
$ rtk gain --graph           # 30-day visualization

Supported Commands:

RTK provides token compression for:

  • Git: status, log, diff, blame
  • Cargo: test, build, clippy, check
  • Node: vitest, jest, eslint, biome
  • Python: pytest, ruff, mypy
  • Go: test, build, vet
  • TypeScript: tsc, type-check
  • And many more...

Token Savings:

Typical reductions by command type:

  • Test output: 80-90% reduction
  • Git logs: 60-70% reduction
  • Build output: 70-85% reduction
  • Lint/format: 75-85% reduction

Benefits:

  1. Lower costs: Reduce Claude API token consumption by 60-90%
  2. Faster responses: Smaller context = faster Claude responses
  3. More context: Fit more information in Claude's context window
  4. Zero overhead: Negligible performance impact (<10ms per command)
  5. Transparent: Hook mode requires no workflow changes

Opt-Out of Hook Mode:

If you prefer explicit control:

[tools.rtk]
hook_mode = false  # Require explicit 'rtk' prefix

Important Notes:

  • RTK is read-only - it never modifies your code or git history
  • Original command outputs are preserved in RTK's cache
  • Analytics are stored locally in ~/.rtk/analytics.json
  • Hook-first mode can be toggled at any time

Mise

Installs:

  • Mise polyglot tool manager via official installer
  • Optional pre-installed tools (Bun, Node.js, Python, etc.)

Configuration:

Simple syntax (install mise without pre-installing tools):

[tools]
mise = true

Advanced syntax (pre-install tools during template creation):

[tools.mise]
install = ["bun@latest", "node@lts", "python@3.12"]

What it does:

  1. Installs Mise via official install script (curl https://mise.jdx.dev/install.sh | sh)
  2. Pre-installs any tools listed in install during template creation
  3. Activates Mise environment at runtime (mise activate bash) so tools are on PATH

Context provided:

Mise version: mise 2024.x.x
Installed tools: bun@1.1.0, node@20.11.0

Use 'mise use --global <tool>@<version>' to install tools.

Usage:

claude-vm shell
$ mise use --global bun@latest   # Install Bun
$ mise use --global node@lts     # Install Node.js LTS
$ mise ls                        # List installed tools
$ mise ls --current              # Show active tool versions

Network isolation note:

Users with network isolation enabled must add mise.jdx.dev to allowed_domains.

debug-that

Installs:

  • debug-that CLI via Bun global install
  • Bun runtime (via mise) if not already available

Requires: mise capability

Configuration:

[tools]
mise = true
debug-that = true

What it does:

  1. Ensures Bun is available (installs via mise use --global bun@latest if needed)
  2. Installs debug-that globally via bun install --global debug-that

Context provided:

debug-that version: 1.x.x
Supported runtimes: Node.js (CDP), Bun (CDP), LLDB (DAP), Python/debugpy (DAP)
Commands: dbg launch, dbg attach, dbg break, dbg step, dbg vars, dbg eval, ...
Install adapters: dbg install <adapter>

Usage:

claude-vm shell
$ dbg launch node app.js          # Launch Node.js debugger
$ dbg launch bun server.ts        # Launch Bun debugger
$ dbg attach --pid 1234           # Attach to running process
$ dbg install lldb                # Install LLDB adapter

Network isolation note:

Users with network isolation enabled may need to add npm registry domains to allowed_domains since bun install --global fetches from the npm registry.

Nyolo

Installs:

  • Nyolo PreToolUse hook for Claude Code via bunx nyolo install
  • Bun runtime (via mise) if not already available

Requires: mise capability

Configuration:

[tools]
mise = true
nyolo = true

What it does:

  1. Ensures Bun is available (installs via mise use --global bun@latest if needed)
  2. Registers the nyolo PreToolUse hook via bunx nyolo install

Context provided:

Nyolo: PreToolUse hook for Claude Code permission enforcement
Status: (active rules summary)
Config: ./nyolo.config.js (project) or ~/.claude/nyolo.config.js (global)

Usage:

claude-vm shell
# Create a project config
$ cat > nyolo.config.js << 'EOF'
module.exports = {
  rules: [
    { tool: "Bash", deny: ["rm -rf /"] },
  ],
};
EOF

# Or create a global config
$ cat > ~/.claude/nyolo.config.js << 'EOF'
module.exports = {
  rules: [/* your rules */],
};
EOF

Note: The nyolo hook writes to ~/.claude/settings.json inside the VM, which is separate from your host configuration.

Network Isolation

Installs:

  • mitmproxy for HTTP/HTTPS filtering
  • iptables rules for protocol blocking
  • Domain-based policy enforcement

Configuration:

[security.network]
enabled = true
mode = "denylist"  # or "allowlist"
blocked_domains = ["example.com", "*.ads.com"]

CLI:

claude-vm setup --network-isolation

What it does:

  1. Installs mitmproxy from official binaries
  2. Generates and installs CA certificate
  3. Configures transparent HTTP/HTTPS proxy
  4. Sets up iptables rules for protocol blocking
  5. Enforces domain filtering policies

Context provided:

Network isolation is enabled with the following policies:

- HTTP/HTTPS traffic: Filtered through in-VM proxy (localhost:8080)
- Policy mode: denylist
- Blocked domains: example.com, *.ads.com (2 patterns)
- Raw TCP/UDP: Blocked
- Private networks: Blocked
- Cloud metadata: Blocked

Usage:

# Check status
claude-vm network status

# View logs
claude-vm network logs
claude-vm network logs -n 100
claude-vm network logs -f "blocked"

# Test a domain
claude-vm network test example.com
claude-vm network test api.github.com

Policy Modes:

  • Allowlist: Block all domains except explicitly allowed
  • Denylist: Allow all domains except explicitly blocked

Important: Network isolation provides policy enforcement, not security isolation. See Network Isolation documentation for details on security model and limitations.

Use cases:

  • Compliance requirements
  • Preventing accidental data leaks
  • API access restrictions
  • Internal security policies
  • Auditing and logging

Tool Configuration

Basic Configuration

[tools]
git = true
docker = true
node = true

Complete Configuration

[tools]
git = true        # Git identity and signing
docker = true     # Docker + Compose
node = true       # Node.js + npm
python = true     # Python 3 + pip
chromium = true   # Chromium browser
gpg = true        # GPG agent forwarding
gh = true         # GitHub CLI
rtk = true        # Token compression (simple syntax)

# Advanced RTK configuration (alternative to simple syntax):
# [tools.rtk]
# hook_mode = false  # Disable auto-rewriting

Install Everything

# CLI flag
claude-vm setup --all

# Equivalent config
[tools]
git = true
docker = true
node = true
python = true
chromium = true
gpg = true
gh = true

Selective Installation

# Only what you need
claude-vm setup --git --docker  # Just git and docker

Disable in Config

[tools]
docker = true
node = true
python = false    # Explicitly disabled
chromium = false  # Explicitly disabled

Tool Context

Each enabled tool automatically provides context to Claude via ~/.claude/CLAUDE.md.

Example Context

# Claude VM Context

## VM Configuration

- **Disk**: 20 GB
- **Memory**: 8 GB

## Enabled Capabilities

### docker

Docker engine for container management.

- **Version**: Docker 24.0.7
- **Compose**: Docker Compose v2.23.0
- **Status**: Running

### node

Node.js runtime and npm package manager.

- **Version**: v20.10.0
- **npm**: 10.2.3

### git

Git version control with identity configured.

- **User**: John Doe <john@example.com>
- **Signing**: GPG enabled

This context helps Claude understand:

  • What tools are available
  • How to use them
  • Current versions
  • Configuration details

Examples

Web Development

# Node.js + Docker for full-stack
claude-vm setup --git --node --docker

Tools available:

  • node - Run JavaScript
  • npm - Package management
  • docker - Run databases, Redis, etc.
  • git - Version control

Python Data Science

# Python + Chromium for web scraping
claude-vm setup --git --python --chromium

Tools available:

  • python3 - Run Python scripts
  • pip - Install packages
  • chromium - Browser automation
  • git - Version control

DevOps

# Docker + GitHub CLI
claude-vm setup --git --docker --gh

Tools available:

  • docker - Container management
  • gh - GitHub operations
  • git - Version control with signing

Multi-Language Project

# Everything for complex projects
claude-vm setup --all

All tools available for maximum flexibility.

Minimal Setup

# Just git for simple projects
claude-vm setup --git

Lightweight template, fast clone times.

Tool Combinations

Common Combinations

JavaScript/TypeScript:

[tools]
git = true
node = true
docker = true  # For databases, Redis, etc.

Python:

[tools]
git = true
python = true
docker = true  # For PostgreSQL, MongoDB, etc.

Rust:

[tools]
git = true
docker = true  # For testing with databases
gpg = true     # For signed releases

Fullstack:

[tools]
git = true
node = true
python = true  # Backend API
docker = true  # All services
gh = true      # CI/CD workflows

Best Practices

1. Install Only What You Need

# Good: Minimal template
claude-vm setup --git --node

# Avoid: Installing everything unnecessarily
claude-vm setup --all  # Only if you actually need everything

Smaller templates = faster clones.

2. Use Git Tool Everywhere

[tools]
git = true  # Recommended for all projects

Even non-git projects benefit from git being configured.

3. Match Project Tech Stack

# Node.js project
claude-vm setup --git --node --docker

# Python project
claude-vm setup --git --python --docker

# Static site
claude-vm setup --git  # Minimal

4. Enable GPG for Signed Commits

[tools]
git = true
gpg = true  # Enable if you sign commits

5. Add GH for GitHub Projects

[tools]
git = true
node = true
gh = true  # For GitHub API access

Troubleshooting

Tool Not Found After Setup

# Verify tool is enabled
claude-vm info

# Recreate template if missing
claude-vm clean
claude-vm setup --git --node

Wrong Version Installed

Tools install the latest version from Ubuntu repositories. For specific versions, use custom packages.

Tool Conflicts

Some tools may conflict. If issues arise:

# Test with minimal setup
claude-vm clean
claude-vm setup --git

# Add tools incrementally
claude-vm clean
claude-vm setup --git --node
# Test, then add more

Permission Issues

# Docker permission denied
claude-vm shell
$ docker ps  # Error: permission denied

# Fix: User should be in docker group (automatic during setup)
# Recreate template:
claude-vm clean
claude-vm setup --docker

Next Steps