backthread 0.1.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.
@@ -0,0 +1,15 @@
1
+ {
2
+ "$comment": "F7.7 / ARP-438 — the SessionEnd capture hook, declared in the PLUGIN MANIFEST (referenced from .claude-plugin/plugin.json). When Backthread is installed as a Claude Code plugin, this registers the hook automatically — no mutation of the user's .claude/settings.json. `npx backthread capture` reads the SessionEnd payload off stdin, derives this session's decisions LOCALLY-redacted, and persists them best-effort; it always exits 0 so a capture hiccup can never disrupt the session. Mirrored by the .claude/settings.json fallback that `backthread install` writes for the bare-npx (non-plugin) path. We register ONLY SessionEnd (once per session) on purpose — `runCapture` also handles a Stop payload, but Stop fires on every turn-end, which would capture far too aggressively, so Stop is intentionally NOT registered here.",
3
+ "hooks": {
4
+ "SessionEnd": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "npx backthread capture"
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "backthread",
3
+ "version": "0.1.0",
4
+ "description": "Backthread CLI — capture the *why* of your AI-coded changes from your Claude Code sessions, and query your codebase's architectural memory without leaving the terminal. Source code and tool I/O are redacted locally before anything leaves your machine.",
5
+ "license": "MIT",
6
+ "author": "Backthread",
7
+ "homepage": "https://backthread.dev",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/backthread/backthread.git",
11
+ "directory": "cli"
12
+ },
13
+ "bugs": "https://github.com/backthread/backthread/issues",
14
+ "keywords": [
15
+ "claude-code",
16
+ "ai",
17
+ "architecture",
18
+ "codebase",
19
+ "documentation",
20
+ "backthread",
21
+ "cli",
22
+ "mcp"
23
+ ],
24
+ "type": "module",
25
+ "comment": "PUBLISHED BIN = the self-contained esbuild bundle (dist-bundle/backthread.js), NOT the tsc dist/. Reason: @backthread/redact ships SOURCE-ONLY (.ts), and Node refuses to strip types for files inside node_modules — so a registry install of the tsc dist/ would fail to load redact at runtime. The bundle inlines redact (and the MCP SDK), so the published CLI has ZERO runtime dependencies and `npx backthread` stays fast and robust. Dev/test resolve @backthread/redact via the workspace symlink (realpath escapes node_modules → stripping applies).",
26
+ "bin": {
27
+ "backthread": "./dist-bundle/backthread.js"
28
+ },
29
+ "files": [
30
+ "dist-bundle",
31
+ "commands",
32
+ "hooks",
33
+ ".claude-plugin",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "scripts": {
38
+ "build": "tsc -p tsconfig.json",
39
+ "bundle": "node esbuild.config.mjs",
40
+ "prepack": "npm run build && npm run bundle",
41
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
42
+ "start": "tsx src/bin/backthread.ts",
43
+ "smoke": "npm run bundle && node dist-bundle/backthread.js help > /dev/null",
44
+ "test": "node --import tsx --test --test-force-exit src/*.test.ts && npm run build && npm run smoke"
45
+ },
46
+ "engines": {
47
+ "node": ">=22.18"
48
+ },
49
+ "devDependencies": {
50
+ "@backthread/redact": "^0.1.0",
51
+ "@modelcontextprotocol/sdk": "^1.29.0",
52
+ "@types/node": "^22.19.19",
53
+ "esbuild": "^0.28.0",
54
+ "tsx": "^4.22.3",
55
+ "typescript": "^5.6.2"
56
+ }
57
+ }