agentcache 0.4.1 → 0.5.0-beta.1
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 +279 -230
- package/dist/chunk-4T3I3ACZ.js +6592 -0
- package/dist/chunk-ECMT4ANK.js +1725 -0
- package/dist/{chunk-T4COG3XD.js → chunk-R5I6WWSD.js} +31 -14
- package/dist/chunk-RXGW4Q3G.js +109 -0
- package/dist/chunk-XRJ6QW6N.js +92 -0
- package/dist/cli.js +2538 -236
- package/dist/device-id-RV7RO5RB.js +7 -0
- package/dist/ide-detector-ETGAVVXO.js +8 -0
- package/dist/mcp.d.ts +734 -2
- package/dist/mcp.js +1126 -446
- package/dist/{paths-5LZRKNYY.js → paths-NTZ2357O.js} +3 -2
- package/dist/postinstall.js +1 -63
- package/dist/setup-CXZFERQE.js +48 -0
- package/docs/compatibility.md +146 -0
- package/docs/demo-script.md +121 -0
- package/docs/launch-copy.md +127 -0
- package/docs/privacy.md +173 -0
- package/docs/troubleshooting.md +206 -0
- package/package.json +32 -14
- package/dist/3-canonicalizer-HIN2F7SZ.js +0 -11
- package/dist/chunk-CUBZRYS5.js +0 -580
- package/dist/chunk-GGAATZKM.js +0 -120
- package/dist/chunk-IGCH7SZT.js +0 -281
- package/dist/chunk-JUDLOBOC.js +0 -77
- package/dist/chunk-JVLMZU5I.js +0 -271
- package/dist/chunk-KFQGP6VL.js +0 -33
- package/dist/chunk-PSASDZQE.js +0 -490
- package/dist/chunk-T7BJPANN.js +0 -45
- package/dist/compile-all-7ESDEBFG.js +0 -485
- package/dist/pre-tool-use-7F7NTHCS.js +0 -30
- package/dist/session-start-EIHYCS3J.js +0 -68
- package/dist/setup-45BVUDXN.js +0 -49
- package/dist/sqlite-NM2BVHUY.js +0 -7
- package/dist/stop-TPCRE7RE.js +0 -38
package/README.md
CHANGED
|
@@ -1,250 +1,299 @@
|
|
|
1
1
|
# AgentCache
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
> **Pick a coding session and continue it in another agent.**
|
|
4
|
+
|
|
5
|
+
**AgentCache 0.5.0-beta.1 is a same-machine public beta.** It keeps a local,
|
|
6
|
+
portable timeline for an explicitly selected coding session, then hands a
|
|
7
|
+
bounded checkpoint to another registered agent through MCP. There is no
|
|
8
|
+
Markdown handoff file to maintain and no silent choice of “latest” session.
|
|
9
|
+
|
|
10
|
+
The destination agent provider may receive the resume capsule when its agent
|
|
11
|
+
consumes a handoff. In the prescribed prompt-based flow, the handoff ID and
|
|
12
|
+
one-use token may also be sent to the destination provider. Treat the token as
|
|
13
|
+
a temporary bearer secret. “Local-first” describes AgentCache storage and
|
|
14
|
+
coordination; it does not change the network or retention behavior of Claude
|
|
15
|
+
Code, Codex, Cursor, or another hosted agent.
|
|
16
|
+
|
|
17
|
+
## What it carries
|
|
18
|
+
|
|
19
|
+
AgentCache carries the useful state around a coding conversation: the goal,
|
|
20
|
+
explicit constraints, completed work, open work, blockers, decisions, rejected
|
|
21
|
+
approaches, next step, portable Git metadata, and a bounded slice of recent
|
|
22
|
+
events. It can keep multiple client legs in one timeline or create an explicit
|
|
23
|
+
fork with an independent child timeline.
|
|
24
|
+
|
|
25
|
+
It does not transplant a vendor's private conversation object, hidden
|
|
26
|
+
reasoning, system prompt, approval state, or complete tool output. It does not
|
|
27
|
+
intentionally carry credentials: known credential patterns and absolute local
|
|
28
|
+
paths are redacted, but arbitrary secrets may still appear. It does not replace
|
|
29
|
+
a client's own `/resume` command. Native transcript stores are treated as
|
|
30
|
+
read-only sources.
|
|
31
|
+
|
|
32
|
+
## Five-minute quickstart
|
|
33
|
+
|
|
34
|
+
Prerequisites: Node.js 22 or newer, two supported clients installed on the same
|
|
35
|
+
machine, and the same canonical repository root open in both clients. Separate
|
|
36
|
+
clones and Git worktrees are isolated in this beta, even when their remotes
|
|
37
|
+
match.
|
|
38
|
+
|
|
39
|
+
1. Install the pinned beta and run the explicit setup step.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g agentcache@0.5.0-beta.1
|
|
43
|
+
agentcache setup
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Installation has no postinstall configuration hook. Setup is explicit:
|
|
47
|
+
`agentcache setup` detects installed clients and adds a client-bound MCP
|
|
48
|
+
entry such as `agentcache serve --adapter codex` when the existing config is
|
|
49
|
+
unambiguous. Restart or reload clients after setup.
|
|
50
|
+
|
|
51
|
+
2. Check what AgentCache actually detected and what each adapter can do.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
agentcache doctor
|
|
55
|
+
agentcache adapter list --json
|
|
56
|
+
agentcache adapter doctor claude-code
|
|
57
|
+
agentcache adapter doctor codex
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The global `agentcache doctor` checks exact adapter-bound MCP registrations
|
|
61
|
+
and, after initialization, the v2 store. On a fresh setup before the first
|
|
62
|
+
session operation, an absent v2 store is normal: doctor reports the
|
|
63
|
+
informational message `will initialize on first session operation`. That is
|
|
64
|
+
not a failure. `adapter doctor` reports the capability evidence for one
|
|
65
|
+
client.
|
|
66
|
+
|
|
67
|
+
3. In the source client, ask its AgentCache MCP server to open a portable
|
|
68
|
+
session for the current workspace, record the goal and relevant progress,
|
|
69
|
+
and create a checkpoint before you switch. Then, from that repository, list
|
|
70
|
+
the portable sessions.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
agentcache session list
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Listing also attempts bounded, read-only discovery for adapters whose native
|
|
77
|
+
history can prove the current workspace. A conversation opened through the
|
|
78
|
+
AgentCache MCP tools already appears as a portable session.
|
|
79
|
+
|
|
80
|
+
4. Prepare a handoff with the interactive picker. The destination is always
|
|
81
|
+
explicit.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
agentcache session resume --to codex
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Search, select a numbered session, inspect it, then choose `continue` or
|
|
88
|
+
`fork`. Known branches appear in the list. The inspection view shows the
|
|
89
|
+
exact local workspace path, recovered objective, checkpoint Git state,
|
|
90
|
+
event count, and an approximate checkpoint-state JSON baseline. The final
|
|
91
|
+
resume capsule is larger because bounded recent events and its envelope are
|
|
92
|
+
added later. AgentCache then shows the exact public capsule that the
|
|
93
|
+
destination will receive. Choose `exclude` to remove numbered events from
|
|
94
|
+
this handoff's initial capsule and re-preview it, `confirm` to finish, or
|
|
95
|
+
`cancel` to delete the unconsumed handoff. Nothing is preselected and the
|
|
96
|
+
picker has no timeout. The one-time token is printed only after confirmation
|
|
97
|
+
and expires after ten minutes. These local inspection details are not added
|
|
98
|
+
to the JSON listing contract.
|
|
99
|
+
|
|
100
|
+
5. Open the same repository in Codex and ask it to call AgentCache's
|
|
101
|
+
`session_resume` tool with that handoff ID and token. Ask it to restate the
|
|
102
|
+
goal and next step before continuing. The handoff is accepted only by the
|
|
103
|
+
chosen adapter in the chosen workspace.
|
|
104
|
+
|
|
105
|
+
For scripts, specify the session ID and request structured output:
|
|
19
106
|
|
|
20
107
|
```bash
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Done. Start a session in any IDE — AgentCache is already running.
|
|
25
|
-
|
|
26
|
-
No init. No setup. No config. The install:
|
|
27
|
-
|
|
28
|
-
1. Creates `~/.agentcache/agentcache.db`
|
|
29
|
-
2. Detects installed IDEs (Claude Code, Cursor, Roo Code, Windsurf, Continue, Codex)
|
|
30
|
-
3. Registers itself as an MCP server in each
|
|
31
|
-
4. Sets up Claude Code hooks for automatic transcript recovery
|
|
32
|
-
5. Spawns `compile-all` in background to process your existing transcript history
|
|
33
|
-
|
|
34
|
-
## Team knowledge — without a sync server
|
|
35
|
-
|
|
36
|
-
Compiled project knowledge is written to `<repo>/.agentcache/skills/project-knowledge/SKILL.md`. Commit it. Every teammate gets your team's accumulated decisions and context on clone, automatically picked up by any Agent Skills-compatible tool.
|
|
37
|
-
|
|
38
|
-
```markdown
|
|
39
|
-
## Decisions
|
|
40
|
-
- Using Drizzle ORM over Prisma for raw SQL escape hatches
|
|
41
|
-
- PostgreSQL for all persistent state, Redis for ephemeral cache only
|
|
42
|
-
|
|
43
|
-
## Current Context
|
|
44
|
-
- Migrating from REST to GraphQL, both coexist until Q3
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
No sync server. No accounts. Just git.
|
|
48
|
-
|
|
49
|
-
## How it works
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
┌────────────────────────────────────────────────────────────────────────┐
|
|
53
|
-
│ Your Machine │
|
|
54
|
-
│ │
|
|
55
|
-
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
56
|
-
│ │ Claude │ │ Cursor │ │ Roo │ │ Codex │ ... │
|
|
57
|
-
│ │ Code │ │ │ │ Code │ │ │ │
|
|
58
|
-
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
|
|
59
|
-
│ └─────────────┴─────────────┴─────────────┘ │
|
|
60
|
-
│ │ MCP Protocol (stdio) │
|
|
61
|
-
│ ┌────────────┴────────────┐ │
|
|
62
|
-
│ │ AgentCache MCP Server │ │
|
|
63
|
-
│ └────────────┬────────────┘ │
|
|
64
|
-
│ │ │
|
|
65
|
-
│ ┌─────────┴──────────┐ │
|
|
66
|
-
│ │ ~/.agentcache/ │ │
|
|
67
|
-
│ │ agentcache.db │ │
|
|
68
|
-
│ │ (SQLite + WAL) │ │
|
|
69
|
-
│ └────────────────────┘ │
|
|
70
|
-
└────────────────────────────────────────────────────────────────────────┘
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### The cycle
|
|
74
|
-
|
|
75
|
-
1. **Session starts** — agent calls `inject_context` → receives compiled rules, lessons, decisions
|
|
76
|
-
2. **During session** — agent calls `compile_submit` incrementally as it learns things
|
|
77
|
-
3. **Session ends** — observations are already saved. If the session terminates unexpectedly, transcript recovery handles it next time.
|
|
78
|
-
|
|
79
|
-
### Knowledge types
|
|
80
|
-
|
|
81
|
-
| Type | Scope | Example |
|
|
82
|
-
|------|-------|---------|
|
|
83
|
-
| Rule | Global | "Always use snake_case for database columns" |
|
|
84
|
-
| Lesson | Global | "Don't mock the database in integration tests — mocked tests passed but prod migration failed" |
|
|
85
|
-
| Decision | Project | "Using Drizzle ORM over Prisma because we need raw SQL escape hatches" |
|
|
86
|
-
| Context | Project | "Currently migrating from REST to GraphQL, both coexist" |
|
|
87
|
-
|
|
88
|
-
Rules and lessons are global — they apply to all your projects. Decisions and context are project-scoped.
|
|
89
|
-
|
|
90
|
-
## Security model
|
|
91
|
-
|
|
92
|
-
AgentCache creates a persistent feedback loop: agents write observations → observations compile into knowledge → knowledge injects into future sessions. This is the product's core value **and** its main attack surface. Both are the same thing.
|
|
93
|
-
|
|
94
|
-
### What the security model guarantees
|
|
95
|
-
|
|
96
|
-
- **Quarantine by default** — AUTO observations (agent-submitted) are never injected until confirmed across 2+ independent sessions. A single prompt-injected `compile_submit` call cannot poison your knowledge base — it lands in quarantine and requires independent reinforcement before it's ever served.
|
|
97
|
-
- **Enforced rules are human-only** — The enforce mechanism (which blocks agent tool calls) can only be set via CLI (`agentcache add-rule --enforce`). No MCP tool can create policy an agent is subject to.
|
|
98
|
-
- **Scope gate** — Agent-submitted observations are always project-scoped. Promotion to global scope requires explicit human action (USER authority). An agent cannot write a global rule.
|
|
99
|
-
- **Quarantine ≠ absent** — Quarantined items are captured and visible in `agentcache review`. They just don't inject. The review command is how you clear or promote them.
|
|
100
|
-
|
|
101
|
-
### What the security model does not guarantee
|
|
102
|
-
|
|
103
|
-
- `compile-all` processes raw transcripts that may contain injected content. Extraction prompt hardening raises the bar, but a sufficiently crafted transcript can still produce a quarantined (non-injecting) entry. Review your pending queue periodically.
|
|
104
|
-
- `locked` mode disables `compile_submit` entirely and requires human-triggered batch compilation. It reduces the attack surface significantly but `compile-all` against a poisoned transcript is still a vector.
|
|
105
|
-
|
|
106
|
-
### Security modes
|
|
107
|
-
|
|
108
|
-
Configure in `~/.agentcache/config.json`:
|
|
109
|
-
|
|
110
|
-
```json
|
|
111
|
-
{ "security": "auto" }
|
|
108
|
+
agentcache session resume ses_... --to codex --json
|
|
112
109
|
```
|
|
113
110
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
Non-interactive and JSON runs never open the picker; they fail if the session
|
|
112
|
+
ID is absent. They return the same bounded public capsule as `session_resume`;
|
|
113
|
+
pass one or more IDs to `--exclude-event <event-id...>` to omit known capsule
|
|
114
|
+
events. Exclusion is
|
|
115
|
+
not deletion or access control: it affects only this initial capsule, and a
|
|
116
|
+
same-workspace destination can still request those events with
|
|
117
|
+
`session_history`. See [the demo script](docs/demo-script.md) for a complete
|
|
118
|
+
Claude Code → Codex → Cursor fork walkthrough.
|
|
119
|
+
|
|
120
|
+
## Resume and fork semantics
|
|
121
|
+
|
|
122
|
+
- `continue` adds a new client leg to the same portable session.
|
|
123
|
+
- `fork` creates a child session anchored to an immutable parent checkpoint;
|
|
124
|
+
later parent and child events remain independent.
|
|
125
|
+
- An active source writer blocks continuation unless the human explicitly
|
|
126
|
+
confirms takeover with `--confirm-active-source`; for parallel work, fork.
|
|
127
|
+
- A handoff is single-use, expires after ten minutes, and is bound to one
|
|
128
|
+
destination adapter, workspace, and exact prepared capsule.
|
|
129
|
+
- Interactive cancellation and prompt failures delete the unconsumed draft;
|
|
130
|
+
superseded drafts are deleted before an exclusion-adjusted capsule is made.
|
|
131
|
+
- A changed session head, wrong destination, wrong workspace, expired token, or
|
|
132
|
+
reused token is rejected rather than guessed around.
|
|
133
|
+
- Long history is marked partial and can be fetched in bounded pages with
|
|
134
|
+
`session history` or the MCP `session_history` tool.
|
|
135
|
+
|
|
136
|
+
## Compatibility
|
|
137
|
+
|
|
138
|
+
The table below is generated as a documentation contract against the runtime
|
|
139
|
+
adapter registry. `experimental` means the parser or registration is covered by
|
|
140
|
+
fixtures but does not yet have dated live-client evidence. `unsupported` means
|
|
141
|
+
AgentCache will report the limitation instead of pretending the operation
|
|
142
|
+
works. Modes describe how the adapter capability is implemented.
|
|
143
|
+
|
|
144
|
+
<!-- runtime-capability-matrix:start -->
|
|
145
|
+
| Client | Adapter ID | Registration | History | Native resume | Append | Checkpoint | Fork | Launch |
|
|
146
|
+
|---|---|---|---|---|---|---|---|---|
|
|
147
|
+
| Claude Code | claude-code | experimental / mcp-cooperative | experimental / local-snapshot | unsupported / none | unsupported / none | unsupported / none | unsupported / none | unsupported / none |
|
|
148
|
+
| Cursor | cursor | experimental / mcp-cooperative | experimental / local-snapshot | unsupported / none | unsupported / none | unsupported / none | unsupported / none | unsupported / none |
|
|
149
|
+
| Roo Code | roo-code | experimental / mcp-cooperative | experimental / local-snapshot | unsupported / none | unsupported / none | unsupported / none | unsupported / none | unsupported / none |
|
|
150
|
+
| Windsurf | windsurf | experimental / mcp-cooperative | unsupported / none | unsupported / none | unsupported / none | unsupported / none | unsupported / none | unsupported / none |
|
|
151
|
+
| Continue | continue | experimental / mcp-cooperative | experimental / local-snapshot | unsupported / none | unsupported / none | unsupported / none | unsupported / none | unsupported / none |
|
|
152
|
+
| Codex | codex | experimental / mcp-cooperative | experimental / local-snapshot | unsupported / none | unsupported / none | unsupported / none | unsupported / none | unsupported / none |
|
|
153
|
+
| Goose | goose | experimental / mcp-cooperative | unsupported / none | unsupported / none | unsupported / none | unsupported / none | unsupported / none | unsupported / none |
|
|
154
|
+
<!-- runtime-capability-matrix:end -->
|
|
155
|
+
|
|
156
|
+
The `native resume`, `append`, `checkpoint`, `fork`, and `launch` columns are
|
|
157
|
+
client-native adapter capabilities. The beta's portable append, checkpoint,
|
|
158
|
+
resume, and fork operations are provided through AgentCache's shared MCP/CLI
|
|
159
|
+
session layer; they do not write those operations into vendor-owned histories.
|
|
160
|
+
Windsurf and Goose historical recovery are unsupported. Goose MCP registration
|
|
161
|
+
uses its documented 1.39 YAML schema but remains experimental.
|
|
162
|
+
|
|
163
|
+
For evidence, limitations, source formats, and how to read the matrix, see
|
|
164
|
+
[Compatibility](docs/compatibility.md). The live source of truth is:
|
|
121
165
|
|
|
122
166
|
```bash
|
|
123
|
-
agentcache
|
|
124
|
-
agentcache doctor
|
|
125
|
-
agentcache review # List quarantined items, approve or reject
|
|
126
|
-
agentcache promote <id> # Promote a single item past quarantine
|
|
127
|
-
agentcache add-rule "never commit secrets" --enforce # Create enforced policy (human only)
|
|
128
|
-
agentcache add-rule "use tabs" --global # Global rule across all projects
|
|
129
|
-
agentcache compile-all # Batch-compile all unprocessed transcripts
|
|
130
|
-
agentcache setup # Re-register with IDEs (only if postinstall failed)
|
|
167
|
+
agentcache adapter list --json
|
|
168
|
+
agentcache adapter doctor <adapter-id> --json
|
|
131
169
|
```
|
|
132
170
|
|
|
133
|
-
##
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
|
152
|
-
|
|
153
|
-
| `
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
171
|
+
## Command reference
|
|
172
|
+
|
|
173
|
+
These are the public beta session-continuity commands. Options are abbreviated
|
|
174
|
+
here; use `agentcache <group> <command> --help` for the complete syntax.
|
|
175
|
+
|
|
176
|
+
<!-- beta-command-matrix:start -->
|
|
177
|
+
| Command | Purpose |
|
|
178
|
+
|---|---|
|
|
179
|
+
| `session list` | Discover and list sessions for the current workspace. |
|
|
180
|
+
| `session inspect` | Inspect one portable session. |
|
|
181
|
+
| `session resume` | Prepare an explicit one-use destination handoff. |
|
|
182
|
+
| `session append` | Append one human-authorized portable event. |
|
|
183
|
+
| `session checkpoint` | Create one human-authorized checkpoint. |
|
|
184
|
+
| `session fork` | Prepare an explicit fork from a checkpoint. |
|
|
185
|
+
| `session history` | Read a bounded page of portable history. |
|
|
186
|
+
| `handoff list` | List pending handoffs for the current workspace. |
|
|
187
|
+
| `handoff cancel` | Cancel one pending handoff. |
|
|
188
|
+
| `adapter list` | List supported runtime adapter definitions. |
|
|
189
|
+
| `adapter doctor` | Probe one adapter and show capability evidence. |
|
|
190
|
+
| `adapter register` | Register AgentCache with one detected client. |
|
|
191
|
+
| `adapter unregister` | Remove AgentCache-owned registration for one client. |
|
|
192
|
+
<!-- beta-command-matrix:end -->
|
|
193
|
+
|
|
194
|
+
The exact argument and option contract is checked against the real Commander
|
|
195
|
+
command objects. “Required options” must be present for Commander to invoke the
|
|
196
|
+
handler; angle brackets on an optional option mean that the option takes a
|
|
197
|
+
value, not that the option itself is mandatory.
|
|
198
|
+
|
|
199
|
+
<!-- cli-help-contract:start -->
|
|
200
|
+
| Command | Arguments | Required options | Optional options |
|
|
201
|
+
|---|---|---|---|
|
|
202
|
+
| `session list` | — | — | `--adapter <id>; --status <status>; --json` |
|
|
203
|
+
| `session inspect` | `<session-id>` | — | `--json` |
|
|
204
|
+
| `session resume` | `[session-id]` | `--to <adapter>` | `--checkpoint <id>; --fork; --confirm-active-source; --exclude-event <event-id...>; --json` |
|
|
205
|
+
| `session append` | `<session-id>` | `--kind <kind>` | `--text <text>; --stdin; --json` |
|
|
206
|
+
| `session checkpoint` | `<session-id>` | — | `--summary <text>; --summary-file <path>; --state-file <path>; --json` |
|
|
207
|
+
| `session fork` | `<session-id>` | `--from <checkpoint-id|latest>; --to <adapter>` | `--title <title>; --exclude-event <event-id...>; --json` |
|
|
208
|
+
| `session history` | `<session-id>` | — | `--before <cursor>; --limit <number>; --json` |
|
|
209
|
+
| `handoff list` | — | — | `--json` |
|
|
210
|
+
| `handoff cancel` | `<handoff-id>` | — | `--json` |
|
|
211
|
+
| `adapter list` | — | — | `--json` |
|
|
212
|
+
| `adapter doctor` | `<adapter-id>` | — | `--json` |
|
|
213
|
+
| `adapter register` | `<adapter-id>` | — | — |
|
|
214
|
+
| `adapter unregister` | `<adapter-id>` | — | — |
|
|
215
|
+
<!-- cli-help-contract:end -->
|
|
216
|
+
|
|
217
|
+
`session append` requires exactly one of `--text` or `--stdin`. `session
|
|
218
|
+
checkpoint` accepts at most one of `--summary`, `--summary-file`, or
|
|
219
|
+
`--state-file`. A non-interactive or `--json` resume requires an explicit
|
|
220
|
+
session ID.
|
|
221
|
+
|
|
222
|
+
## Data flow and safety boundary
|
|
223
|
+
|
|
224
|
+
```text
|
|
225
|
+
read-only native history (when verified)
|
|
226
|
+
│ bounded read + normalization + redaction
|
|
227
|
+
▼
|
|
228
|
+
~/.agentcache/agentcache-v2.db
|
|
229
|
+
│ explicit checkpoint + one-use handoff
|
|
230
|
+
▼
|
|
231
|
+
destination MCP session
|
|
232
|
+
│ hosted-client provider boundary
|
|
233
|
+
▼
|
|
234
|
+
destination model
|
|
164
235
|
```
|
|
165
|
-
Observations (raw)
|
|
166
|
-
│
|
|
167
|
-
▼
|
|
168
|
-
Extract → Normalize → Canonicalize → Cluster → Detect Contradictions → Compile
|
|
169
|
-
│
|
|
170
|
-
┌───────────────────────────────────────────┘
|
|
171
|
-
│
|
|
172
|
-
PENDING store
|
|
173
|
-
│
|
|
174
|
-
┌─────────┴──────────┐
|
|
175
|
-
│ │
|
|
176
|
-
AUTO items USER items
|
|
177
|
-
(quarantine gate) (inject immediately)
|
|
178
|
-
2+ sessions before
|
|
179
|
-
injection
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
**Two compilation paths:**
|
|
183
|
-
|
|
184
|
-
- **In-session** — agent processes extraction via MCP tools in your IDE
|
|
185
|
-
- **Batch** — `compile-all` runs independently, processes full backlog
|
|
186
|
-
|
|
187
|
-
**Two output formats:**
|
|
188
|
-
|
|
189
|
-
- **MCP injection** — structured context via `inject_context`
|
|
190
|
-
- **SKILL.md** — Agent Skills spec files auto-discovered by 38+ tools without MCP
|
|
191
|
-
|
|
192
|
-
## Design principles
|
|
193
|
-
|
|
194
|
-
**Zero config** — `npm install -g agentcache` is the only step. No dotfiles, no init, no config to maintain.
|
|
195
|
-
|
|
196
|
-
**Universal** — MCP is the only interface. Any IDE, any LLM. No IDE-specific code paths.
|
|
197
|
-
|
|
198
|
-
**Developer-scoped** — One database per developer, not per project. Global knowledge (rules, lessons) benefits all your projects. Project knowledge stays scoped.
|
|
199
|
-
|
|
200
|
-
**Resilient to abrupt exits** — Incremental submission + transcript recovery + pipe-independent compilation means knowledge survives crashes, ctrl-c, and MCP disconnects.
|
|
201
|
-
|
|
202
|
-
**Anti-bloat** — Confidence promotion, 30-day decay on unused items, budget caps (20 rules / 10 lessons / 10 decisions / 5 context per session), priority ranking.
|
|
203
|
-
|
|
204
|
-
## Supported IDEs
|
|
205
|
-
|
|
206
|
-
| IDE | MCP | Auto-Approve | Transcript Recovery | Hooks |
|
|
207
|
-
|-----|-----|-------------|-------------------|-------|
|
|
208
|
-
| Claude Code | Yes | Yes | Full (JSONL) | Stop, SessionStart, PreToolUse |
|
|
209
|
-
| Cursor | Yes | Yes | Incremental only | — |
|
|
210
|
-
| Roo Code | Yes | Yes | Full (JSON via compile-all) | — |
|
|
211
|
-
| Windsurf | Yes | Yes | Incremental only | — |
|
|
212
|
-
| Continue | Yes | Yes | Full (JSON) | — |
|
|
213
|
-
| Codex | Yes | Yes | Full (JSONL via compile-all) | — |
|
|
214
|
-
| Goose | — | — | Full (SQLite via compile-all) | — |
|
|
215
|
-
| Aider | Coming soon | | | |
|
|
216
|
-
| GitHub Copilot | Coming soon | | | |
|
|
217
|
-
| Zed AI | Coming soon | | | |
|
|
218
|
-
|
|
219
|
-
## Data storage
|
|
220
|
-
|
|
221
|
-
```
|
|
222
|
-
~/.agentcache/
|
|
223
|
-
├── agentcache.db # Knowledge, observations, sessions, pending queue
|
|
224
|
-
├── config.json # Security mode and settings
|
|
225
|
-
├── compile-all.lock # Prevents concurrent compilation
|
|
226
|
-
└── skills/developer-knowledge/SKILL.md # Global skill (auto-generated)
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
No data leaves your machine. No network calls. No telemetry. No accounts.
|
|
230
|
-
|
|
231
|
-
### Project identity
|
|
232
|
-
|
|
233
|
-
Projects are identified by a hash of their full filesystem path. `/work/api` and `/personal/api` are different projects. Knowledge never leaks between same-named projects in different locations.
|
|
234
|
-
|
|
235
|
-
## Roadmap
|
|
236
|
-
|
|
237
|
-
- **Native plugins** — Marketplace listings and deeper UI integrations for all supported IDEs
|
|
238
|
-
- **Team knowledge sharing** — Share compiled knowledge across your team
|
|
239
|
-
- **Cloud sync** — Same developer, different machines, same knowledge
|
|
240
|
-
- **Analytics dashboard** — Compilation stats, knowledge growth, most-referenced rules
|
|
241
236
|
|
|
242
|
-
|
|
237
|
+
AgentCache stores v2 session data locally with user-only filesystem
|
|
238
|
+
permissions. It rejects symbolic, special, or multiply linked database and
|
|
239
|
+
SQLite sidecar paths, uses bounded transcript reads, rejects transcript
|
|
240
|
+
symlinks, redacts known credential shapes and absolute local paths from
|
|
241
|
+
portable text, and labels resume data `untrusted_prior_session_context`.
|
|
242
|
+
Redaction is defense in depth, not a proof that arbitrary secrets cannot
|
|
243
|
+
appear; inspect sensitive sessions before handing them to another provider.
|
|
244
|
+
|
|
245
|
+
Setup does not add blanket AgentCache tool approvals. Registration updates are
|
|
246
|
+
atomic, back up an existing configuration before a material change, and leave
|
|
247
|
+
malformed or ambiguous configurations untouched. AgentCache does not mutate Git
|
|
248
|
+
or write generated context into a repository in the default beta path.
|
|
249
|
+
|
|
250
|
+
Read the complete [privacy and trust boundary](docs/privacy.md) before using the
|
|
251
|
+
beta with sensitive repositories.
|
|
252
|
+
|
|
253
|
+
## Beta limits
|
|
254
|
+
|
|
255
|
+
- Same machine only. Cloud sync, accounts, teams, and cross-device continuation
|
|
256
|
+
are deferred.
|
|
257
|
+
- There is no native picker UI; the terminal picker is the control plane.
|
|
258
|
+
- Native client history formats can change. All current adapters are marked
|
|
259
|
+
experimental or unsupported until dated live-client verification exists.
|
|
260
|
+
- Windsurf and Goose can participate prospectively through MCP registration,
|
|
261
|
+
but their historical recovery is unsupported.
|
|
262
|
+
- AgentCache cannot carry hidden reasoning, private provider state, or tool
|
|
263
|
+
approvals between clients.
|
|
264
|
+
- A Markdown fallback is intentionally not generated when a destination is
|
|
265
|
+
unavailable; the pending handoff remains until it is consumed, cancelled, or
|
|
266
|
+
expires.
|
|
267
|
+
|
|
268
|
+
## Legacy 0.4 data
|
|
269
|
+
|
|
270
|
+
Version 0.5 creates `~/.agentcache/agentcache-v2.db` beside the legacy
|
|
271
|
+
`~/.agentcache/agentcache.db`; it does not translate or mutate compiled v1
|
|
272
|
+
knowledge. Legacy v1 CLI commands are not registered in the beta: `compile-session`,
|
|
273
|
+
`discover`, `enforce`, `review`, `promote`, `add-rule`, `compile-all`, and
|
|
274
|
+
`status` are unavailable. Setup, installation, startup, session discovery, and
|
|
275
|
+
idle operation cannot invoke legacy compilation. Automatic `SKILL.md`
|
|
276
|
+
generation is not part of the beta path.
|
|
277
|
+
|
|
278
|
+
This preserves the original “your codebase learns” experiment without making
|
|
279
|
+
its legacy compiler the trust boundary for cross-agent continuation.
|
|
280
|
+
|
|
281
|
+
## Operations and feedback
|
|
282
|
+
|
|
283
|
+
- [Troubleshooting, uninstall, and rollback](docs/troubleshooting.md)
|
|
284
|
+
- [Privacy and data flow](docs/privacy.md)
|
|
285
|
+
- [Compatibility details](docs/compatibility.md)
|
|
286
|
+
- [60–90 second demo](docs/demo-script.md)
|
|
287
|
+
- [Launch copy](docs/launch-copy.md)
|
|
288
|
+
- [Open a structured beta-feedback issue](https://github.com/raghav-a21ai/agentcache/issues/new?template=beta-feedback.yml)
|
|
289
|
+
|
|
290
|
+
## Development
|
|
243
291
|
|
|
244
292
|
```bash
|
|
245
293
|
git clone https://github.com/raghav-a21ai/agentcache
|
|
246
294
|
cd agentcache
|
|
247
295
|
npm install
|
|
296
|
+
npm run typecheck
|
|
248
297
|
npm run build
|
|
249
298
|
npm test
|
|
250
299
|
```
|