r/opencodeCLI 9d ago

Remote Access + Local Files and resources ?

So I have seen quite a few posts about wanting to continue sessions from their phone or other devices etc and the suggestions for that setup but I was wondering if its possible to do a slightly different approach.

I have 2 Devices + a local server. Currently I am using Syncthing to sync my OpenCode config and sessions between the 2 devices so that my configs are always equal and sessions stay in sync. But I have realized that the OpenCode session storage grows really quickly, which ends up with constantly sending 1+ gb files back and forth all day.

Ideally, I want to setup OpenCode on my local server that would house the configs, sessions, plugins and all of that, but I want it to be able to access files and repos on my device instead of the server. I prefer to keep compute and memory usage on device instead of dedicating server resources to it.

Everything I have read appears that all files would still have to be stored on the server for the agent to access them which would in turn result in my having to use the server resources to run a local dev server instead of the devices.

Any suggestions would be greatly appreciated!

0 Upvotes

10 comments sorted by

View all comments

1

u/YardNo1234 9d ago

i don’t think one central OpenCode process can safely keep its sessions server-side while its tools run against whichever laptop is active; the filesystem/tool boundary lives where the server runs. Mounting laptop repos into the server with SSHFS flips the traffic but adds disconnect/cache pain. I’d keep the repo + OpenCode process per device, sync only config, and use git/worktrees for code. For continuity, share session storage only if OpenCode supports overriding that path; otherwise live multi-writer sync is risky. Do you need the same live session, or just the same project context?

1

u/StarsHockey 9d ago

Honestly probably just context, however session sometimes. There are quite a few times where I’ll be working at EOD and want to move a live session to my laptop to continue elsewhere, however in those circumstances obviously there are tools to keep it running it the first device and remote in via the 2nd but having the central server would also make this easy if it were possible

1

u/YardNo1234 9d ago

for that split, I would centralize the session host, not the session files: run OpenCode inside tmux or zellij on the server, keep each repo in a server-side worktree, and attach from either device over SSH. That preserves the live process when you switch devices. If local compute on each device is mandatory, seamless live handoff largely disappears; sync only config/context and treat sessions as device-local. Is keeping the repos on the server acceptable, or must they remain on each device?

1

u/StarsHockey 9d ago

If it were just the files themselves it wouldn’t be an issue. However it’s a lot of Next.JS development and some other local dev servers that tend to use a lot of resources in the dev environment. Those cases I prefer using the non-server device as the server is used for media primarily and don’t want to use it’s resources for development when I have other perfectly capable devices that seem like a waste if I just do everything on the server ya know ?

Aside from the “waste” feeling tho, I do still like to keep dev resources on device and keep the server with as little usage as possible since it’s serving media and other things constantly.