Skip to main content

Smart screen session manager with auto-naming, env detection, and Claude Code support

Project description

Smriti

Smart GNU Screen session manager with auto-naming, conda/venv detection, and Claude Code integration.

Install

pip install -e .

Requires GNU Screen (apt install screen / brew install screen).

Quick Start

sm                        # Create session in current dir (default)
sm c --tag dev            # Create with custom tag
sm l                      # List all sessions
sm ld                     # List sessions in current directory
sm r                      # Reattach (interactive picker, all sessions)
sm a                      # Auto-connect to latest globally (or create)
sm a --target vajra       # Auto-connect to session matching "vajra"
sm ad                     # Auto-connect to latest in current dir (or create)
sm k                      # Kill latest session in current dir

Commands

Regular Sessions

Command Alias Scope Description
create c dir Create a new session (default command)
auto a global Auto-connect to latest session globally, or create. --target for substring match.
auto-dir ad dir Auto-connect to latest in current dir, or create
reattach r global List all sessions, interactive picker
list l global List all sessions
list-dir ld dir List sessions in current directory
kill k dir Kill latest session in current directory
kill-all ka dir Kill all sessions in current directory
kill-latest kl global Kill latest session (any directory)

Claude Code Sessions

Command Alias Scope Description
claude cc dir Launch Claude Code in a session
claude-auto cca global Auto-connect to latest CC session globally, or create
claude-auto-dir ccad dir Auto-connect to latest CC in current dir, or create
claude-reattach ccr global List all CC sessions, interactive picker
claude-list ccl global List all Claude Code sessions
claude-list-dir ccld dir List CC sessions in current directory
claude-kill cck dir Kill latest CC session in current directory
claude-kill-all ccka dir Kill all CC sessions in current directory

Utility

Command Alias Description
env e Show detected environment info

Session Naming

Sessions follow the format: <hostname>-<dirname>-<hash>-<tag>-<YYYYMMDD-HHMMSS>

gpu01-vajra-a3f1-session-20260212-143022
gpu01-vajra-a3f1-dev-20260212-150000
gpu01-vajra-a3f1-cc-20260212-160000
  • hostname: short hostname of the machine
  • dirname: current directory basename (truncated to 30 chars)
  • hash: 4-char SHA1 hash of the full path (disambiguates same-name dirs)
  • tag: session purpose (session, dev, cc, etc.)
  • timestamp: creation time for chronological sorting

Directory-specific commands (ld, k, ka) match on <hostname>-<dirname>-<hash>- so they only operate on sessions created from the current directory.

Directory-Scoped Commands

Smriti tracks which directory a session was created in via the naming convention. This enables powerful directory-scoped operations:

# In ~/projects/vajra
cd ~/projects/vajra
sm c --tag dev            # Creates: gpu01-vajra-a3f1-dev-20260214-100000
sm c --tag train          # Creates: gpu01-vajra-a3f1-train-20260214-100500
sm cc                     # Creates: gpu01-vajra-a3f1-cc-20260214-101000

# In ~/projects/niti
cd ~/projects/niti
sm c                      # Creates: gpu01-niti-b7c2-session-20260214-110000

# Directory-scoped listing — only shows vajra sessions
cd ~/projects/vajra
sm ld                     # Shows: dev, train (not cc, not niti sessions)

# Directory-scoped kill
sm k                      # Kills latest vajra session (train)
sm ka                     # Kills all vajra sessions (dev + train)

# Global listing — shows everything
sm l                      # Shows all sessions across all directories

Global vs Directory Scope

Commands come in global and dir-scoped variants:

  • auto (sm a) connects to the latest session globally across all directories.
  • auto-dir (sm ad) connects to the latest session in the current directory only.
  • reattach (sm r) lists all sessions for interactive picking.

The same pattern applies to Claude Code commands (cca vs ccad, ccl vs ccld).

Conda / Venv Detection

Smriti auto-detects and activates Python environments when creating sessions. Detection priority:

  1. Local directories — checks env/, .env/, venv/, .venv/, conda_env/, etc. for bin/python
  2. YAML files — parses environment.yml, conda.yml etc. for name: field
  3. Meta files — reads .conda_env, .conda-env, .python-version
sm e                      # Show what environment smriti detects
sm c                      # Auto-activates detected env in the session
sm c --no_conda           # Skip env detection

Claude Code Integration

Launch Claude Code in managed screen sessions with environment auto-activation:

sm cc                     # Launch Claude Code
sm cc --args "--resume"   # Pass extra args to claude
sm cc --config_dir ~/.sclaude   # Use alternate config dir
sm cca                    # Auto-connect to latest CC session globally (or create)
sm ccad                   # Auto-connect to latest CC in current dir (or create)
sm ccl                    # List all Claude Code sessions
sm ccld                   # List CC sessions in current dir
sm ccr                    # Reattach to a CC session (interactive picker)
sm cck                    # Kill latest CC session in current dir
sm ccka                   # Kill all CC sessions in current dir

Global Flags

All commands accept:

Flag Description
--no_conda Skip conda/venv auto-activation
-V, --version Show version
--help Show help

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

smriti-0.0.1.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

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

smriti-0.0.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file smriti-0.0.1.tar.gz.

File metadata

  • Download URL: smriti-0.0.1.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for smriti-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7e2f046c7c3d727a00e31e9fdb62da8a1a6289de031b087569c74569f32d9cf9
MD5 bb463437c209190cff2c2fa917c667d7
BLAKE2b-256 4a9d17cbdb02a1bc3850e8de02a843a9fc3f34bcf493f406d66d956322e35b7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for smriti-0.0.1.tar.gz:

Publisher: publish.yml on project-vajra/smriti

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smriti-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: smriti-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for smriti-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff92e82eba3761bccedba49eb9f966d8bd7f45f49e86a4fe2708ab9cf5bcb7a4
MD5 b765b5e62191aedf39806e8081155a48
BLAKE2b-256 c6198994fb4947887981dafd03f35ac5cd076ac8313df1ca2ef165e449f98017

See more details on using hashes here.

Provenance

The following attestation bundles were made for smriti-0.0.1-py3-none-any.whl:

Publisher: publish.yml on project-vajra/smriti

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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