Skip to content

Feature request: env var(s) to configure storage directory(ies) #473

Description

@binhex

Currently context-mode stores data in platform-specific directories under ~/.{platform}/context-mode/ (e.g. ~/.pi/, ~/.claude/), split across two locations:

  • Session events → adapter-detected platform dir
  • Content index (FTS5 BM25) → always ~/.claude/context-mode/content/
  • Session stats → ~/.claude/context-mode/sessions/

For users running non-native harnesses (e.g. Oh My Pi/OMP which shares the Pi adapter path), or users who want all context-mode data in a single custom directory, there is currently no way to redirect storage.

Request: Add one or more environment variables to override storage paths.

Preferred approach — single root env var:

CONTEXT_MODE_DIR=~/.omp/context-mode

This would redirect all three (session events DB, content index, session stats) under that root. Falls back to the current platform-detected path when unset.

Alternative — individual overrides:

  • CONTEXT_MODE_SESSION_DIR — session events database
  • CONTEXT_MODE_CONTENT_DIR — BM25 FTS5 content index
  • CONTEXT_MODE_STATS_DIR — process-level stats JSON files

This would allow OMP, Pi, Claude Code, and other harnesses to coexist without sharing or conflicting over storage directories.

Happy to submit a PR if this direction is agreeable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions