Self-Hosting an AI Agent Environment with OpenCode and Shared Memory
Summary
The article describes a personal self-hosted environment designed to let an AI agent continue work across web chats, local sessions, machines, and projects. Its foundation is a shared Dropbox memory folder containing global and project-specific Markdown notes; OpenCode and Claude Code are instructed through AGENTS.md and CLAUDE.md to read and update those notes. The author requires manual confirmation before anything is written to memory, both to reduce synchronization conflicts and to limit the security impact of information replicated across machines. To provide always-on access, he chose OpenCode on an Ubuntu VPS, with models accessed through OpenRouter and an OpenAI subscription, Dropbox syncing the memory directory, OpenCode's web UI replacing provider chat interfaces, and Tailscale providing private access. The stated security boundaries include a non-sudo account, no access to other Tailscale machines, write access restricted to working directories, broader read access, provider-only credentials, a usage-limited OpenRouter key, and a separate Dropbox account limited to the memory folder. Dropbox versioning and regular backups protect the shared memory. The implementation took about 90 minutes; near completion, the author allowed the agent to connect over SSH and finish the setup, despite his emphasis on explicit control. He then used OpenCode to plan a blog article on a train, continued the implementation in Claude Code on another machine, and published it after entering “please continue” and “go.” The example demonstrates the intended continuity and harness independence, while the author says he may add more agents for background work.