You’ve probably used Claude or ChatGPT in a browser or app. You type a message, it responds, you ask it for something, it generates documents and content for you. But then you have to download it, copy and paste it, put it where it needs to go. That’s useful, but it’s limited by how quickly you can move data back and forth between what it’s building, the notes you’re feeding it, and the places you’re testing and checking its work.
You may have also used coding assistants like GitHub Copilot or Cursor. These go further: they can see the context of actual code in a folder or repository, and they’re not just making suggestions, they’re writing code for you. You might have even used Claude as the model behind Copilot. But the AI is still limited to what you give it, either as explicit context or what’s in that project folder.
Claude Code is different. It’s Anthropic’s command-line tool that runs as an agent on your machine. It can read files anywhere on your system, write code, run commands, make API calls, and interact with tools. It’s not scoped to a single folder or IDE (unless you scope it yourself). Think of it less like a chatbot and more like a collaborator who can actually operate your computer. Depending on the access and tools you give it, it can do most of what you’d do at a terminal yourself.
The name “Claude Code” is a bit misleading. Yes, it’s great at coding. But it’s also great at everything else: writing, research, file management, automation, building tools. It’s really more of a personal AI assistant that happens to run in a terminal. The name will probably evolve, but for now, that’s what we’ve got, and it works really well.
A lot of people run Claude Code directly on their personal machines, whether that’s Mac, Windows, or Linux. That can be a valid choice once you understand what it can do, how to limit it, and how to protect your data and system. But I’m choosing to run mine in a Linux VM for now. I have too much sensitive stuff accessible from my main computer, and while I’m in this exploratory learning-and-building mode with Claude, I don’t want to have to monitor its every move the way I would on my personal machine. A more contained environment lets me learn faster with less anxiety. And Linux VMs are something I’m comfortable setting up and managing.
Claude Code is very capable on its own. You can teach it a lot just with text files, folders, and structure. But here’s the thing about this current realm of AI LLMs we’ve got: the more information you load into a conversation, the more it has to juggle at once, and at some point that starts to limit what it can effectively do. So you don’t want to overwhelm it. You want to guide it in the right direction for whatever you’re working on, loading in just what it needs at any given time.

This is where structure really helps. Claude Code has a way of loading context on demand. You can have tons of information about how to do different types of tasks, organized into skills and workflows and folders, and Claude can choose what to load based on what you’re actually asking it to do. That means you get the benefit of all that knowledge without stuffing everything into every conversation.
You can build this structure yourself, or you can use someone else’s that they’ve figured out works well. There are probably thousands of different approaches out there. People are publishing their workflows on YouTube, Reddit, and blogs all the time. They’re all worth exploring to see what resonates with you.
What has worked really well for me is a project called PAI (Personal AI Infrastructure) by Daniel Miessler. It immediately adds structure on top of Claude Code: skills, workflows, hooks, customization. It helps Claude think and respond in ways that match how I want to work. That might sound vague right now, but it’ll make a lot more sense once you start playing with it.
That’s what this article and the accompanying video are for: to help you get started playing with it, and to do that in a safer way than just installing it directly on your main computer. Once you have it running, you can go back and read Daniel’s really excellent article on PAI to understand the philosophy and architecture. The concepts will land much better once you’ve actually used the system.
One note: both PAI and Claude Code evolve quickly. Daniel pushes updates regularly, and I pull those into my system and adapt them. And who knows, some of this infrastructure might even get built into Claude Code itself in a few months. But this is what I’m using now, and I’ll try to update this guide or this series as things change.
Why a VM?
Claude Code runs commands, writes files, and makes API calls. That’s what makes it powerful. It’s also why I’d recommend starting in a contained environment.

A Linux VM gives you room to experiment without worrying about your main system. You can let Claude run more freely, see what it’s capable of, and develop your own comfort level over time. You also get space to understand the security settings, learn how to limit things, and understand what you’re saying “yes” to when you grant permissions.
You might even eventually move it to your main machine. But starting in a VM gives you the room to learn first.
Prerequisites
Before we start, you’ll need:
- A Linux environment (one of the following):
- A VM on your computer
- A Raspberry Pi 4/5 with 8GB RAM
- An old computer you can wipe
- Terminal access (SSH if remote, or direct terminal access)
- Basic command line comfort (or willingness to learn as you go, Claude can help!)
- An Anthropic account with Claude Pro ($20/month)
Setting Up a Linux Environment
If you already have a hypervisor or home lab, you know what to do. If not, here are your options:
Option 1: VM on your computer (recommended for most people)
This is free, gives you the best performance, and keeps everything local.
- VirtualBox - Free and open source, works on Windows, Mac, and Linux
- UTM - Free, open source, Mac-native (recommended for Apple Silicon Macs)
If you’ve never set up a VM before, NetworkChuck has an excellent video explaining what VMs are and how to set up VirtualBox . Ubuntu also has an official tutorial for running Ubuntu in VirtualBox .
Note on Ubuntu versions: These links may reference an older version of Ubuntu. The recommended current version as of this writing is Ubuntu Server 24.04 LTS. Download Ubuntu Server and select your architecture (AMD64 for Intel/AMD, ARM64 for Apple Silicon).
Note for Mac users: NetworkChuck’s video covers AMD64 (Intel/AMD) setups, including BIOS settings for virtualization. On Apple Silicon Macs, you don’t need to change any BIOS settings. VirtualBox works, but UTM is generally smoother. Either way, download the ARM64 version of Ubuntu, not the standard AMD64 image.
Option 2: Raspberry Pi or old computer
A Raspberry Pi 4 or 5 with 8GB RAM works well. So does any old computer you can wipe and install Linux on. This gives you a dedicated always-on system.
Option 3: Cloud VPS (advanced)
Cloud providers like DigitalOcean, Linode, or Vultr work, but introduce additional complexity: you’ll need to configure firewalls, consider HTTPS for any web content, and manage a publicly-accessible server. If you’re comfortable with that, go for it. Otherwise, start local.
What to install:
I recommend Ubuntu Server 24.04 LTS. It’s well-documented, beginner-friendly, and the installer walks you through creating a non-root user with sudo access (which is what you want). Skip the desktop environment; you’ll be working at the command line.
Before continuing:
You should be at a command line in your VM, logged in as a non-root user that has sudo access. Ubuntu creates this during installation. If you’re using Debian or another distro that defaults to root only, here’s how to create a sudo-enabled user (the steps work on Debian too).
Tip: You probably already have access to Claude in your web browser, or another AI assistant. If you get stuck at any point, they can be really helpful for figuring out specific steps. Just tell them where you are and what you’re trying to do.
A Note on curl | bash
You’re about to see a few commands that look like curl ... | bash. This pattern downloads a script from the internet and runs it directly on your machine. Security folks tend to cringe at this pattern, and for good reason. It’s not something you’d normally do on a production system or a machine with sensitive data.

That’s part of why we set up this VM. In a contained environment, you can be a little less cautious. But also these particular sources (Anthropic’s installer, Bun’s installer) are generally trustworthy. But it’s worth noticing what you’re doing: you’re running code from the internet based on trust in the source.
We’ll come back to this idea later, because there’s an interesting parallel when we start giving Claude instructions from external sources.
Step 1: Install Dependencies
We only need a couple things to get started:
sudo apt-get update && sudo apt-get install -y curl git zip
Step 2: Install Claude Code
Anthropic provides an official installer :
curl -fsSL https://claude.ai/install.sh | bash
When the installer finishes, it will ask you to add Claude to your PATH. Run this:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
Step 3: Install Bun
Bun is a fast JavaScript runtime that Claude Code uses for various tools:
curl -fsSL https://bun.sh/install | bash
Step 4: Load the New Commands
Both installers added themselves to your shell configuration so you can type simple commands like claude and bun to launch things. Load them:
source ~/.bashrc
Verify everything works:
claude --version
bun --version
Step 5: Install PAI
Now we add the scaffolding that turns Claude Code into something more powerful.
If you already have Claude Code settings you want to keep, back them up first:
[ -d ~/.claude ] && mv ~/.claude ~/.claude-backup-$(date +%Y%m%d)
Clone the PAI repository and install v3.0:
git clone https://github.com/danielmiessler/PAI.git
cp -r PAI/Releases/v3.0/.claude ~/
cd ~/.claude && bash install.sh
This gives you a full copy of PAI in your home folder. You can browse it, reference it, and pull updates later.
The installer will auto-detect your system and check for dependencies. Since you already installed everything above, it will find Git, Bun, and Claude Code and move on.
The wizard will ask you a few questions. Here’s what to enter:
- What is your name? - Your name
- Timezone - It auto-detects this. Press Enter to confirm.
- Name your AI assistant - Whatever you want (default is PAI, I call mine Assistant)
- Startup catchphrase - Press Enter for default, or customize it
- Projects directory - Press Enter to skip
- Voice setup - When it asks about ElevenLabs, choose “Skip voice for now.” It will still try to configure voice defaults. Accept the default voice, then when it asks again, choose skip. We don’t need voice for this setup.
Step 6: Fix Shell Configuration
The PAI installer writes to .zshrc (the default shell on macOS), but Ubuntu uses bash. This one-liner merges any zsh config into your bash config so the commands work:
[ -f ~/.zshrc ] && cat ~/.zshrc >> ~/.bashrc
source ~/.bashrc
Step 7: First Run and Authentication
Now launch Claude Code with PAI:
pai
The first time you run it, you’ll walk through a few prompts:
Color scheme: Pick dark mode, light mode, or a color-blind friendly version of each.
Login method: Select “Claude Account (with Subscription)”. This is where you’ll need that Claude Pro account. If you don’t have one yet, head over to claude.ai to sign up. The other login methods will likely cost you more money since they use API credits directly.
Browser authentication: It will say “Opening browser to sign in” but that won’t work since you’re in a VM. Instead, copy that long URL it displays. Paste it into a new tab in your web browser. Sign into Claude there (or if you’re already signed in, it will just ask you to authorize). Click Authorize, copy the code it gives you, and paste it back into the terminal where it says “Paste code here.”
Login successful: Hit Enter to continue.
Safety warning: It will warn you that Claude can make mistakes and that you need to review what it does. This is part of why we’re running it in a VM, right? We’re not giving it access to anything sensitive until we’re comfortable with how it works.
Trust folder: It will ask if you trust the .claude folder. You’ll need to choose “Yes, I trust this folder” to use PAI.
And then you’re in. You should see an interactive prompt. Try this to make sure everything is working:
“What’s my name and what skills do you know?”
It should know your name (from the wizard) and list a couple dozen skills that come with PAI out of the box. If you see that, you’re ready for the next step.
Step 8: Adapt PAI for Linux
PAI was built on macOS, so there are a few more things that need patching for Linux. Here’s where it gets interesting.
Paste this into the prompt:
Read this URL and follow the instructions to adapt PAI for Linux: https://gist.githubusercontent.com/chriscantey/50523c88bc54663916481882f3e3c704/raw/pai-linux-adaptation.md
Your Assistant (Claude + PAI) will read the file, patch the statusline for Linux compatibility, and add a steering rule so web servers provide accessible URLs instead of localhost.
A note on what just happened: This “read a URL and follow the instructions” pattern is powerful. It’s also a good example of why you want to be thoughtful about what you point your AI at.

Remember earlier when we talked about curl | bash? That’s running code from the internet based on trust. This is similar, but instead of code, it’s instructions for an AI that has access to your system. If that file contained malicious instructions, your Assistant might try to follow them.
From the outside, these might seem like the same risk, but there’s an important difference. A shell script can be more predictable. You can read it and see exactly what it will do. It’s traditional programming: the same script run twice will do the same thing.
An AI agent is different. Ask it to do the same task twice and it might take different approaches. Run it on a different system, with a different person, against a different backend, or with a future version of Claude, and the behavior may vary. That flexibility is what makes agents powerful, but it also means there’s more room for them to interpret, improvise, and find creative paths to a goal. Great when you want that, less great when someone’s trying to trick them.
This is one example of what’s sometimes called prompt injection: content designed to manipulate an AI’s behavior.
When your Assistant searches the web, reads files, or fetches URLs, it might encounter instructions embedded in that content. The same way you give it instructions, someone else could sneak instructions into a webpage the Assistant reads, and the Assistant might follow them without realizing they came from an untrusted source.
PAI has some hooks and protections in place to prevent certain things from happening, and running as a non-root user adds another layer. But these are layers, not guarantees. The contained environment we set up is part of the overall approach: you can learn how this works, build comfort over time, and be more thoughtful about what you expose it to as you expand its access.
More on security practices in a future post.
What You Have Now
At this point, you have:
- Claude Code running on Linux
- PAI’s skill system loaded
- Linux-specific patches applied
You can start exploring. Type /help to see available commands. Try invoking a skill. Break things. Rebuild.
Try It: Build Something
The best way to understand what your Assistant can do is to build something with it. Here’s a quick one you can try. Paste this into the prompt (replace the city with your own):
Build me a simple web page that shows the current weather for [insert your city name here]. Use a free and open weather API that doesn’t require an API key. Fetch the current conditions and display them in a modern, nice looking page with a dark background. Serve it so I can view it in my browser.
You’re going to see a lot of stuff fly by, especially if you’re not used to watching code. That’s okay. Watch as it works through the problem: searching for weather APIs, writing HTML, fetching live data, spinning up a server. Part of what PAI adds to Claude Code is all this thinking and verification, making sure it’s actually achieving what you asked for. If it hits a problem, it’ll try to fix it or help you understand what went wrong. It might take a little while, especially the first time. When it gives you a URL, open it in your browser. You should see your weather page, built from scratch, running live.
It might also do something interesting: download tools it needs to help you. For example, it may install Playwright and Chromium so it can open a browser and verify its own work. Notice I said “might.” Running the same prompt on two different systems, one time it did its own verification, another time it didn’t. That’s the nature of these systems. It’s also a little spooky when it just downloads apps on its own. That’s why we’re in a VM.
That’s the difference between a chatbot and an agent. The chatbot would give you code to copy, or possibly a preview. Your Assistant actually builds the thing and runs it. And if you give it the right access, it can put that page online for you, all in one go. Then you can work back and forth with it to add features, change the design, and build on it over time. All without the copying and pasting.
Where to Go From Here
Spend some time with it. Point it at some data you’re comfortable experimenting with. Think about something you’ve been wanting to build: a tool, a design, a dashboard, a 3D model, really anything is worth a try. It’s running on a computer, so it can run the same tools you’d run yourself, and in many cases it can grab new tools to work with.
If you want the deep dive on the philosophy and architecture, read Daniel’s PAI article . The concepts will land better now that you’ve seen the system in action.
This is the first in a series. I’ll be posting more about security practices, building custom skills, and how I’m using this system in my own work. Subscribe or check back if you want to follow along.
Resources
- Daniel Miessler’s PAI Article - The complete system overview and philosophy
- PAI GitHub - Source repo with releases, skills, and documentation
- PAI v3.0 Release - The version this guide is based on
- Linux adaptation gist - The Linux adaptation instructions from Step 8
- NetworkChuck’s VM video - Great intro to VMs and VirtualBox setup
- Ubuntu VirtualBox tutorial - Official guide for running Ubuntu in VirtualBox
This guide is current as of PAI v3.0 (February 2026). PAI evolves quickly, so some details may change.