{"slug": "keeping-claude-code-context-alive-across-a-desktop-a-laptop-and-a-vps", "title": "Keeping Claude Code Context Alive Across a Desktop, a Laptop, and a VPS", "summary": "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.", "body_md": "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.\n\nThis 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.\n\nMy 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.\n\nClaude 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.\n\nMy fix has three parts:\n\n`~/knowledge/`\n\n)The ritual takes less than a minute on either machine and gives the assistant a useful cold-start state.\n\n```\n~/knowledge/\n├── INDEX.md\n├── CHANGELOG.md           # append-only, every agent writes when finishing meaningful work\n├── scratch.md             # Karpathy append-and-review note\n├── meta/\n│   └── sources-of-truth.md  # which file owns which category of information\n├── <project>/\n│   ├── rules.md           # durable behavior rules\n│   ├── hypotheses.md      # unconfirmed patterns\n│   ├── knowledge.md       # confirmed facts\n│   ├── decisions/YYYY-MM-DD-topic.md\n│   └── raw/               # ingested source material\n```\n\nNothing 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.\n\nThe VPS is the source of truth. Desktop and laptop are clones. Git does the heavy lifting.\n\nOn each machine there's a hook that fires when a Claude Code session ends. It runs:\n\n```\ncd ~/knowledge\ngit add -A\ngit diff --cached --quiet || git commit -m \"auto-commit: session end $(date -I)\"\ngit push origin main 2>/dev/null\n```\n\nA 2-hour cron catches anything the hook missed (sessions that crash, SSH disconnects, etc.):\n\n```\n0 */2 * * * bash ~/scripts/push_knowledge.sh\n```\n\nAnd before I start meaningful work on either machine, I run `git pull`\n\non 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.\n\nSync 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:\n\n**One home per fact.** Every category of information lives in exactly one file. If a fact belongs in `localmention/rules.md`\n\n, it does not also live in a global memory, a skill definition, or a note somewhere. The `meta/sources-of-truth.md`\n\nindex 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.\n\n**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.\n\nOne file in the knowledge tree does disproportionate work: `scratch.md`\n\n. It's an append-and-review note in Andrej Karpathy's original style, adapted for AI-assisted coding.\n\nRules:\n\nCapture 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.\n\nStarting this file was the single highest-return change I made to the whole setup.\n\nA few things I got wrong along the way so you don't have to:\n\n`~/.git-hooks`\n\non my box; per-repo `.git/hooks/`\n\nare inert. Systemd services with `ProtectHome`\n\ncan't write outside their `ReadWritePaths`\n\n. Check `git config --get core.hooksPath`\n\nand `systemctl cat <service>`\n\nbefore editing.`canonical_url`\n\npointing 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`\n\n, 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.\n\nIf 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.\n\n*Fillip Kosorukov is a solo founder in Indianapolis. More at fillipkosorukov.net.*", "url": "https://wpnews.pro/news/keeping-claude-code-context-alive-across-a-desktop-a-laptop-and-a-vps", "canonical_source": "https://dev.to/fillip_kosorukov/keeping-claude-code-context-alive-across-a-desktop-a-laptop-and-a-vps-2epa", "published_at": "2026-05-29 11:13:29+00:00", "updated_at": "2026-05-29 11:42:21.232372+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "ai-products", "large-language-models", "generative-ai"], "entities": ["Fillip Kosorukov", "Claude Code", "Ubuntu", "Python"], "alternates": {"html": "https://wpnews.pro/news/keeping-claude-code-context-alive-across-a-desktop-a-laptop-and-a-vps", "markdown": "https://wpnews.pro/news/keeping-claude-code-context-alive-across-a-desktop-a-laptop-and-a-vps.md", "text": "https://wpnews.pro/news/keeping-claude-code-context-alive-across-a-desktop-a-laptop-and-a-vps.txt", "jsonld": "https://wpnews.pro/news/keeping-claude-code-context-alive-across-a-desktop-a-laptop-and-a-vps.jsonld"}}