← Back to Plugins
Tools

Context Repo

m3lander By m3lander 👁 16 views ▲ 0 votes

OpenClaw plugin for git-backed context repositories

GitHub

README

# Context Repository Plugin

OpenClaw plugin that adds a local git-backed context repository per agent.

## What it does

- injects a bounded repository tree and pinned `system/` files into prompt context
- keeps repository state in local git under plugin state
- reminds the agent when reflection is due
- exposes `/ctxrepo` command and `context_repo_manage` tool
- writes durable reflection updates into memory files and snapshots them

## Current commands

- `/ctxrepo status`
- `/ctxrepo init`
- `/ctxrepo tree`
- `/ctxrepo snapshot [message]`
- `/ctxrepo reflect [--session <key>]`
- `/ctxrepo defrag`
- `/ctxrepo repair`

## Reflection behavior

`/ctxrepo reflect` uses the most recent cached session context from OpenClaw hooks. It:

1. derives durable project focus and preference signals from recent user messages
2. updates managed reflection sections in `system/` memory files
3. writes a timestamped note under `history/`
4. validates and snapshots changes when auto-snapshot is enabled
5. clears the reflection reminder for that session

## Local validation

```bash
bun --eval "await import('/Users/max/.openclaw/workspace/.openclaw/extensions/context-repo/index.ts')"
```
tools

Comments

Sign in to leave a comment

Loading comments...