7 Habits of My AI Agent Setup
Claude Code, tmux, Obsidian, and Grok, Codex and Antigravity in Docker

I run most of my work through AI coding agents: Claude Code as the main one, with Grok, Codex and Antigravity on call for specific jobs. This is how the whole thing is put together, so you can copy the parts you want.
The short version: the agents live on always-on servers, every job gets its own named session, an Obsidian vault is the shared memory, and every agent except Claude runs locked inside its own Docker container. The scripts and config files are on GitHub (link at the end).
Habit 1: Agents live on always-on boxes, not your laptop
Run your agents on machines that never sleep: a cloud server, a home server, or both. Your laptop, tablet and phone are just screens you connect from. Close the lid, switch devices, lose Wi-Fi, and the work keeps going.
- Every machine joins one private network (I use Tailscale), so they reach each other without opening anything to the internet.
- Each server starts a Claude session in tmux at boot, so a reboot brings it straight back.
- Turn on Remote Control and you can drive that session from the Claude app or claude.ai/code on your phone. The code still runs on the server.
Habit 2: One named session per job
Every piece of work gets its own tmux session with its own Claude inside, named for the job: "Fleet Stuff", "Zenshinzo Tech", one per project. When I log into a server, a small picker script lists the running sessions and I pick one by number, or make a new one.
- Each Claude is labelled with its tmux session's name, one to one.
- Each Claude writes a one-line purpose for its session once it knows its job, so
session-purpose --listreads like a table of contents. - After a reboot, one command restores every session that was open. Closed sessions can be reopened by name later, with their history.
- When something belongs to another session, it goes there. No session does another one's job.
Habit 3: The vault is the memory
An Obsidian vault holds everything the agents need to know: project notes, decisions, plans, infrastructure notes and Claude's own memory files. It's synced to every machine and tracked in git, so every change can be undone.
- Claude's memory folder on each machine is a link into the vault, so a memory written on one box shows up on all of them.
- Memory holds facts about me and how I work. Facts about one machine go in that machine's note in the vault.
- Plans live in the vault too, so they survive the session that wrote them.
Habit 4: Sessions hand off, they don't share a brain
When one session finishes something another needs, it writes a short handoff note in the vault and passes the file path. The receiving session reads that one file and gets to work. Nobody pastes history between sessions.
- A handoff says: your subject, the state as of now, what's still open, and the rules that matter here.
- Starting a new session is the same: "read this handoff, confirm you're up to speed, and wait."
Habit 5: One agent directs, the others are tools
Claude Code runs the show. Grok, Codex and Antigravity are tools it calls for a specific job, then gets the result back: an image from Gemini, a second opinion on a plan, a different model's take on a hard bug.
- Claude stays on Anthropic's own backend. I never route it through another provider to save money.
- Each tool gets one clear job and a narrow prompt. It returns its answer; Claude decides what to do with it.
- If another tool misbehaves, fix it in that tool's own config. Never change your main agent's setup to suit a different tool.
Habit 6: Every other agent runs in its own Docker container
Grok, Codex and Antigravity never run directly on any machine. Each one lives in its own Docker container on one server, defined in a Docker Compose file, and gets called with a one-line command when Claude needs it.
| What each container gets | Why |
|---|---|
| Its own user account, not root | It can't act as an admin |
| One work folder from the host, nothing else | It sees only the files you hand it, not your home folder, keys or vault |
| Its own private volume for its login | Its sign-in stays inside its box |
| A read-only system disk | It can't change its own software; only its work folder and login are writable |
| All Linux capabilities dropped, privilege escalation blocked | No system-level access, even if something goes wrong |
| No access to Claude's config | It can't read or change your main agent's settings |
| Started per job, removed after | Nothing keeps running in the background |
The result: you can try a new agent without handing it your machine. It sees one folder and its own login, nothing else. It still has the network, so only put in its folder what you'd hand that company anyway.
- Keep one Compose file per tool, plus a copy of it in the vault, so any of them can be rebuilt from scratch.
- To remove a tool completely, delete its image, its login volume and its work folder.
- If a tool has a web interface, bind it to your private network only, never to the open internet.
Habit 7: Log everything
Every session ends each piece of work the same way: a one-line entry in the daily log, a commit, and a push. The daily log is a note in the vault, and each entry is mirrored to a Discord channel, so I can see what every session did from my phone.
- A hook at the end of every turn reminds Claude to log if it hasn't. Decisions and recommendations count, not just changes.
- Any session can pick up where another left off by reading the log, so nothing has to be re-explained.
- Because the vault is in git, any change any agent made can be found and undone.
What you need to copy it
| Piece | What I use | What it does |
|---|---|---|
| Always-on servers | A cloud server and a home server | Where the agents run |
| Private network | Tailscale | Connects every device without opening ports |
| Sessions | tmux, a picker script, session restore | One named session per job, back after a reboot |
| Remote access | Claude Code Remote Control | Drive sessions from the phone app or browser |
| Memory | Obsidian vault in git, synced everywhere | Notes, plans, handoffs and Claude's memory files |
| Other agents | Grok, Codex, Antigravity in Docker Compose | Called as tools, locked in their own containers |
| Logging | A small dlog script, Discord mirror | One line per piece of work, readable anywhere |
The scripts, the Docker Compose files and a starter CLAUDE.md are on GitHub: github.com/Zenshinzo/ai-agent-setup. The end-of-turn hook and the memory link are part of my own Claude config, so they're described here but not in the repo.