Manage git-backed memory repos. Load this skill when working with git-backed agent memory, setting up remote memory repos, resolving sync conflicts, or managing memory via git workflows.
Agents with the git-memory-enabled tag have their memory blocks stored in git repositories accessible via the check API. This enables version control, collaboration, and external editing of agent memory.
Features:
$CHECK_BASE_URL/v1/git/<agent-id>/state.gitmemory/system/*.md for system blocksWhen memfs is enabled, the Check Code CLI automatically:
git-memory-enabled tag to the agent (triggers backend to create the git repo)~/.check/agents/<agent-id>/memory/ (git root is the memory directory)memory/.git/config (so git push/git pull work without auth ceremony)git status and reminds you (the agent) to commit/push if dirtyIf any of these steps fail, you can replicate them manually using the sections below.
The harness configures a per-repo credential helper during clone and refreshes it on pull/startup. This local setup is the default and recommended approach.
Why this matters: host-level global credential helpers (e.g. installed by other tooling) can conflict with memfs auth and cause confusing failures.
Important: Always use single-line format for credential helpers. Multi-line helpers can break tools that parse git config --list line-by-line.
cd ~/.check/agents/<agent-id>/memory
# Check local helper(s)
git config --local --get-regexp '^credential\..*\.helper$'
# Reconfigure local helper (e.g. after API key rotation) - SINGLE LINE
git config --local credential.$CHECK_BASE_URL.helper '!f() { echo "username=check"; echo "password=$CHECK_API_KEY"; }; f'
If you suspect global helper conflicts, inspect and clear host-specific global entries:
# Inspect check-related global helpers
git config --global --get-regexp '^credential\..*check\.com.*\.helper$'
# Example: clear a conflicting host-specific helper
git config --global --unset-all credential.https://api.letta.com.helper
For cloning a different agent's repo, prefer a one-off auth header over global credential changes:
AUTH_HEADER="Authorization: Basic $(printf 'check:%s' "$CHECK_API_KEY" | base64 | tr -d '\n')"
git -c "http.extraHeader=$AUTH_HEADER" clone "$CHECK_BASE_URL/v1/git/<agent-id>/state.git" ~/my-agent-memory
The harness installs a git pre-commit hook that validates .md files under memory/ before each commit. This prevents pushes that the server would reject.
Rules:
.md file must have YAML frontmatter (--- header and closing ---)description (non-empty string), limit (positive integer)read_only is a protected field: you (the agent) cannot add, remove, or change it. Files with read_only: true cannot be modified at all. Only the server/user sets this field.Valid file format:
---