Git as Memory for Openclaw

A Git-backed memory layer and CLI tool that provides durable, version-controlled, and auditable memory for AI coding agents without cluttering your working tree.

femto
v1.0.0
May 19, 2026
0
669
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install git-as-memory

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install git-as-memory using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Git as Memory?

Git as Memory (git-as-memory) is a specialized utility designed to give AI coding agents a durable, version-controlled, and highly auditable memory layer. By storing memory records within a dedicated Git reference (refs/git-as-memory/memory/v1) instead of the active working tree, it ensures that project-specific decisions, user preferences, and stable context are preserved across sessions without cluttering your repository's working files.

As a core capability in the Openclaw Skills registry, this tool empowers agents like OpenClaw, Hermes, and Claude Code to read, search, and write key-value structured memories. It bridges the gap between ephemeral agent context and long-term project knowledge, ensuring your AI assistants get smarter the more they work on your codebase.

Git as Memory Use Cases

  • Remembering stable user preferences, developer constraints, and preferred coding styles.
  • Documenting project-specific architectural decisions, release workflows, and conventions discovered during development sessions.
  • Tracking recurring bugs, API workarounds, and tool-specific configuration quirks to prevent future agents from repeating errors.
  • Providing a structured, searchable history of task execution and session summaries for auditability.
  • Managing tentative theories and hypotheses about codebase behavior using a dedicated, non-disruptive git ref.

How Git as Memory Works

  1. Initialization: The CLI tool (gam) initializes a dedicated, isolated Git reference (refs/git-as-memory/memory/v1) within your existing repository without modifying current branch files.
  2. Context Retrieval: When starting a task, the AI agent performs targeted keyword queries using gam search to retrieve relevant past context without bulk-loading unnecessary memory.
  3. Decision & Write: If a stable, reusable piece of information is discovered or explicitly requested by the user, the agent writes it via gam write, assigning categorized metadata and references.
  4. Auditability & Diffing: Every update to the memory is recorded as a standard Git commit, allowing developers to query memory evolution, trace provenance with gam history, or run direct Git diffs.

Git as Memory Setup

To get started, verify if the companion CLI gam is already installed on your system. It is a key tool for managing storage within Openclaw Skills integrations:

command -v gam

If the command is missing, install the CLI globally via npm or pip:

npm install -g git-as-memory
# Or alternatively
pip install git-as-memory

For one-off usage without global installations, use npx or python execution:

npx git-as-memory --help
# Or python CLI runner
python -m git_as_memory.cli --help

Initialize the Git memory reference in your project repository (this process is idempotent and safe to run multiple times):

gam init --repo /path/to/repo

Git as Memory Data Schema & Taxonomy

Git as Memory stores all files within the standard Git object database, isolated under the dedicated ref branch refs/git-as-memory/memory/v1.

Memory Types

Type Description Use Case Example
entity User, project, or tool preference profiles User prefers highly concise console command answers
semantic Durable facts, architectural decisions, and rules Discovered release or deployment workflow conventions
episodic Compact summary of an entire session or task Brief run-down of a migration script execution
working Short-lived task context or active state files Intermediate execution metadata destined to be pruned
hypothesis Unverified inference or technical assumption Guess on why a specific legacy API is failing under load

Storage Key Taxonomy

Records are identified using stable kebab-case identifiers mapped directly to storage directories: <type>/<stable-id>

Example paths generated inside the isolated Git tree:

  • entity/user-preference-concise-answers
  • semantic/project-release-workflow

Git as Memory Advanced Features

  • Zero-Working-Tree Footprint: Operates entirely within custom Git refs, keeping your git status clean and free from developer workspace clutter.
  • Direct Git Auditability: Fully compatible with native Git commands, enabling teams to run standard git log and git ls-tree directly against the memory ref to trace changes.
  • Pluggable CLI Ecosystem: Seamlessly integrates into automated pipelines and multi-agent systems built around Openclaw Skills protocols.
  • Robust Pruning and Purging: Supports soft deletions (gam delete) and full, secure purges (gam purge) for sensitive or temporary session metadata.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*