braintracker 1.2.0 → 1.3.0

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 CHANGED
@@ -31,23 +31,18 @@ Removes the hook files and cleans up `~/.claude/settings.json`.
31
31
 
32
32
  ## Verify
33
33
 
34
- Invoke any skill inside Claude Code (e.g. `/review`), then:
34
+ After a conversation, two files are written per session under `~/.claude/plugin/cache/braintracker/<project>/` (`<project>` is the working directory name):
35
+
36
+ **Full conversation transcript** — every message, all text and tool content:
35
37
 
36
38
  ```bash
37
- cat ~/.claude/plugin/cache/braintracker/<project>/<session_id>.jsonl
39
+ cat ~/.claude/plugin/cache/braintracker/<project>/<session_id>.transcript.json
38
40
  ```
39
41
 
40
- Each line is a JSON object:
41
-
42
- ```json
43
- {
44
- "type": "skill_invocation",
45
- "session_id": "abc123",
46
- "skill": "review",
47
- "triggered_by": "review this PR",
48
- "started_at": "2026-05-25T10:00:00Z",
49
- "duration_seconds": 4.2
50
- }
42
+ **Event log** one JSON line per turn / skill invocation:
43
+
44
+ ```bash
45
+ cat ~/.claude/plugin/cache/braintracker/<project>/<session_id>.jsonl
51
46
  ```
52
47
 
53
48
  ## How It Works
@@ -18,22 +18,15 @@ process.stdin.on('end', () => {
18
18
  try { preData = JSON.parse(fs.readFileSync(preFile, 'utf8')); } catch { process.exit(0); }
19
19
 
20
20
  const transcript = payload.transcript || [];
21
- const lastAssistant = [...transcript].reverse().find(m => m.role === 'assistant');
22
- let assistantResponse = '';
23
- if (lastAssistant) {
24
- const c = lastAssistant.content;
25
- if (typeof c === 'string') {
26
- assistantResponse = c;
27
- } else if (Array.isArray(c)) {
28
- assistantResponse = c.filter(b => b.type === 'text').map(b => b.text).join('');
29
- }
30
- }
21
+
22
+ // overwrite transcript file with full conversation on every turn
23
+ const transcriptFile = path.join(cacheDir, `${sessionId}.transcript.json`);
24
+ fs.writeFileSync(transcriptFile, JSON.stringify(transcript, null, 2));
31
25
 
32
26
  const entry = {
33
27
  type: 'conversation_turn',
34
28
  session_id: sessionId,
35
29
  user_prompt: preData.prompt,
36
- assistant_response: assistantResponse,
37
30
  started_at: new Date(preData.start_time).toISOString(),
38
31
  duration_seconds: (Date.now() - preData.start_time) / 1000,
39
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braintracker",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Claude Code plugin that logs every skill invocation with duration and triggering prompt",
5
5
  "bin": {
6
6
  "braintracker": "bin/braintracker.js"