The Points project uses a custom session management system that allows multiple parallel development sessions using Git worktrees, tmux, and Claude Code. Each session gets its own isolated environment with dedicated ports and persistent Claude conversations.
Location: /Users/rasca/Dev/tally/session-mgmt
This is the main management script with the following commands:
./session-mgmt add <name>- Creates a new session with worktree, branch, and tmux windows./session-mgmt remove <name>- Removes a session completely (worktree, branch, tmux)./session-mgmt resume [name]- Resumes session(s) after system restart./session-mgmt list- Shows all active sessions with their ports
Each session consists of:
- Git Worktree: Located at
~/Dev/tally-<name>/ - Git Branch: Named exactly as the session (e.g.,
feature-auth, notsession-feature-auth) - Tmux Session: Named
tally-<name>with 5 windows:backend:<port>- Django server running on the specified portfrontend:<port>- Svelte dev server running on the specified portclaude- Claude Code session running in worktree rootshell- Interactive shell with environment activated and readycli- Command line ready for one-off commands (env activated, not executed)
- Backend ports start at 8000 and increment (8001, 8002, etc.)
- Frontend ports start at 5000 and increment (5001, 5002, etc.)
- Port assignments are tracked in
.tally-sessionsfile to avoid conflicts - The script automatically finds the next available ports when creating new sessions
Location: /Users/rasca/Dev/tally/.tally-sessions
JSON file tracking all sessions:
{
"session-name": {
"backend_port": 8000,
"frontend_port": 5000,
"worktree": "/Users/rasca/Dev/tally-session-name",
"branch": "session-name"
}
}When creating a new session, the script automatically:
frontend/node_modules→ symlinked to main project's node_modules (avoids reinstalling)
backend/db.sqlite3→ copied from main project (independent database per session)backend/.env- Copied from main project (contains SECRET_KEY and other env vars)frontend/.env- Copied from main project and updated with session-specific backend URL- Automatically sets
VITE_API_URL=http://localhost:<backend_port>for proper API routing
- Automatically sets
- Each Claude session uses a persistent name:
tally-<session-name> - When resuming: uses
--resumeflag to continue previous conversation - Working directory is set to the worktree root
All commands use workon tally to activate the Python virtual environment before executing
Claude Code stores tool permissions in ~/.claude.json under the projects section:
{
"projects": {
"/Users/rasca/Dev/tally": {
"allowedTools": [
"Bash(npm install:*)",
"Bash(python manage.py:*)",
// ... other allowed tools
]
}
}
}Currently, each new worktree is treated as a separate project by Claude Code, so permissions need to be set up for each worktree. The script should copy the allowedTools array from the main project to each new worktree project in ~/.claude.json.
./tally-session add feature-payment
tmux attach -t tally-feature-payment
# Work on your feature across backend, frontend, and Claude windows# Resume all sessions
./tally-session resume
# Or resume specific session
./tally-session resume feature-payment./tally-session remove feature-payment
# This removes the worktree, branch, and kills the tmux sessionIf you get "port already in use" errors:
- Check
.tally-sessionsfile for port assignments - Make sure the script's port allocation is working correctly
- Kill any orphaned processes using
lsof -i :PORT | grep LISTEN
If backend or frontend fail to start:
- Check that
.envfiles were copied correctly - Verify symlinks are intact (node_modules, db.sqlite3)
- Ensure virtual environment is activated (
workon tally)
- Session names follow pattern:
tally-<session-name> - Use
--resumeflag to continue previous conversations - Each worktree needs its own tool permissions in
~/.claude.json
When working with this system:
- Always use the worktree path - Each session runs in its own worktree at
~/Dev/tally-<name>/ - Port awareness - Check
.tally-sessionsfor assigned ports before suggesting localhost URLs - Virtual environment - All Python commands need
workon tallyfirst - Independent databases - Each session has its own database copy, changes don't affect other sessions
- Shared node_modules - Node modules are symlinked to save space (read-only, shared)
- Git operations - Each worktree has its own branch; commits don't affect other sessions
- Tool permissions - New worktrees may need permission setup if not inherited from main project
- Frontend API URL - Each session's frontend automatically points to its own backend port
~/Dev/
├── tally/ # Main repository
│ ├── backend/
│ │ ├── .env # Original env file
│ │ └── db.sqlite3 # Original database
│ ├── frontend/
│ │ ├── .env # Original env file
│ │ └── node_modules/ # Original node modules
│ ├── tally-session # Management script
│ └── .tally-sessions # Session tracking file
│
├── tally-feature-auth/ # Worktree for feature-auth session
│ ├── backend/
│ │ ├── .env # Copied from main
│ │ └── db.sqlite3 # Independent copy (not shared)
│ └── frontend/
│ ├── .env # Copied & updated with backend port
│ └── node_modules/ # Symlink to main (shared)
│
└── tally-bugfix-ui/ # Another worktree
└── ... # Same structure
Inside each tmux session, the windows and their states are:
- backend:: Running Django server -
python manage.py runserver <port> - frontend:: Running Svelte dev server -
npm run dev -- --port <port> - claude: Running Claude Code session -
claude tally-<name>(or with--resume) - shell: Interactive shell ready for use (environment activated, in worktree root)
- cli: Command line with environment ready but not executed (press Enter to run commands)
All windows have:
- Virtual environment activated:
workon tally - Working directory set:
cd ~/Dev/tally-<name>/[appropriate-dir]
The port numbers are shown in the window names for easy reference.