Understanding Codespaces
Learn what GitHub Codespaces are, how they work, and what happens when they stop or get deleted.
Understanding GitHub Codespaces
PhantomWP uses GitHub Codespaces to provide you with a powerful development environment right in your browser. This guide explains what Codespaces are and how they behave.
What is a GitHub Codespace?
Think of a GitHub Codespace as a remote computer in the cloud that's specifically set up for your project. Just like your laptop has:
- An operating system (macOS, Windows, Linux)
- Storage for files
- RAM for running applications
- A CPU for processing
A Codespace has all of these too—except it runs on GitHub's servers instead of your desk.
Your Computer
Physical hardware
similar to
Codespace
Virtual computer in cloud
Why Use a Codespace?
- No Setup - All tools pre-installed and configured
- Access Anywhere - Use from any browser, any device
- Consistent - Same environment for everyone
- Powerful - More resources than many laptops
Codespace Lifecycle
A Codespace can be in three main states, similar to how your computer can be running, asleep, or completely shut down.
Running
Active & working
Stopped
Asleep, data saved
Deleted
Gone forever
When a Codespace Stops (Turns Off)
A Codespace stops automatically after a period of inactivity (usually 30 minutes). This is like putting your computer to sleep mode.
Computer Analogy: Sleep Mode
When your laptop goes to sleep:
- The screen turns off
- It stops using much power
- Your files and open programs are preserved
- When you open the lid, everything is exactly where you left it
A stopped Codespace works the same way:
😴 When Your Codespace Stops:
✓ What's Preserved
- ✓All your files and code changes
- ✓Installed packages and dependencies
- ✓Your project configuration
- ✓Git history and uncommitted changes
✗ What's Lost
- ✗Running processes (dev server)
- ✗Terminal session state
- ✗Temporary files in /tmp
💡 What This Means: When you come back, PhantomWP will restart your Codespace automatically. It takes about 30-60 seconds, then you're right back where you left off. Your code is safe!
Why Does It Stop?
GitHub stops inactive Codespaces to:
- Save resources — No point running a computer nobody's using
- Reduce costs — GitHub provides free hours each month
- Be eco-friendly — Less energy consumption
When a Codespace is Deleted (Destroyed)
This is different and more serious. When a Codespace is deleted, it's gone forever—like formatting your computer's hard drive.
Computer Analogy: Factory Reset
When you factory reset or format your computer:
- All files are permanently erased
- All installed programs are removed
- It's like getting a brand new computer
- You cannot undo this
⚠️ When Your Codespace is Deleted:
All local files are permanently gone
Any changes you made but didn't push to GitHub are lost forever
Installed packages must be reinstalled
A new Codespace starts fresh with default dependencies
Custom configurations are reset
Any editor settings or environment tweaks are gone
When Does Deletion Happen?
Codespaces are automatically deleted after 30 days of inactivity. This means:
Codespace Deletion Timeline
Day 0
Last activity
Day 25
Warning email
Day 30
Auto-deleted
How PhantomWP Protects Your Work
Here's the good news: your code is safe in GitHub!
🛡️ Your Safety Net
When you push your changes (commit) to GitHub, your code is stored permanently in your repository—separate from the Codespace.
🖥️
Codespace
Temporary workspace
Can be recreated
📚
GitHub Repository
Permanent storage
Always safe
What Happens If Your Codespace is Deleted?
- PhantomWP creates a new Codespace automatically when you open your project
- Your code is pulled from GitHub into the new Codespace
- Dependencies are installed automatically
- You continue working as if nothing happened
The only thing you might lose is uncommitted changes—so commit often!
Comparison
Codespace Running (like computer on)
- Files safe: Yes
- Recovery time: Instant
Codespace Stopped (like computer asleep)
- Files safe: Yes
- Recovery time: 30-60 seconds
Codespace Deleted (like factory reset)
- Files safe: Only if committed to GitHub
- Recovery time: 2-3 minutes
Best Practices
To never lose work:
- Commit frequently — Use the Git panel to save your work to GitHub
- Push before closing — Make sure changes are uploaded
- Use meaningful commit messages — Makes it easy to track changes
- Don't worry about stopping — It's automatic and safe
💡 Pro Tip
PhantomWP shows your Git status in the header. If you see uncommitted changes, make sure to commit before stepping away for extended periods. Your work will be safe in GitHub forever!
Summary
- Codespace - A virtual development computer (like a computer in the cloud)
- Running - Active and working (like computer turned on)
- Stopped - Paused, all files saved (like computer in sleep mode)
- Deleted - Completely removed (like factory reset)
- Repository - Permanent code storage (like an external hard drive backup)
Next Steps
- IDE Overview — Learn how to use the PhantomWP editor
- Git Integration — Learn how to commit and push changes