Skip to main content

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

Project description

claude-session-status

Tracks whether Claude Code sessions are warm (actively running) or cold (ended) in a dedicated DuckDB file.

Problem

When you run Claude Code across multiple projects and terminals, there's no built-in way to see which sessions are still active. You end up switching between terminals, checking for running processes, or losing track of what's open. This package gives you a live view — one command shows every session and whether it's currently running or has ended.

What warm/cold means

Status When set Meaning
warm SessionStart hook fires Claude Code is actively running in this project
cold SessionEnd hook fires Session ended (Claude Code exited or was interrupted)

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.2.tar.gz (4.0 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.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: claude_session_status-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 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.2.tar.gz
Algorithm Hash digest
SHA256 70e95a1c226d94a8566129d53ead6f300c31dd8803632c9aad3482cdbd4d1fb9
MD5 9327e5549fb7eaeeb41af2049c1e85da
BLAKE2b-256 a6927faebe5ea2f1df75b91fd4f9cf20cfa9413e77ba54e12ced33fb6686326a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for claude_session_status-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f5bf05dcbc1e6d0c6f01fb468f02fce7c7e85ff27429b1a2aec50a6860a3ced7
MD5 d00883a49dc4bf8575da8278d5f3a272
BLAKE2b-256 27d6ae11d2132ee43359d34bb4be981a283c18db1982a601bcf50d989a667f9f

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