YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat: add @screenpipe/claude-code for simple Claude Code integration
Louis Beaumontaf57ba272384
diff --git a/README.md b/README.mdindex 6f18db696..7c6c96eb3 100644--- a/README.md+++ b/README.md@@ -100,42 +100,29 @@ or [download the desktop app](https://screenpi.pe)- ~15gb storage/month- works offline-## connect to ai agents+## use with claude code-give your ai agent (clawdbot, moltbot, etc.) access to your screen memory:+give claude code access to your screen history:```bash-# one-liner: full setup with daily morning summaries-bunx @screenpipe/agent --setup user@server --morning 08:00+npx @screenpipe/claude-code```-this sets up:-- permanent background sync (survives reboot)-- screenpipe skills (recall, search, digest, context)-- morning summary cron job+that's it. now ask claude:+- "what was i working on yesterday?"+- "find when i saw that error message"+- "search my screen for mentions of API"-your agent can now answer: "what was I working on yesterday?"+### what it does-### manual setup+1. checks screenpipe is running+2. adds screenpipe-mcp to claude code config+3. done - claude can now search your screen history-```bash-# just sync data-bunx @screenpipe/sync --daemon --remote user@server:~/.screenpipe/--# just install skills-bunx @screenpipe/skills install --remote user@server--# query directly via sqlite-sqlite3 ~/.screenpipe/db.sqlite "SELECT text FROM ocr_text WHERE text LIKE '%meeting%' LIMIT 10;"-```--### packages+### requirements-| package | description |-|---------|-------------|-| [@screenpipe/agent](https://www.npmjs.com/package/@screenpipe/agent) | one-liner full setup |-| [@screenpipe/sync](https://www.npmjs.com/package/@screenpipe/sync) | sync data to remote |-| [@screenpipe/skills](https://www.npmjs.com/package/@screenpipe/skills) | install agent skills |+- [screenpipe](https://screenpi.pe) running+- [claude code cli](https://docs.anthropic.com/en/docs/claude-code) installed---diff --git a/packages/claude-code/dist/index.js b/packages/claude-code/dist/index.jsnew file mode 100755index 000000000..f2d40182b--- /dev/null+++ b/packages/claude-code/dist/index.js@@ -0,0 +1,102 @@+#!/usr/bin/env bun+// @bun++// src/index.ts+import { existsSync, readFileSync, writeFileSync } from "fs";+import { homedir } from "os";+import { join } from "path";+import { execSync } from "child_process";+var CLAUDE_SETTINGS_PATH = join(homedir(), ".claude.json");+function checkScreenpipe() {+ try {+ const res = execSync("curl -s http://localhost:3030/health", {+ encoding: "utf-8",+ timeout: 5000+ });+ return res.includes("ok") || res.includes("healthy");+ } catch {+ return false;+ }+}+function checkClaudeCLI() {+ try {+ execSync("which claude", { stdio: "pipe" });+ return true;+ } catch {+ return false;+ }+}+function getSettings() {+ if (!existsSync(CLAUDE_SETTINGS_PATH)) {+ return null;+ }+ try {+ return JSON.parse(readFileSync(CLAUDE_SETTINGS_PATH, "utf-8"));+ } catch {+ return null;+ }+}+function saveSettings(settings) {+ writeFileSync(CLAUDE_SETTINGS_PATH, JSON.stringify(settings, null, 2));+}+function addMCPServer(settings) {+ if (!settings.mcpServers) {+ settings.mcpServers = {};+ }+ if (settings.mcpServers.screenpipe) {+ return false;+ }+ settings.mcpServers.screenpipe = {+ type: "stdio",+ command: "npx",+ args: ["-y", "screenpipe-mcp"],+ env: {}+ };+ return true;+}+function main() {+ console.log(`+\uD83D\uDD17 Setting up Screenpipe + Claude Code integration+`);+ console.log("[1/3] Checking Claude Code CLI...");+ if (!checkClaudeCLI()) {+ console.log(" \u2717 Claude Code CLI not found");+ console.log("");+ console.log(" Install it first:");+ console.log(" npm install -g @anthropic-ai/claude-code");+ console.log("");+ process.exit(1);+ }+ console.log(" \u2713 Claude Code CLI installed");+ console.log("[2/3] Checking Screenpipe...");+ if (!checkScreenpipe()) {+ console.log(" \u26A0 Screenpipe not running (will work once started)");+ } else {+ console.log(" \u2713 Screenpipe running");+ }+ console.log("[3/3] Adding screenpipe-mcp to Claude Code...");+ const settings = getSettings();+ if (!settings) {+ console.log(" \u2717 Claude Code settings not found at ~/.claude.json");+ console.log(" Run 'claude' once first to initialize settings");+ process.exit(1);+ }+ const added = addMCPServer(settings);+ if (!added) {+ console.log(" \u2713 Already configured!");+ } else {+ saveSettings(settings);+ console.log(" \u2713 Added screenpipe-mcp server");+ }+ console.log(`+\u2705 Done! Claude Code now has access to your screen history.+`);+ console.log(" Try asking Claude Code:");+ console.log(' \u2192 "What was I working on yesterday?"');+ console.log(' \u2192 "Find when I saw that error message"');+ console.log(' \u2192 "Search my screen for mentions of API"');+ console.log("");+ console.log(` Note: Restart Claude Code if it's currently running.+`);+}+main();diff --git a/packages/claude-code/package.json b/packages/claude-code/package.jsonnew file mode 100644index 000000000..b27056cc8--- /dev/null+++ b/packages/claude-code/package.json@@ -0,0 +1,35 @@+{+ "name": "@screenpipe/claude-code",+ "version": "0.1.0",+ "description": "One command to give Claude Code access to your screen history",+ "type": "module",+ "bin": {+ "screenpipe-claude-code": "dist/index.js"+ },+ "scripts": {+ "build": "bun build src/index.ts --outdir dist --target node",+ "dev": "bun run src/index.ts",+ "prepublishOnly": "bun run build"+ },+ "files": [+ "dist"+ ],+ "keywords": [+ "screenpipe",+ "claude-code",+ "mcp",+ "screen-recording",+ "memory"+ ],+ "author": "Louis Beaumont <[email protected]>",+ "license": "MIT",+ "repository": {+ "type": "git",+ "url": "https://github.com/mediar-ai/screenpipe",+ "directory": "packages/claude-code"+ },+ "devDependencies": {+ "@types/bun": "latest",+ "typescript": "^5.0.0"+ }+}diff --git a/packages/claude-code/src/index.ts b/packages/claude-code/src/index.tsnew file mode 100644index 000000000..7b04d59da--- /dev/null+++ b/packages/claude-code/src/index.ts@@ -0,0 +1,122 @@+#!/usr/bin/env bun+/**+ * @screenpipe/claude-code - One command to give Claude Code access to your screen history+ *+ * Usage:+ * bunx @screenpipe/claude-code+ */++import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";+import { homedir } from "os";+import { join } from "path";+import { execSync } from "child_process";++const CLAUDE_SETTINGS_PATH = join(homedir(), ".claude.json");++function checkScreenpipe(): boolean {+ try {+ const res = execSync("curl -s http://localhost:3030/health", {+ encoding: "utf-8",+ timeout: 5000,+ });+ return res.includes("ok") || res.includes("healthy");+ } catch {+ return false;+ }+}++function checkClaudeCLI(): boolean {+ try {+ execSync("which claude", { stdio: "pipe" });+ return true;+ } catch {+ return false;+ }+}++function getSettings(): any {+ if (!existsSync(CLAUDE_SETTINGS_PATH)) {+ return null;+ }+ try {+ return JSON.parse(readFileSync(CLAUDE_SETTINGS_PATH, "utf-8"));+ } catch {+ return null;+ }+}++function saveSettings(settings: any): void {+ writeFileSync(CLAUDE_SETTINGS_PATH, JSON.stringify(settings, null, 2));+}++function addMCPServer(settings: any): boolean {+ // Add to global mcpServers+ if (!settings.mcpServers) {+ settings.mcpServers = {};+ }++ if (settings.mcpServers.screenpipe) {+ return false; // Already configured+ }++ settings.mcpServers.screenpipe = {+ type: "stdio",+ command: "npx",+ args: ["-y", "screenpipe-mcp"],+ env: {},+ };++ return true;+}++function main() {+ console.log("\nπ Setting up Screenpipe + Claude Code integration\n");++ // Step 1: Check Claude CLI+ console.log("[1/3] Checking Claude Code CLI...");+ if (!checkClaudeCLI()) {+ console.log(" β Claude Code CLI not found");+ console.log("");+ console.log(" Install it first:");+ console.log(" npm install -g @anthropic-ai/claude-code");+ console.log("");+ process.exit(1);+ }+ console.log(" β Claude Code CLI installed");++ // Step 2: Check Screenpipe+ console.log("[2/3] Checking Screenpipe...");+ if (!checkScreenpipe()) {+ console.log(" β Screenpipe not running (will work once started)");+ } else {+ console.log(" β Screenpipe running");+ }++ // Step 3: Add MCP config+ console.log("[3/3] Adding screenpipe-mcp to Claude Code...");+ const settings = getSettings();+ if (!settings) {+ console.log(" β Claude Code settings not found at ~/.claude.json");+ console.log(" Run 'claude' once first to initialize settings");+ process.exit(1);+ }++ const added = addMCPServer(settings);+ if (!added) {+ console.log(" β Already configured!");+ } else {+ saveSettings(settings);+ console.log(" β Added screenpipe-mcp server");+ }++ // Done+ console.log("\nβ Done! Claude Code now has access to your screen history.\n");+ console.log(" Try asking Claude Code:");+ console.log(' β "What was I working on yesterday?"');+ console.log(' β "Find when I saw that error message"');+ console.log(' β "Search my screen for mentions of API"');+ console.log("");+ console.log(" Note: Restart Claude Code if it's currently running.\n");+}++main();diff --git a/packages/claude-code/tsconfig.json b/packages/claude-code/tsconfig.jsonnew file mode 100644index 000000000..021397787--- /dev/null+++ b/packages/claude-code/tsconfig.json@@ -0,0 +1,14 @@+{+ "compilerOptions": {+ "target": "ES2022",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "esModuleInterop": true,+ "strict": true,+ "skipLibCheck": true,+ "outDir": "dist",+ "declaration": true,+ "types": ["bun-types"]+ },+ "include": ["src/**/*"]+}