Skip to main content

Track warm/cold status of Claude Code sessions in a dedicated DuckDB file

Project description

claude-session-status

Tracks warm/cold status of Claude Code sessions in a dedicated DuckDB file — separate from claude-session-logger to avoid file-lock conflicts.

Why

claude-session-logger writes to sessions.duckdb at session end. If a TUI holds a persistent read-only connection to that file, the write blocks. This package uses its own DB (~/.claude/claude-session-status/status.duckdb) and never holds an open connection between operations.

Install

pip install claude-session-status

Hook integration

Add to ~/.claude/settings.json:

{
  "hooks": {
    "SessionStart": [
      {"type": "command", "command": "claude-session-status mark-warm"}
    ],
    "SessionEnd": [
      {"type": "command", "command": "claude-session-status mark-cold"}
    ]
  }
}

Claude Code pipes session JSON to stdin; the scripts extract session_id, project, and cwd automatically.

Commands

# Live-refresh table of warm/cold sessions (Ctrl-C to quit)
claude-session-status watch

# Called by hooks (reads JSON from stdin)
claude-session-status mark-warm
claude-session-status mark-cold

DB schema

CREATE TABLE session_status (
    session_id TEXT PRIMARY KEY,
    project    TEXT,
    cwd        TEXT,
    started_at TIMESTAMP,
    updated_at TIMESTAMP,
    status     TEXT  -- 'warm' | 'cold'
)

DB location: ~/.claude/claude-session-status/status.duckdb

Design

  • Runtime dependency: duckdb only
  • Every DB access: open → read/write → close. No persistent connections.
  • mark-warm / mark-cold: silent on success, errors go to stderr (never block Claude Code)
  • 3-retry lock backoff on connect

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_session_status-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_session_status-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file claude_session_status-0.1.0.tar.gz.

File metadata

  • Download URL: claude_session_status-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for claude_session_status-0.1.0.tar.gz
Algorithm Hash digest
SHA256 62f5d9e5cde141deb38805c9697924de533f90ed5d35d6fcd4199cd21e69f470
MD5 c9e93e44fdd841ce1bfe854eac41490a
BLAKE2b-256 abfa1729664dc0ccf6312d45b206a1af2ad84a31879dfe014626c4538864b67a

See more details on using hashes here.

File details

Details for the file claude_session_status-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_session_status-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08903afd5e6cf35914f71d7712277a883bde2734c4974edfd76d377f895491dc
MD5 7195fc23e4841d48fb559c64c5470933
BLAKE2b-256 55a08056725aa2a26ab8774e67f73dd5fe8c05527fc8ce3885499082924b7c1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page