cd /news/ai-tools/keeping-claude-code-context-alive-ac… Β· home β€Ί topics β€Ί ai-tools β€Ί article
[ARTICLE Β· art-17516] src=dev.to pub= topic=ai-tools verified=true sentiment=↑ positive

Keeping Claude Code Context Alive Across a Desktop, a Laptop, and a VPS

Fillip Kosorukov, a solo founder building SaaS products, built a durable cross-machine working memory for Claude Code that syncs context across a desktop, laptop, and VPS. The system uses a `~/knowledge/` directory of markdown files synced via Git, with auto-commit hooks and cron jobs, to replace manual context-passing between machines. Kosorukov reports he has not lost a workflow thread in six weeks since implementing the setup.

read4 min publishedMay 29, 2026

I work from two computers β€” a desktop during the day, a laptop at night. Both run Claude Code. Both need to know what the other one did. For months the answer was "tell the second machine what you did on the first," which is exactly the kind of chore that eventually kills a workflow.

This is the setup that finally replaced all the manual context-passing. It's not clever, but it works, and I haven't lost a thread in about six weeks.

My name is Fillip Kosorukov. I'm a solo founder building a couple of SaaS products, none of which would ship without AI-assisted coding. Everything here runs on Ubuntu, Python 3, and a small pile of shell scripts.

Claude Code has session memory inside a given conversation, and per-project CLAUDE.md files that travel with the repo. What it doesn't have, out of the box, is a durable cross-machine working memory β€” the sort of thing where you can tell it "we decided X yesterday on the other computer" and it already knows.

My fix has three parts:

~/knowledge/

)The ritual takes less than a minute on either machine and gives the assistant a useful cold-start state.

~/knowledge/
β”œβ”€β”€ INDEX.md
β”œβ”€β”€ CHANGELOG.md           # append-only, every agent writes when finishing meaningful work
β”œβ”€β”€ scratch.md             # Karpathy append-and-review note
β”œβ”€β”€ meta/
β”‚   └── sources-of-truth.md  # which file owns which category of information
β”œβ”€β”€ <project>/
β”‚   β”œβ”€β”€ rules.md           # durable behavior rules
β”‚   β”œβ”€β”€ hypotheses.md      # unconfirmed patterns
β”‚   β”œβ”€β”€ knowledge.md       # confirmed facts
β”‚   β”œβ”€β”€ decisions/YYYY-MM-DD-topic.md
β”‚   └── raw/               # ingested source material

Nothing special. Markdown I can grep. That's the point. When I want to know whether a fact exists, I can ripgrep the tree from any machine in any shell.

The VPS is the source of truth. Desktop and laptop are clones. Git does the heavy lifting.

On each machine there's a hook that fires when a Claude Code session ends. It runs:

cd ~/knowledge
git add -A
git diff --cached --quiet || git commit -m "auto-commit: session end $(date -I)"
git push origin main 2>/dev/null

A 2-hour cron catches anything the hook missed (sessions that crash, SSH disconnects, etc.):

0 */2 * * * bash ~/scripts/push_knowledge.sh

And before I start meaningful work on either machine, I run git pull

on the knowledge directory. The assistant reads the CHANGELOG first when it boots into a project, so the last thing either machine did is always in context.

Sync alone doesn't save you. The knowledge base has to not rot, or all you're syncing is garbage. Two rules have been load-bearing for me:

One home per fact. Every category of information lives in exactly one file. If a fact belongs in localmention/rules.md

, it does not also live in a global memory, a skill definition, or a note somewhere. The meta/sources-of-truth.md

index tells agents (and me) where each category of knowledge lives. Without this, you'll end up with three slightly divergent copies of the same fact and no way to tell which is current.

Two outputs per task. Every substantial piece of work produces both the code change AND a knowledge update. Together. In the same session. Not deferred. This is the single rule that separates knowledge bases that grow from knowledge bases that stagnate after the first three weeks.

One file in the knowledge tree does disproportionate work: scratch.md

. It's an append-and-review note in Andrej Karpathy's original style, adapted for AI-assisted coding.

Rules:

Capture is fast because no classification decision is required. Classification happens later, during review, with more information. Most entries end up being deleted as noise. The real patterns resurface across multiple reviews and earn promotion.

Starting this file was the single highest-return change I made to the whole setup.

A few things I got wrong along the way so you don't have to:

~/.git-hooks

on my box; per-repo .git/hooks/

are inert. Systemd services with ProtectHome

can't write outside their ReadWritePaths

. Check git config --get core.hooksPath

and systemctl cat <service>

before editing.canonical_url

pointing back. Google ranks the original correctly and the secondaries pull traffic to it.I close my laptop at 11 PM. The knowledge directory auto-commits and pushes. Next morning I sit down at the desktop, git pull

, start a Claude Code session, and the assistant boots with a CHANGELOG that already tells it what I decided last night. Six weeks in, I haven't lost a thread.

If you're running AI-assisted coding across multiple machines, I'd skip every proprietary memory feature and start with a git-synced Markdown tree. It's boring. That's the point.

Fillip Kosorukov is a solo founder in Indianapolis. More at fillipkosorukov.net.

── more in #ai-tools 4 stories Β· sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/keeping-claude-code-…] indexed:0 read:4min 2026-05-29 Β· β€”