Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "claude-supermemory",
"source": "./plugin",
"description": "Persistent memory across Claude Code sessions using Supermemory",
"version": "0.0.3",
"version": "0.0.4",
"author": {
"name": "Supermemory"
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "claude-supermemory-dev",
"version": "2.0.1",
"version": "0.0.4",
"description": "Claude code plugin by Supermemory AI",
"private": true,
"type": "commonjs",
Expand Down
2 changes: 1 addition & 1 deletion plugin/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "claude-supermemory",
"version": "0.0.3",
"version": "0.0.4",
"description": "Persistent memory across Claude Code sessions using Supermemory",
"author": {
"name": "Supermemory",
Expand Down
4 changes: 2 additions & 2 deletions plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "claude-supermemory",
"version": "1.0.0",
"version": "0.0.4",
"description": "Persistent memory for Claude Code using Supermemory",
"private": true,
"engines": {
Expand Down
12 changes: 6 additions & 6 deletions plugin/scripts/add-memory.cjs

Large diffs are not rendered by default.

48 changes: 26 additions & 22 deletions plugin/scripts/context-hook.cjs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions plugin/scripts/save-project-memory.cjs

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions plugin/scripts/search-memory.cjs

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions plugin/scripts/summary-hook.cjs

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions plugin/skills/supermemory-save/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: supermemory-save
description: Save important project knowledge to memory (alias for super-save). Use when user wants to preserve architectural decisions, significant bug fixes, design patterns, or important implementation details.
allowed-tools: Bash(node *)
---

# Supermemory Save

Canonical save skill. Legacy alias: `super-save`.

```bash
node "${CLAUDE_PLUGIN_ROOT}/scripts/save-project-memory.cjs" "FORMATTED_CONTENT"
```

See `super-save` for formatting guidance.
17 changes: 17 additions & 0 deletions plugin/skills/supermemory-search/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: supermemory-search
description: Search your coding memory (alias for super-search). Use when user asks about past work, previous sessions, how something was implemented, or wants to recall information from earlier sessions.
allowed-tools: Bash(node:*)
---

# Supermemory Search

Canonical search skill. Legacy alias: `super-search`.

Run:

```bash
node "${CLAUDE_PLUGIN_ROOT}/scripts/search-memory.cjs" [--user|--repo|--both] "USER_QUERY_HERE"
```

See `super-search` for full usage examples.
11 changes: 5 additions & 6 deletions src/context-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ Or set SUPERMEMORY_CC_API_KEY environment variable manually.
client
.getProfile(personalTag, projectName)
.catch(handleProfileError('personal')),
client
.getProfile(repoTag, projectName)
.catch(handleProfileError('repo')),
client.getProfile(repoTag, projectName).catch(handleProfileError('repo')),
]);

const personalContext = formatContext(
Expand Down Expand Up @@ -111,9 +109,10 @@ Or set SUPERMEMORY_CC_API_KEY environment variable manually.
writeOutput({
hookSpecificOutput: {
hookEventName: 'SessionStart',
additionalContext: apiErrors.length > 0
? errorNotice
: `<supermemory-context>
additionalContext:
apiErrors.length > 0
? errorNotice
: `<supermemory-context>
No previous memories found for this project.
Memories will be saved as you work.
</supermemory-context>`,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/error-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @returns {string}
*/
function getUserFriendlyError(err) {
const status = err && err.status;
const status = err?.status;

if (status === 400) {
return 'Bad request \u2014 your API key or request format may be invalid. Check your key at https://console.supermemory.ai';
Expand All @@ -31,7 +31,7 @@ function getUserFriendlyError(err) {
return 'Supermemory service is temporarily unavailable. Will retry next session.';
}

return (err && err.message) || 'Unknown error';
return err?.message || 'Unknown error';
}

/**
Expand All @@ -44,7 +44,7 @@ function getUserFriendlyError(err) {
* @returns {boolean}
*/
function isRetryableError(err) {
const status = err && err.status;
const status = err?.status;
if (status === 429) return true;
if (typeof status === 'number' && status >= 500) return true;
// Connection / timeout errors have no status
Expand All @@ -62,7 +62,7 @@ function isRetryableError(err) {
* @returns {boolean}
*/
function isBenignError(err) {
const status = err && err.status;
const status = err?.status;
if (status === 404) return true;
// No status usually means a connection or timeout error
if (status === undefined || status === null) return true;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/supermemory-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class SupermemoryClient {
this.client = new Supermemory({
apiKey,
baseURL: API_URL,
defaultHeaders: integrityHeaders,
defaultHeaders: { ...integrityHeaders, 'x-sm-source': 'claude-code' },
});
this.containerTag = tag;
}
Expand All @@ -86,7 +86,7 @@ class SupermemoryClient {
const payload = {
content,
containerTag: containerTag || this.containerTag,
metadata: { sm_source: 'claude-code-plugin', ...metadata },
metadata: { sm_source: 'claude-code', ...metadata },
};
if (options.customId) payload.customId = options.customId;
if (options.entityContext) payload.entityContext = options.entityContext;
Expand Down
Loading