# Claude Code for personal automation: dots, backups, Compose

> Automate dots, backups, and Compose with hooks and deny rules so local mistakes stay contained.

Source: https://fullbytedeveloper.com/blog/claude-code-for-personal-automation
Published here: 2026-11-26, updated 2026-11-26

Personal automation with Claude Code needs deny rules before Compose edits. Automate dots, backups, and Compose files with PreToolUse hooks that exit 2 on risky paths, and run docker compose config or --dry-run before apply so local mistakes stay contained. [1] [2]

After this page you can put home automation under one root, draft Compose services then validate before `up`, script backups with a restore dry-run, and gate local services with hooks. Related: [Claude Code deny rules](/blog/claude-code-deny-rules) for the permission floor, [Tailscale for agent machines](/blog/tailscale-for-agent-machines) when the box is remote, [Claude Code for personal scheduling](/blog/claude-code-for-personal-scheduling) for calendar-side automation. Browse the [Claude Code topic](https://fullbytedeveloper.com/blog/topic/claude-code).

## Put the home automation repo under one root

Keep dotfiles, `compose.yaml`, backup scripts, and file-organization rules in one git repo Claude opens as the project. Best practices say to tell Claude what it cannot see from code alone: mount paths, which hosts are production for you, and which volumes are sacred. [3]

```text
~/src/home-ops/
  compose.yaml
  dots/
  backup/
  CLAUDE.md
```

You should open `claude` from that root so relative paths stay inside the repo.

## Draft Compose services, then validate before up

Compose documentation covers services, volumes, networks, and the `docker compose` CLI. Ask Claude to edit `compose.yaml`, then run `docker compose config` as the check before any `up`. [1] [3]

```bash
docker compose config
docker compose up -d --dry-run
```

Refuse `down -v` in agent sessions that manage backup volumes. Put that refusal in a hook, not only in prose. [1] [2]

You should see a rendered config with no unresolved variables before containers start.

## Script backups with a restore dry-run as done

Backup scripts need a restore check. Have Claude write `backup.sh` and `restore-dry-run.sh` that list archive contents without writing over live data. Best practices treat a re-runnable check as finished work. [3]

```bash
./backup/backup.sh
./backup/restore-dry-run.sh latest
```

**Warning:** never point restore at the live home directory from chat. Use a scratch target first. [3]

## Organize files with rules Claude can re-apply

Describe inbox folders, naming patterns, and quarantine paths in `CLAUDE.md`. Ask Claude to move only under those trees and to print a plan before any `mv`. Pair with deny rules so `Bash(rm *)` and reads of `.env` stay blocked. [3] [5]

```json title=".claude/settings.json"
{
  "permissions": {
    "deny": [
      "Bash(rm *)",
      "Bash(docker compose down *)",
      "Read(./.env)",
      "Edit(/etc/**)"
    ]
  }
}
```

See [Claude Code deny rules](/blog/claude-code-deny-rules) for the same floor pattern on other repos. [5]

## Gate local services with hooks and optional systemd units

Hooks can block tool calls that match destructive Compose or backup paths (exit 2). For long-running host services, systemd's manuals document unit files if you manage services outside Compose. Keep unit edits in git and install them with a command you run yourself. [2] [4]

```bash
systemctl --user cat backup.timer
```

If the machine is reached over a tailnet, read [Tailscale for agent machines](/blog/tailscale-for-agent-machines) before you expose agent ports. For calendar automation, use [Claude Code for personal scheduling](/blog/claude-code-for-personal-scheduling). [6] [7]

You now have a personal automation loop: one home-ops repo, Compose config check, backup restore dry-run, deny rules, hooks on destructive commands.

Send this to the solo operator who wants Claude editing Compose without wiping backup volumes.

## Sources

1. [Docker Compose documentation, accessed 2026-11-26](https://docs.docker.com/compose/)
2. [Claude Code docs: Hooks, accessed 2026-11-26](https://code.claude.com/docs/en/hooks)
3. [Claude Code best practices, accessed 2026-11-26](https://code.claude.com/docs/en/best-practices)
4. [systemd index (latest), accessed 2026-11-26](https://www.freedesktop.org/software/systemd/man/latest/)
5. [Full Byte Developer: Claude Code deny rules](https://fullbytedeveloper.com/blog/claude-code-deny-rules)
6. [Full Byte Developer: Tailscale for agent machines](https://fullbytedeveloper.com/blog/tailscale-for-agent-machines)
7. [Full Byte Developer: Claude Code for personal scheduling](https://fullbytedeveloper.com/blog/claude-code-for-personal-scheduling)
