contextgit 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -0
- package/bin/contextgit-mcp.js +0 -0
- package/package.json +23 -10
package/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# ContextGit
|
|
2
|
+
|
|
3
|
+
Every time you start a new session with an AI coding agent, it starts from zero. It doesn't know what was built yesterday, what decisions were made, or what's left to do. You spend the first 10 minutes of every session re-explaining your project. ContextGit fixes this — it gives your agents a persistent memory layer that survives across sessions, branches, and machines.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g contextgit
|
|
9
|
+
cd your-project
|
|
10
|
+
contextgit init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> **Restart Claude Code** (or any MCP client) after running `init` for the MCP server to take effect.
|
|
14
|
+
|
|
15
|
+
That's it. `init` registers the MCP server, updates CLAUDE.md with session instructions, and installs Claude Code hooks. Start a new session — the agent calls `project_memory_load` automatically and picks up exactly where the last session left off.
|
|
16
|
+
|
|
17
|
+
## How it works
|
|
18
|
+
|
|
19
|
+
ContextGit stores structured context commits alongside your git history. Each commit captures what was done, what was decided, and what questions remain open.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Session 1: Agent builds auth module → saves context commit
|
|
23
|
+
Session 2: Agent loads snapshot → knows auth is done → starts on the next task
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## What the agent sees
|
|
27
|
+
|
|
28
|
+
When an agent calls `project_memory_load`, it gets a snapshot like this:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
## Project State
|
|
32
|
+
Auth module complete. API routes tested. Database schema finalized.
|
|
33
|
+
|
|
34
|
+
## Current Branch: Context: main
|
|
35
|
+
Implementing payment integration. Stripe SDK configured.
|
|
36
|
+
|
|
37
|
+
## Recent Activity
|
|
38
|
+
- [2026-03-20T08:33:44Z] "Payment webhook handler done" by solo via claude-code
|
|
39
|
+
- [2026-03-20T07:15:22Z] "Stripe SDK integration" by solo via claude-code
|
|
40
|
+
- [2026-03-19T16:42:11Z] "Auth module complete" by solo via claude-code
|
|
41
|
+
|
|
42
|
+
## Open Threads
|
|
43
|
+
- [FREE] Need to add rate limiting to payment endpoints
|
|
44
|
+
- [CLAIMED by studio-mcp-agent] Build invoice PDF generation
|
|
45
|
+
- [FREE] Decide on webhook retry strategy
|
|
46
|
+
|
|
47
|
+
## Active Claims
|
|
48
|
+
- "Build invoice PDF generation" claimed by studio-mcp-agent (2h TTL)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The agent reads this and knows exactly where the project stands without you saying a word.
|
|
52
|
+
|
|
53
|
+
## MCP tools
|
|
54
|
+
|
|
55
|
+
These tools are exposed to the agent via MCP. The agent calls them as part of its normal workflow.
|
|
56
|
+
|
|
57
|
+
| Tool | What it does |
|
|
58
|
+
|------|-------------|
|
|
59
|
+
| `project_memory_load` | Load the full project snapshot — what was built, what's decided, open threads, active claims. Call at session start. |
|
|
60
|
+
| `project_memory_save` | Save a context commit — what you did, decisions made, open questions. Call before ending a session. |
|
|
61
|
+
| `context_search` | Semantic + full-text search over past context commits. |
|
|
62
|
+
| `project_task_claim` | Claim a task so other agents skip it. Claims auto-expire after 2 hours. |
|
|
63
|
+
| `project_task_unclaim` | Release a claimed task. |
|
|
64
|
+
| `project_memory_branch` | Create a context branch for experimental work. |
|
|
65
|
+
| `project_memory_merge` | Merge a context branch back into the parent. |
|
|
66
|
+
|
|
67
|
+
## CLI commands
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
contextgit init # Initialize contextgit in current project
|
|
71
|
+
contextgit init --hooks # Initialize with git hooks
|
|
72
|
+
contextgit commit "message" # Write a context commit
|
|
73
|
+
contextgit status # Show current project state
|
|
74
|
+
contextgit search "query" # Search past commits
|
|
75
|
+
contextgit claim "task" # Claim a task
|
|
76
|
+
contextgit unclaim <id> # Release a claim
|
|
77
|
+
contextgit branch <name> # Create a context branch
|
|
78
|
+
contextgit merge <id> # Merge a context branch
|
|
79
|
+
contextgit serve # Start the REST API server
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Architecture
|
|
83
|
+
|
|
84
|
+
Monorepo with strict dependency ordering:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
packages/
|
|
88
|
+
core/ → Types, snapshot formatter, embedding service, context engine
|
|
89
|
+
store/ → Storage interface, LocalStore (SQLite), RemoteStore, SupabaseStore
|
|
90
|
+
mcp/ → MCP server (stdio transport, launched by Claude Code)
|
|
91
|
+
cli/ → CLI commands (oclif)
|
|
92
|
+
api/ → REST API (Express)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Local storage:** SQLite via better-sqlite3. One DB per project at `~/.contextgit/projects/<id>.db`.
|
|
96
|
+
|
|
97
|
+
**Remote storage:** Optional Supabase (Postgres + pgvector) for cross-machine sync and team use.
|
|
98
|
+
|
|
99
|
+
**Embeddings:** Local all-MiniLM-L6-v2 (384 dimensions, no API key needed) for semantic search.
|
|
100
|
+
|
|
101
|
+
## Configuration
|
|
102
|
+
|
|
103
|
+
Project config lives at `.contextgit/config.json`:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"project": "my-project",
|
|
108
|
+
"projectId": "unique-id",
|
|
109
|
+
"store": "local",
|
|
110
|
+
"agentRole": "solo",
|
|
111
|
+
"workflowType": "interactive",
|
|
112
|
+
"autoSnapshot": false,
|
|
113
|
+
"snapshotInterval": 10,
|
|
114
|
+
"embeddingModel": "local"
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Current status
|
|
119
|
+
|
|
120
|
+
This is an early-stage tool. It works for solo developers using Claude Code across one or more machines. The core memory layer is solid — context commits, branches, threads, search, and snapshots all work.
|
|
121
|
+
|
|
122
|
+
## Known limitations
|
|
123
|
+
|
|
124
|
+
- No automatic context merge when git branches are merged (manual `project_memory_merge` required)
|
|
125
|
+
- No integration with external boards (Linear, Jira, GitHub Issues)
|
|
126
|
+
- Semantic search requires the embedding model to download on first use (~23MB)
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT
|
package/bin/contextgit-mcp.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contextgit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"contextgit": "./bin/run.js",
|
|
@@ -15,11 +15,28 @@
|
|
|
15
15
|
"dist",
|
|
16
16
|
"bin"
|
|
17
17
|
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"ai",
|
|
20
|
+
"coding-agent",
|
|
21
|
+
"memory",
|
|
22
|
+
"context",
|
|
23
|
+
"git",
|
|
24
|
+
"mcp",
|
|
25
|
+
"claude-code",
|
|
26
|
+
"llm",
|
|
27
|
+
"persistent-memory"
|
|
28
|
+
],
|
|
29
|
+
"description": "Persistent memory layer for AI agent workflows",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"typecheck": "tsc --noEmit"
|
|
34
|
+
},
|
|
18
35
|
"dependencies": {
|
|
19
|
-
"@contextgit/core": "0.1.
|
|
20
|
-
"@contextgit/store": "0.1.
|
|
21
|
-
"@contextgit/api": "0.1.
|
|
22
|
-
"@contextgit/mcp": "0.1.
|
|
36
|
+
"@contextgit/core": "0.1.6",
|
|
37
|
+
"@contextgit/store": "0.1.6",
|
|
38
|
+
"@contextgit/api": "0.1.6",
|
|
39
|
+
"@contextgit/mcp": "0.1.6",
|
|
23
40
|
"@oclif/core": "^3.27.0",
|
|
24
41
|
"nanoid": "^5.0.0",
|
|
25
42
|
"simple-git": "^3.27.0"
|
|
@@ -27,9 +44,5 @@
|
|
|
27
44
|
"devDependencies": {
|
|
28
45
|
"@types/node": "^20.0.0",
|
|
29
46
|
"typescript": "^5.4.0"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "tsc",
|
|
33
|
-
"typecheck": "tsc --noEmit"
|
|
34
47
|
}
|
|
35
|
-
}
|
|
48
|
+
}
|