claude-session-skill 1.1.3 → 1.1.5
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 +17 -0
- package/dist/mcp-server.js +12 -1
- package/dist/session.js +12 -1
- package/lib/__tests__/format.test.ts +25 -0
- package/lib/format.ts +12 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
A [Claude Code](https://docs.anthropic.com/en/docs/claude-code) skill for searching, browsing, and naming past sessions. Indexes all session history and generates AI summaries so you can find any session by keyword, project, or name.
|
|
4
4
|
|
|
5
|
+
This package ships two ways to use the same session index:
|
|
6
|
+
|
|
7
|
+
- **Claude Code skill** — install via `git clone`, use `/session` commands directly in Claude Code
|
|
8
|
+
- **MCP server** — install via `npm`, connect any MCP-compatible client (Claude Desktop, Cursor, etc.)
|
|
9
|
+
|
|
10
|
+
Both read from the same `~/.claude/` session data. Use whichever fits your workflow.
|
|
11
|
+
|
|
5
12
|
## Requirements
|
|
6
13
|
|
|
7
14
|
- [Bun](https://bun.sh) runtime
|
|
@@ -73,6 +80,16 @@ Names are 1–50 characters. Named sessions rank highest in search results. Clea
|
|
|
73
80
|
| Within 24 hours | 1.5× recency boost |
|
|
74
81
|
| Within 7 days | 1.2× recency boost |
|
|
75
82
|
|
|
83
|
+
## Resuming sessions
|
|
84
|
+
|
|
85
|
+
Every session view (list, search, detail) prints a ready-to-run resume command:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
Resume: cd /path/to/project && claude --resume <session-id>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Why the `cd`?** `claude --resume` is directory-scoped — it only searches for sessions stored under the project folder matching your *current* working directory. Running it from the wrong directory returns `No conversation found` even with a valid session ID. Always run the full `cd ... && claude --resume ...` command as printed.
|
|
92
|
+
|
|
76
93
|
## MCP Server
|
|
77
94
|
|
|
78
95
|
`claude-session-skill` ships a Model Context Protocol (MCP) server so any MCP-compatible client (Claude Desktop, Cursor, etc.) can search sessions without using the CLI skill.
|
package/dist/mcp-server.js
CHANGED
|
@@ -15167,6 +15167,9 @@ function formatSessionList(sessions, showAll) {
|
|
|
15167
15167
|
if (lastMsg) {
|
|
15168
15168
|
lines.push(` Left off: "${truncate(lastMsg, 90)}"`);
|
|
15169
15169
|
}
|
|
15170
|
+
if (s.cwd) {
|
|
15171
|
+
lines.push(` Resume: cd ${s.cwd} && claude --resume ${s.id}`);
|
|
15172
|
+
}
|
|
15170
15173
|
lines.push("");
|
|
15171
15174
|
}
|
|
15172
15175
|
return lines.join(`
|
|
@@ -15192,7 +15195,10 @@ function formatSearchResults(sessions, query) {
|
|
|
15192
15195
|
lines.push(` Left off: "${truncate(lastMsg, 90)}"`);
|
|
15193
15196
|
}
|
|
15194
15197
|
if (s.gitBranch) {
|
|
15195
|
-
lines.push(` Branch:
|
|
15198
|
+
lines.push(` Branch: ${s.gitBranch}`);
|
|
15199
|
+
}
|
|
15200
|
+
if (s.cwd) {
|
|
15201
|
+
lines.push(` Resume: cd ${s.cwd} && claude --resume ${s.id}`);
|
|
15196
15202
|
}
|
|
15197
15203
|
lines.push("");
|
|
15198
15204
|
}
|
|
@@ -15223,6 +15229,11 @@ function formatSessionDetail(session) {
|
|
|
15223
15229
|
lines.push(`Left off: "${s.lastMessage.slice(0, 300)}"`);
|
|
15224
15230
|
lines.push("");
|
|
15225
15231
|
}
|
|
15232
|
+
if (s.cwd) {
|
|
15233
|
+
lines.push(`Resume with:`);
|
|
15234
|
+
lines.push(` cd ${s.cwd} && claude --resume ${s.id}`);
|
|
15235
|
+
lines.push("");
|
|
15236
|
+
}
|
|
15226
15237
|
return lines.join(`
|
|
15227
15238
|
`);
|
|
15228
15239
|
}
|
package/dist/session.js
CHANGED
|
@@ -747,6 +747,9 @@ function formatSessionList(sessions, showAll) {
|
|
|
747
747
|
if (lastMsg) {
|
|
748
748
|
lines.push(` Left off: "${truncate(lastMsg, 90)}"`);
|
|
749
749
|
}
|
|
750
|
+
if (s.cwd) {
|
|
751
|
+
lines.push(` Resume: cd ${s.cwd} && claude --resume ${s.id}`);
|
|
752
|
+
}
|
|
750
753
|
lines.push("");
|
|
751
754
|
}
|
|
752
755
|
return lines.join(`
|
|
@@ -772,7 +775,10 @@ function formatSearchResults(sessions, query) {
|
|
|
772
775
|
lines.push(` Left off: "${truncate(lastMsg, 90)}"`);
|
|
773
776
|
}
|
|
774
777
|
if (s.gitBranch) {
|
|
775
|
-
lines.push(` Branch:
|
|
778
|
+
lines.push(` Branch: ${s.gitBranch}`);
|
|
779
|
+
}
|
|
780
|
+
if (s.cwd) {
|
|
781
|
+
lines.push(` Resume: cd ${s.cwd} && claude --resume ${s.id}`);
|
|
776
782
|
}
|
|
777
783
|
lines.push("");
|
|
778
784
|
}
|
|
@@ -803,6 +809,11 @@ function formatSessionDetail(session) {
|
|
|
803
809
|
lines.push(`Left off: "${s.lastMessage.slice(0, 300)}"`);
|
|
804
810
|
lines.push("");
|
|
805
811
|
}
|
|
812
|
+
if (s.cwd) {
|
|
813
|
+
lines.push(`Resume with:`);
|
|
814
|
+
lines.push(` cd ${s.cwd} && claude --resume ${s.id}`);
|
|
815
|
+
lines.push("");
|
|
816
|
+
}
|
|
806
817
|
return lines.join(`
|
|
807
818
|
`);
|
|
808
819
|
}
|
|
@@ -64,6 +64,16 @@ describe("formatSessionList", () => {
|
|
|
64
64
|
const output = formatSessionList([makeSession({ name: "Auth Fix" })], true);
|
|
65
65
|
expect(output).toContain("Auth Fix");
|
|
66
66
|
});
|
|
67
|
+
|
|
68
|
+
test("shows resume command in list view", () => {
|
|
69
|
+
const output = formatSessionList([makeSession()], true);
|
|
70
|
+
expect(output).toContain("cd /Users/tim/projects/my-project && claude --resume abcdef1234567890");
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("omits resume line when cwd is empty in list", () => {
|
|
74
|
+
const output = formatSessionList([makeSession({ cwd: "" })], true);
|
|
75
|
+
expect(output).not.toContain("claude --resume");
|
|
76
|
+
});
|
|
67
77
|
});
|
|
68
78
|
|
|
69
79
|
describe("formatSearchResults", () => {
|
|
@@ -88,6 +98,11 @@ describe("formatSearchResults", () => {
|
|
|
88
98
|
const output = formatSearchResults([makeSession({ gitBranch: "feat/login" })], "auth");
|
|
89
99
|
expect(output).toContain("feat/login");
|
|
90
100
|
});
|
|
101
|
+
|
|
102
|
+
test("shows resume command in search results", () => {
|
|
103
|
+
const output = formatSearchResults([makeSession()], "auth");
|
|
104
|
+
expect(output).toContain("cd /Users/tim/projects/my-project && claude --resume abcdef1234567890");
|
|
105
|
+
});
|
|
91
106
|
});
|
|
92
107
|
|
|
93
108
|
describe("formatSessionDetail", () => {
|
|
@@ -130,6 +145,16 @@ describe("formatSessionDetail", () => {
|
|
|
130
145
|
const output = formatSessionDetail(makeSession({ gitBranch: "" }));
|
|
131
146
|
expect(output).not.toContain("Branch:");
|
|
132
147
|
});
|
|
148
|
+
|
|
149
|
+
test("shows resume command with cd and session id", () => {
|
|
150
|
+
const output = formatSessionDetail(makeSession());
|
|
151
|
+
expect(output).toContain("cd /Users/tim/projects/my-project && claude --resume abcdef1234567890");
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
test("omits resume line when cwd is empty", () => {
|
|
155
|
+
const output = formatSessionDetail(makeSession({ cwd: "" }));
|
|
156
|
+
expect(output).not.toContain("claude --resume");
|
|
157
|
+
});
|
|
133
158
|
});
|
|
134
159
|
|
|
135
160
|
describe("formatStats", () => {
|
package/lib/format.ts
CHANGED
|
@@ -75,6 +75,9 @@ export function formatSessionList(sessions: SessionEntry[], showAll: boolean): s
|
|
|
75
75
|
if (lastMsg) {
|
|
76
76
|
lines.push(` Left off: "${truncate(lastMsg, 90)}"`);
|
|
77
77
|
}
|
|
78
|
+
if (s.cwd) {
|
|
79
|
+
lines.push(` Resume: cd ${s.cwd} && claude --resume ${s.id}`);
|
|
80
|
+
}
|
|
78
81
|
lines.push("");
|
|
79
82
|
}
|
|
80
83
|
|
|
@@ -105,7 +108,10 @@ export function formatSearchResults(sessions: SessionEntry[], query: string): st
|
|
|
105
108
|
lines.push(` Left off: "${truncate(lastMsg, 90)}"`);
|
|
106
109
|
}
|
|
107
110
|
if (s.gitBranch) {
|
|
108
|
-
lines.push(` Branch:
|
|
111
|
+
lines.push(` Branch: ${s.gitBranch}`);
|
|
112
|
+
}
|
|
113
|
+
if (s.cwd) {
|
|
114
|
+
lines.push(` Resume: cd ${s.cwd} && claude --resume ${s.id}`);
|
|
109
115
|
}
|
|
110
116
|
lines.push("");
|
|
111
117
|
}
|
|
@@ -136,6 +142,11 @@ export function formatSessionDetail(session: SessionEntry): string {
|
|
|
136
142
|
lines.push(`Left off: "${s.lastMessage.slice(0, 300)}"`);
|
|
137
143
|
lines.push("");
|
|
138
144
|
}
|
|
145
|
+
if (s.cwd) {
|
|
146
|
+
lines.push(`Resume with:`);
|
|
147
|
+
lines.push(` cd ${s.cwd} && claude --resume ${s.id}`);
|
|
148
|
+
lines.push("");
|
|
149
|
+
}
|
|
139
150
|
|
|
140
151
|
return lines.join("\n");
|
|
141
152
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-session-skill",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Search, browse, and resume past Claude Code sessions with AI-generated summaries — plus an MCP server for any MCP-compatible client",
|
|
5
5
|
"author": "ITeachYouAI <engineering@iteachyouai.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"type": "module",
|
|
31
31
|
"main": "session.ts",
|
|
32
32
|
"bin": {
|
|
33
|
-
"claude-session": "
|
|
34
|
-
"claude-session-mcp": "
|
|
33
|
+
"claude-session": "bin/claude-session",
|
|
34
|
+
"claude-session-mcp": "bin/claude-session-mcp"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"bin/",
|