Repository Analysis

thedotmack/claude-mem

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

1.9 Likely human-written View on GitHub
1.9
Adjusted Score
1.9
Raw Score
100%
Time Factor
2026-05-29
Last Push
79,649
Stars
TypeScript
Language
158,846
Lines of Code
762
Files
269
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 5MEDIUM 1LOW 263

Pattern Findings

269 matches across 9 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers221 hits · 230 pts
SeverityFileLineSnippet
LOWevals/swebench/run-batch.py49def extract_oauth_credentials() -> Path | None:
LOWevals/swebench/summarize.py13def load_expected_instance_ids(predictions_path: Path) -> list[str]:
LOWopenclaw/src/index.ts649 function shouldSkipDuplicatePromptInit(contentSessionId: string, project: string, prompt: string): boolean {
LOWplans/05-observer-tool-enforcement.md347 export function recordObserverToolAttempt(attempt: ObserverToolAttempt): void {
LOWplans/06-worker-env-isolation.md293function classifyClaudeProviderError(input: { cause: unknown }): ClassifiedProviderError {
LOWplans/2026-04-30-onboarding-ux-overhaul.md206 export function getFirstObservationCreatedAt(db: SessionStore): string | null {
LOWplans/2026-04-29-installer-streamline.md65export async function installPluginDependencies(targetDir: string, bunPath: string): Promise<void>;
LOWplans/02-spawn-contract-templating.md300export function getWorkerServiceAbsolutePath(): string;
LOWplans/02-spawn-contract-templating.md303export function getVersionCheckAbsolutePath(): string; // for completeness; currently unused by installers
LOWplans/02-spawn-contract-templating.md304export function getPluginRootAbsolutePath(): string; // returns the plugin root used by the helpers above
LOWplans/04-installer-transparency.md370async function runNpmInstallInMarketplace(summary: InstallSummary): Promise<void> {
LOWtests/install-non-tty.test.ts213 expect(codexInstallerSource).toContain('function removeCodexAgentsMdContext(): boolean');
LOWtests/install-non-tty.test.ts214 expect(codexInstallerSource).toContain('function disableCodexTranscriptAgentsContext(): boolean');
LOWtests/claude-provider-resume.test.ts4 function shouldPassResumeParameter(session: {
LOWtests/context/observation-compiler.test.ts24function createTestSummaryTimelineItem(overrides: Partial<SummaryTimelineItem> = {}): SummaryTimelineItem {
LOWtests/sqlite/data-integrity.test.ts30function createSessionWithMemoryId(db: Database, contentSessionId: string, memorySessionId: string, project: string = 't
LOWtests/sqlite/transactions.test.ts55 function createSessionWithMemoryId(contentSessionId: string, memorySessionId: string, project: string = 'test-project'
LOWtests/sqlite/observations.test.ts42 function createSessionWithMemoryId(contentSessionId: string, memorySessionId: string, project: string = 'test-project'
LOWtests/sqlite/summaries.test.ts38 function createSessionWithMemoryId(contentSessionId: string, memorySessionId: string, project: string = 'test-project'
LOWtests/storage/postgres/postgres-storage.test.ts823async function createFixtureScopeWithEventJob(storage: PostgresStorageRepositories) {
LOW…/worker/http/routes/search-routes-welcome-hint.test.ts34function captureContextInjectHandler(routes: SearchRoutes): (req: Request, res: Response) => void {
LOW…es/sqlite/observations-by-file-path-candidates.test.ts24 function seedObservationWithReadPath(readPath: string, sessionSuffix: string): number {
LOW…vices/sqlite/observations/store-subagent-label.test.ts36 function createSessionWithMemoryId(
LOWplugin/scripts/bun-runner.js63function isPluginDisabledInClaudeSettings() {
LOWscripts/regenerate-claude-md.ts91function walkDirectoriesWithIgnore(dir: string, folders: Set<string>, depth: number = 0): void {
LOWscripts/regenerate-claude-md.ts193function formatObservationsForClaudeMd(observations: ObservationRow[], folderPath: string): string {
LOWscripts/regenerate-claude-md.ts240function writeClaudeMdToFolderForRegenerate(folderPath: string, newContent: string): void {
LOWscripts/regenerate-claude-md.ts261function cleanupAutoGeneratedFiles(workingDir: string, dryRun: boolean): void {
LOWscripts/build-hooks.js127async function verifyShellTemplateCanonical() {
LOWscripts/translate-readme/examples.ts4async function translateToCommonLanguages(): Promise<void> {
LOWsrc/ui/viewer/components/WelcomeCard.tsx11export function getStoredWelcomeDismissed(): boolean {
LOWsrc/ui/viewer/components/WelcomeCard.tsx20export function setStoredWelcomeDismissed(dismissed: boolean): void {
LOWsrc/server/middleware/postgres-auth.ts29export function requirePostgresServerAuth(
LOWsrc/server/middleware/postgres-auth.ts192function hasForwardedClientHeaders(req: Request): boolean {
LOWsrc/server/middleware/auth.ts118function hasForwardedClientHeaders(req: Request): boolean {
LOWsrc/server/auth/sqlite-api-key-service.ts98export function verifyRawKeyAgainstStoredHash(rawKey: string, storedHash: string): boolean {
LOWsrc/server/auth/sqlite-api-key-service.ts125export function upgradeLegacyKeyHashIfNeeded(
LOWsrc/server/auth/sqlite-api-key-service.ts141export function migrateServerApiKeyScopes(
LOWsrc/server/runtime/SessionGenerationPolicy.ts43export function resolveSessionGenerationPolicy(
LOWsrc/server/runtime/SessionGenerationPolicy.ts83export function buildEnqueueEventDecision(
LOWsrc/server/runtime/SessionGenerationPolicy.ts146export async function scheduleDebouncedEventJob(
LOWsrc/server/runtime/ServerSessionRuntimeRepository.ts159export function createServerSessionRuntimeRepository(
LOWsrc/server/runtime/ServerBetaService.ts449export function assertServerRuntimeForCli(
LOWsrc/server/runtime/ServerBetaService.ts622export async function migrateServerBetaApiKeyScopes(argv: string[]): Promise<void> {
LOWsrc/server/runtime/ServerBetaService.ts666export function serializeActiveServerKeyRow(row: ServerKeyRow): Record<string, unknown> {
LOWsrc/server/runtime/ServerBetaService.ts827export async function runServerBetaGenerationWorker(): Promise<void> {
LOWsrc/server/runtime/ServerBetaService.ts915function readServerBetaRuntimeState(): ServerBetaRuntimeState | null {
LOWsrc/server/runtime/create-server-beta-service.ts216function buildGenerationWorkerManager(
LOWsrc/server/runtime/create-server-beta-service.ts239function buildServerGenerationProviderFromEnv(): ServerGenerationProvider | null {
LOWsrc/server/queue/redis-config.ts22export function getObservationQueueEngineName(): ObservationQueueEngineName {
LOWsrc/server/jobs/types.ts147export function assertServerGenerationJobPayload(
LOWsrc/server/routes/v1/ServerV1PostgresRoutes.ts1475function parseGenericJobListingQuery(req: Request): {
LOWsrc/server/routes/v1/ServerV1PostgresRoutes.ts1719function serializeObservationWithSource(row: ObservationWithSourceRow): Record<string, unknown> {
LOWsrc/server/routes/v1/ServerV1PostgresRoutes.ts1762function serializeJobStatusResponse(
LOWsrc/server/routes/v1/ServerV1PostgresRoutes.ts1780function serializeGenerationJobStatus(
LOWsrc/server/generation/processGeneratedResponse.ts332export async function processSessionSummaryResponse(
LOW…rver/generation/providers/ClaudeObservationProvider.ts166export function classifyClaudeServerError(input: ClassifyInput): ServerClassifiedProviderError {
LOW…er/generation/providers/shared/error-classification.ts77export function classifyHttpProviderError(input: ClassifyHttpInput): ServerClassifiedProviderError {
LOW…c/server/generation/providers/shared/prompt-builder.ts42export function buildServerGenerationPrompt(
LOW…c/server/generation/providers/shared/prompt-builder.ts141function buildObservationOutputSchema(mode: ModeConfig | { observation_types: ReadonlyArray<Pick<ObservationType, 'id'>>
161 more matches not shown…
Over-Commented Block32 hits · 32 pts
SeverityFileLineSnippet
LOWdocker-compose.yml1# Phase 10 — server-beta deployable runtime.
LOWdocker-compose.yml21# CLAUDE_MEM_RUNTIME=server-beta
LOWdocker-compose.yml41# server/worker containers (see the commented `secrets:` blocks below) instead
LOWplans/01-hook-io-discipline.md181// third-party libraries don't leak into model context. The buffer is FLUSHED
LOWplans/01-hook-io-discipline.md421// IO discipline: this case is the entry point to the hook execution path.
LOWtests/env-isolation.test.ts141 // .env, which does not exist in this test).
LOWtests/server/server-runtime-smoke.test.ts1// SPDX-License-Identifier: Apache-2.0
LOWtests/worker/poison-respawn.test.ts1import { describe, it, expect, mock, beforeEach, afterEach, afterAll, spyOn } from 'bun:test';
LOWtests/infrastructure/process-manager.test.ts381 expect(captureProcessStartToken(NaN)).toBeNull();
LOWtests/servers/mcp-server-name-safety.test.ts1// #2473 — Plugin MCP server tools were never surfaced to the assistant because
LOWscripts/check-postinstall-allowlist.js1#!/usr/bin/env node
LOWscripts/e2e-server-beta-docker.sh1#!/usr/bin/env bash
LOWscripts/build-hooks.js281 // better-auth (~3.7MB) is only reachable through BetterAuthRoutes' request-time
LOWsrc/server/compat/SessionsObservationsAdapter.ts1// SPDX-License-Identifier: Apache-2.0
LOWsrc/server/compat/SessionsSummarizeAdapter.ts1// SPDX-License-Identifier: Apache-2.0
LOWsrc/server/auth/sqlite-api-key-service.ts41// against the routes the local runtime mounts, while NOT granting the `*`
LOWsrc/server/runtime/SessionGenerationPolicy.ts21// the window, replace the delayed job (deterministic
LOWsrc/server/runtime/ServerViewerRoutes.ts1// SPDX-License-Identifier: Apache-2.0
LOWsrc/server/runtime/create-server-beta-service.ts41 // Phase 10: skip env validation (tests). Production code paths always run
LOWsrc/server/jobs/ServerJobQueue.ts21// ServerJobQueue is a thin wrapper around the BullMQ Queue + Worker pair for
LOWsrc/server/generation/processGeneratedResponse.ts21import { stripTags } from '../../utils/tag-stripping.js';
LOWsrc/server/generation/ProviderObservationGenerator.ts41// 1. Reload the Postgres outbox row and the source agent_events row.
LOW…c/server/generation/providers/shared/prompt-builder.ts21// Build a single-shot generation prompt from a list of AgentEvent records
LOWsrc/shared/EnvManager.ts21export const ENV_FILE_PATH = envFilePath();
LOWsrc/npx-cli/commands/server-jobs.ts1// SPDX-License-Identifier: Apache-2.0
LOWsrc/npx-cli/commands/server-runtime-setup.ts1// SPDX-License-Identifier: Apache-2.0
LOWsrc/services/hooks/server-beta-client.ts1// SPDX-License-Identifier: Apache-2.0
LOWsrc/services/hooks/server-beta-bootstrap.ts1// SPDX-License-Identifier: Apache-2.0
LOWsrc/services/hooks/runtime-selector.ts1// SPDX-License-Identifier: Apache-2.0
LOWsrc/services/sync/ChromaMcpManager.ts21const DEFAULT_CHROMA_DATA_DIR = paths.chroma();
LOWsrc/services/sync/ChromaMcpManager.ts701 return;
LOWsrc/services/sync/ChromaSync.ts621 obsByDocCount.push({ obs, docs });
Synthetic Comment Markers3 hits · 18 pts
SeverityFileLineSnippet
HIGH.claude/reports/test-audit-2026-01-05.md290*Report generated by Claude Code (Opus 4.5) on 2026-01-05*
HIGHdocs/context/cursor-hooks-reference.md217| [Semgrep](https://semgrep.dev/blog/2025/cursor-hooks-mcp-server) | Automatically scan AI-generated code for vulnerabil
HIGHsrc/cli/claude-md-commands.ts191 lines.push('<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->');
Magic Placeholder Names2 hits · 10 pts
SeverityFileLineSnippet
HIGHcursor-hooks/QUICKSTART.md40claude-mem settings set CLAUDE_MEM_GEMINI_API_KEY your-api-key
HIGHcursor-hooks/QUICKSTART.md44claude-mem settings set CLAUDE_MEM_OPENROUTER_API_KEY your-api-key
Excessive Try-Catch Wrapping3 hits · 3 pts
SeverityFileLineSnippet
LOWevals/swebench/run-batch.py357 except Exception as exc:
LOWevals/swebench/run-batch.py485 except Exception as exc:
LOWopenclaw/install.sh249except Exception:
Deep Nesting3 hits · 3 pts
SeverityFileLineSnippet
LOWevals/swebench/run-batch.py235
LOWevals/swebench/run-batch.py378
LOWevals/swebench/summarize.py40
Redundant / Tautological Comments3 hits · 3 pts
SeverityFileLineSnippet
LOWsrc/services/integrations/CursorHooksInstaller.ts554 claude-mem cursor status # Check if hooks are installed
LOWsrc/services/integrations/GeminiCliHooksInstaller.ts382 claude-mem gemini-cli status # Check if installed
LOWsrc/services/integrations/WindsurfHooksInstaller.ts450 claude-mem windsurf status # Check if hooks are installed
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippet
MEDIUMplugin/ui/viewer-bundle.js9`).replace(My,"")}function f0(e,t){return t=bd(t),bd(e)===t}function ee(e,t,l,n,a,u){switch(l){case"children":typeof n==
Unused Imports1 hit · 1 pts
SeverityFileLineSnippet
LOWevals/swebench/run-batch.py21