Skip to content

Data Layout

Main data directory

All deer runtime data lives under ~/.local/share/deer/ by default. Override with the $DEER_DATA_DIR environment variable.

~/.local/share/deer/
├── deer.db                              # SQLite — all task state
├── tls/
│   └── deer-ca.crt                      # TLS CA certificate for MITM proxy
├── env-policy.json                      # Environment variable policy
├── prompt-history.json                  # TUI prompt input history
├── tasks/
│   └── <repoSlug>/
│       └── <taskId>/
│           ├── worktree/                # Git worktree (sandbox writable dir)
│           ├── claude-config/           # Per-task copy of ~/.claude
│           │   ├── CLAUDE.md
│           │   ├── settings.json
│           │   └── ...
│           ├── srt-settings.json        # SRT sandbox configuration
│           ├── gitconfig                # Minimal git config
│           ├── proxy.sock               # Unix socket (auth proxy)
│           └── proxy.sock.pid           # Auth proxy PID
└── node_modules/                        # SRT binary (for compiled binary installs)

Each task gets its own directory under tasks/<repoSlug>/<taskId>/. The repoSlug is derived from the repository path to group tasks by repo. The taskId is a unique identifier generated at task creation time (e.g. deer_abc123).

SQLite database

The deer.db file is the single source of truth for all task state. It uses a single tasks table:

ColumnTypeDescription
task_idTEXT PKUnique task identifier (e.g. deer_abc123)
repo_pathTEXTAbsolute path to the repository
repo_hashTEXTSHA256 hash prefix (first 16 chars) for grouping
promptTEXTUser's task description
base_branchTEXTBranch the worktree was based on
branchTEXTCurrent branch name
worktree_pathTEXTAbsolute path to the git worktree
modelTEXTClaude model used
statusTEXTAgent status (setup, running, failed, cancelled, interrupted, pr_failed)
pr_urlTEXTGitHub PR URL (if created)
pr_stateTEXTPR state: open, merged, closed, or null
final_branchTEXTFinal branch name (after PR rename)
costREALCumulative API cost (pay-as-you-go only)
errorTEXTError message on failure
last_activityTEXTLast log line from tmux pane
elapsedINTEGERElapsed seconds (pauses while idle)
idleINTEGERWhether agent is idle (0/1)
created_atINTEGERCreation timestamp (ms)
finished_atINTEGERCompletion timestamp (ms)
poller_pidINTEGERPID of the process polling this task

The database uses WAL mode (Write-Ahead Logging) for concurrent access. This allows multiple deer instances to read and write to the same database without locking conflicts.

The poller_pid column is used for cross-instance coordination. When a deer instance starts polling a task, it writes its own PID. Other instances check whether that PID is still alive before claiming the task.

Config files

Configuration is loaded from two locations:

~/.config/deer/
└── config.toml              # Global config (applies to all repos)

<repo>/
└── deer.toml                # Repo-local config (safe to commit)

The global config lives under ~/.config/deer/. The repo-local config is a deer.toml file in the repository root. See Configuration for the full field reference and merging rules.

Released under the MIT License.