Run coding agents in isolated Incus containers with session persistence, workspace isolation, and multi-slot support. Ideal for secure, sandboxed development environments. Connects to Claude for AI-assisted coding.
git clone https://github.com/mensfeld/code-on-incus.gitcode-on-incus gives each AI agent its own full system container with root access, Docker, package managers, and systemd—without exposing your host system or credentials. Agents can work like they would on a real server: install packages, run services, manage cron jobs, and use Docker. SSH keys, environment variables, and Git tokens stay on the host and are never exposed to the agent unless you explicitly mount them. The tool includes kernel-level threat detection via nftables that monitors for reverse shells, credential scanning, DNS tunneling, and data exfiltration, automatically pausing or killing containers on suspicious activity. Sessions persist across restarts, multiple slots can run in parallel with full isolation, and workspace files are preserved even when containers are deleted.
1. **Prepare Your Environment**: Ensure Incus is installed (`sudo apt install incus`) and initialized. Verify storage pools and network bridges are configured. 2. **Define Requirements**: Create a JSON config file with your specifications (e.g., `agent-config.json`): ```json { "container_name": "dev-nodejs-20241115", "language": "nodejs", "dependencies": ["nodejs@20", "npm@10"], "workspace_mount": { "host_path": "/home/user/projects/chatbot", "container_path": "/workspace" }, "resources": {"cpu": 2, "memory": "4GB"} } ``` 3. **Launch the Container**: Run the skill with your config: ```bash incus launch images:ubuntu/22.04 dev-nodejs-20241115 --config user.user-data="$(cat agent-config.json)" ``` 4. **Connect and Code**: Use the provided SSH command or VS Code remote connection. For Claude integration, configure the Incus bridge in your AI client settings. 5. **Manage Sessions**: Use `incus list` to monitor containers. To persist changes, avoid the `--force` flag during deletion. For cleanup, run: ```bash incus delete dev-nodejs-20241115 --force ``` **Tips:** - Use `incus config device add` to mount additional volumes (e.g., for datasets). - For GPU acceleration, add `--device gpu` to the launch command. - Monitor resource usage with `incus monitor` to avoid over-allocation.
Running multiple AI coding agents in parallel with isolated environments and shared workspace access
Preventing credential leakage when delegating development tasks to AI tools
Detecting and blocking malicious behavior from AI agents in real time without manual intervention
Maintaining persistent development environments that survive reboots while keeping host system safe
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/mensfeld/code-on-incusCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Set up a [LANGUAGE] coding agent in Incus to [TASK_DESCRIPTION]. Use the 'code-on-incus' skill to create a persistent container named [CONTAINER_NAME] with [REQUIRED_RESOURCES] (e.g., 2 vCPUs, 4GB RAM). Mount the workspace from [HOST_PATH] to [CONTAINER_PATH]. Initialize the environment with [DEPENDENCIES] and connect to Claude for AI-assisted coding. Provide the container's IP address and SSH command for access. After completion, clean up the container unless [PERSIST] is set to true.
### Incus Coding Agent Setup Report **Container Details:** - Name: `dev-python-20241115` - Status: Running (Persistent) - IP Address: 10.0.0.15 - SSH Command: `ssh -p 2222 root@localhost` **Workspace Configuration:** - Host Path: `/home/user/projects/ai-assistant` - Container Path: `/workspace` - Permissions: Read/Write (UID 1000) **Environment Setup:** - Language: Python 3.11 - Dependencies Installed: - pip 23.3.1 - poetry 1.7.0 - numpy 1.26.2 - pandas 2.1.3 - langchain 0.0.350 - VS Code Server: Running on port 8080 **AI-Assisted Coding:** Claude has been connected to the container via the Incus bridge. The agent is ready to receive prompts like: ``` Create a FastAPI endpoint in /workspace/src/api.py that: 1. Accepts POST requests to /predict 2. Uses the loaded model from /workspace/models/ai_model.pkl 3. Returns predictions in JSON format ``` **Next Steps:** 1. Access the container via SSH: `ssh -p 2222 root@localhost` 2. Open VS Code Web UI at `http://localhost:8080` 3. Use Claude to generate or modify code in the mounted workspace 4. To persist changes after session end, the container will retain state unless explicitly destroyed. **Resource Usage:** - CPU: 1.2/2 vCPUs - Memory: 1.8/4GB - Disk: 12.4/50GB **Cleanup Command:** `incus delete dev-python-20241115 --force` (if not persisting)
Streamline banking integrations for smarter business
IronCalc is a spreadsheet engine and ecosystem
Connected workspace for docs, wikis, and projects
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Agentic AI Workflow platform
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan