ai-sessions 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .venv/
8
+ venv/
9
+ build/
10
+ dist/
11
+
12
+ # Never commit local provider conversations, credentials, or utility state.
13
+ .codex/
14
+ .claude/
15
+ .config/ai-sessions/
16
+ .cache/ai-sessions/
17
+ state.json
18
+ config.toml
19
+ *.sqlite
20
+ *.sqlite-shm
21
+ *.sqlite-wal
22
+ *.jsonl
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Andrew VanDyke
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,176 @@
1
+ Metadata-Version: 2.5
2
+ Name: ai-sessions
3
+ Version: 3.0.0
4
+ Summary: A friendly terminal browser for local Codex CLI and Claude Code sessions
5
+ Project-URL: Homepage, https://github.com/vandyand/ai-sessions
6
+ Project-URL: Repository, https://github.com/vandyand/ai-sessions
7
+ Project-URL: Issues, https://github.com/vandyand/ai-sessions/issues
8
+ Author-email: Andrew VanDyke <vandyand@gmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: claude-code,codex,sessions,terminal,tui
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console :: Curses
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: psutil>=5.9
24
+ Requires-Dist: windows-curses>=2.4.1; sys_platform == 'win32'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # ai-sessions
28
+
29
+ `ai-sessions` is a searchable terminal browser for local [Codex CLI](https://developers.openai.com/codex/cli/) and Claude Code conversations. It indexes each provider's existing on-disk history without modifying transcripts or provider databases.
30
+
31
+ It runs as `sessions` on Linux and native Windows PowerShell.
32
+
33
+ ## Features
34
+
35
+ - One navigable list for Codex and Claude sessions
36
+ - Search and filters for provider, directory, origin, open state, and visibility
37
+ - Human, cross-provider, and subagent/automation origin labels
38
+ - Started and updated timestamps plus user-message counts across compactions
39
+ - Utility-local rename and hide operations that never alter vendor data
40
+ - Detection of currently open sessions on Linux and Windows
41
+ - tmux pane and desktop-terminal focus on Linux when the environment exposes it
42
+ - Safe, dangerous, and custom launch profiles
43
+ - Native paths and argument handling on both operating systems
44
+
45
+ Windows Terminal does not expose a stable session-ID-to-tab interface. On Windows, open sessions are identified, but exact tab focusing is intentionally not attempted.
46
+
47
+ ## Requirements
48
+
49
+ - Python 3.11 or newer
50
+ - Codex CLI, Claude Code, or both
51
+ - Linux or native Windows PowerShell
52
+
53
+ The Windows-only `windows-curses` dependency is installed automatically. `psutil` is used for portable process inspection.
54
+
55
+ ## Install
56
+
57
+ From a checkout:
58
+
59
+ ```bash
60
+ python -m pip install .
61
+ sessions
62
+ ```
63
+
64
+ With `pipx`:
65
+
66
+ ```bash
67
+ pipx install .
68
+ sessions
69
+ ```
70
+
71
+ From PyPI:
72
+
73
+ ```bash
74
+ pipx install ai-sessions
75
+ ```
76
+
77
+ On Windows, `py -m pip` can be used in place of `python -m pip`.
78
+
79
+ ## Everyday use
80
+
81
+ Run `sessions`, navigate with the arrow keys or `j`/`k`, and press Enter to resume the selected conversation.
82
+
83
+ | Key | Action |
84
+ | --- | --- |
85
+ | `Ctrl-F` or `/` | Start search mode |
86
+ | `Tab` | Cycle provider filter |
87
+ | `o` | Cycle Human, Cross, Agent, and All origins |
88
+ | `v` | Cycle visible, hidden, and all sessions |
89
+ | `d` | Choose a directory |
90
+ | `s` | Cycle sort order |
91
+ | `p` | Cycle Safe, Dangerous, and Custom launch modes |
92
+ | `r` | Rename locally |
93
+ | `h` | Hide or restore locally |
94
+ | `Ctrl-R` | Refresh |
95
+ | `?` | Show complete help |
96
+
97
+ Useful noninteractive forms include:
98
+
99
+ ```bash
100
+ sessions --list --tool codex
101
+ sessions --list --query "is:open dir:my-project"
102
+ sessions --list --visibility hidden
103
+ sessions --resume SESSION_ID
104
+ sessions --resume SESSION_ID --dry-run
105
+ ```
106
+
107
+ ## Launch safety
108
+
109
+ The package defaults to `safe`. This leaves approval and sandbox behavior to each provider's normal configuration:
110
+
111
+ ```text
112
+ claude --resume SESSION_ID
113
+ codex resume SESSION_ID
114
+ ```
115
+
116
+ Dangerous mode adds the providers' explicit bypass flags:
117
+
118
+ ```text
119
+ claude --dangerously-skip-permissions --resume SESSION_ID
120
+ codex --dangerously-bypass-approvals-and-sandbox resume SESSION_ID
121
+ ```
122
+
123
+ These options disable important protections. Use them only where you have consciously accepted that risk.
124
+
125
+ Set a persistent mode from the command line:
126
+
127
+ ```bash
128
+ sessions --set-launch-mode safe
129
+ sessions --set-launch-mode dangerous
130
+ ```
131
+
132
+ Use `--launch-mode` for a one-time override. The active mode is always displayed in the interface header.
133
+
134
+ ## Configuration
135
+
136
+ Configuration is stored in:
137
+
138
+ - Linux: `~/.config/ai-sessions/config.toml`
139
+ - Windows: `%APPDATA%\ai-sessions\config.toml`
140
+
141
+ The optional custom profile uses structured argument arrays, avoiding shell interpolation:
142
+
143
+ ```toml
144
+ [launch]
145
+ mode = "custom"
146
+ claude_command = ["claude"]
147
+ codex_command = ["codex"]
148
+
149
+ [launch.custom]
150
+ claude_args = ["--permission-mode", "acceptEdits"]
151
+ codex_args = ["--sandbox", "workspace-write", "--ask-for-approval", "on-request"]
152
+ ```
153
+
154
+ Rename/hide state is kept alongside the configuration as `state.json`. Caches use `~/.cache/ai-sessions` on Linux and `%LOCALAPPDATA%\ai-sessions` on Windows. Environment overrides are available through `AI_SESSIONS_CONFIG_FILE`, `AI_SESSIONS_STATE_FILE`, `CODEX_HOME`, and `CLAUDE_CONFIG_DIR`.
155
+
156
+ ## How open-session detection works
157
+
158
+ - Claude Code publishes a live PID/session registry.
159
+ - Codex on Linux holds per-thread writer locks.
160
+ - Codex on Windows records thread IDs alongside process IDs in its local log database.
161
+ - Linux focus support follows the process into tmux and then uses `wmctrl`/`xdotool` when available.
162
+
163
+ Detection is best-effort and read-only. The utility never writes to provider storage.
164
+
165
+ ## Privacy
166
+
167
+ No transcripts, caches, credentials, local names, or hidden-session state belong in this repository. The defensive `.gitignore` excludes common provider and local data paths.
168
+
169
+ ## Development
170
+
171
+ ```bash
172
+ python -m unittest discover -s tests -v
173
+ python -m build
174
+ ```
175
+
176
+ CI exercises Python 3.11–3.13 on Ubuntu and Windows.
@@ -0,0 +1,150 @@
1
+ # ai-sessions
2
+
3
+ `ai-sessions` is a searchable terminal browser for local [Codex CLI](https://developers.openai.com/codex/cli/) and Claude Code conversations. It indexes each provider's existing on-disk history without modifying transcripts or provider databases.
4
+
5
+ It runs as `sessions` on Linux and native Windows PowerShell.
6
+
7
+ ## Features
8
+
9
+ - One navigable list for Codex and Claude sessions
10
+ - Search and filters for provider, directory, origin, open state, and visibility
11
+ - Human, cross-provider, and subagent/automation origin labels
12
+ - Started and updated timestamps plus user-message counts across compactions
13
+ - Utility-local rename and hide operations that never alter vendor data
14
+ - Detection of currently open sessions on Linux and Windows
15
+ - tmux pane and desktop-terminal focus on Linux when the environment exposes it
16
+ - Safe, dangerous, and custom launch profiles
17
+ - Native paths and argument handling on both operating systems
18
+
19
+ Windows Terminal does not expose a stable session-ID-to-tab interface. On Windows, open sessions are identified, but exact tab focusing is intentionally not attempted.
20
+
21
+ ## Requirements
22
+
23
+ - Python 3.11 or newer
24
+ - Codex CLI, Claude Code, or both
25
+ - Linux or native Windows PowerShell
26
+
27
+ The Windows-only `windows-curses` dependency is installed automatically. `psutil` is used for portable process inspection.
28
+
29
+ ## Install
30
+
31
+ From a checkout:
32
+
33
+ ```bash
34
+ python -m pip install .
35
+ sessions
36
+ ```
37
+
38
+ With `pipx`:
39
+
40
+ ```bash
41
+ pipx install .
42
+ sessions
43
+ ```
44
+
45
+ From PyPI:
46
+
47
+ ```bash
48
+ pipx install ai-sessions
49
+ ```
50
+
51
+ On Windows, `py -m pip` can be used in place of `python -m pip`.
52
+
53
+ ## Everyday use
54
+
55
+ Run `sessions`, navigate with the arrow keys or `j`/`k`, and press Enter to resume the selected conversation.
56
+
57
+ | Key | Action |
58
+ | --- | --- |
59
+ | `Ctrl-F` or `/` | Start search mode |
60
+ | `Tab` | Cycle provider filter |
61
+ | `o` | Cycle Human, Cross, Agent, and All origins |
62
+ | `v` | Cycle visible, hidden, and all sessions |
63
+ | `d` | Choose a directory |
64
+ | `s` | Cycle sort order |
65
+ | `p` | Cycle Safe, Dangerous, and Custom launch modes |
66
+ | `r` | Rename locally |
67
+ | `h` | Hide or restore locally |
68
+ | `Ctrl-R` | Refresh |
69
+ | `?` | Show complete help |
70
+
71
+ Useful noninteractive forms include:
72
+
73
+ ```bash
74
+ sessions --list --tool codex
75
+ sessions --list --query "is:open dir:my-project"
76
+ sessions --list --visibility hidden
77
+ sessions --resume SESSION_ID
78
+ sessions --resume SESSION_ID --dry-run
79
+ ```
80
+
81
+ ## Launch safety
82
+
83
+ The package defaults to `safe`. This leaves approval and sandbox behavior to each provider's normal configuration:
84
+
85
+ ```text
86
+ claude --resume SESSION_ID
87
+ codex resume SESSION_ID
88
+ ```
89
+
90
+ Dangerous mode adds the providers' explicit bypass flags:
91
+
92
+ ```text
93
+ claude --dangerously-skip-permissions --resume SESSION_ID
94
+ codex --dangerously-bypass-approvals-and-sandbox resume SESSION_ID
95
+ ```
96
+
97
+ These options disable important protections. Use them only where you have consciously accepted that risk.
98
+
99
+ Set a persistent mode from the command line:
100
+
101
+ ```bash
102
+ sessions --set-launch-mode safe
103
+ sessions --set-launch-mode dangerous
104
+ ```
105
+
106
+ Use `--launch-mode` for a one-time override. The active mode is always displayed in the interface header.
107
+
108
+ ## Configuration
109
+
110
+ Configuration is stored in:
111
+
112
+ - Linux: `~/.config/ai-sessions/config.toml`
113
+ - Windows: `%APPDATA%\ai-sessions\config.toml`
114
+
115
+ The optional custom profile uses structured argument arrays, avoiding shell interpolation:
116
+
117
+ ```toml
118
+ [launch]
119
+ mode = "custom"
120
+ claude_command = ["claude"]
121
+ codex_command = ["codex"]
122
+
123
+ [launch.custom]
124
+ claude_args = ["--permission-mode", "acceptEdits"]
125
+ codex_args = ["--sandbox", "workspace-write", "--ask-for-approval", "on-request"]
126
+ ```
127
+
128
+ Rename/hide state is kept alongside the configuration as `state.json`. Caches use `~/.cache/ai-sessions` on Linux and `%LOCALAPPDATA%\ai-sessions` on Windows. Environment overrides are available through `AI_SESSIONS_CONFIG_FILE`, `AI_SESSIONS_STATE_FILE`, `CODEX_HOME`, and `CLAUDE_CONFIG_DIR`.
129
+
130
+ ## How open-session detection works
131
+
132
+ - Claude Code publishes a live PID/session registry.
133
+ - Codex on Linux holds per-thread writer locks.
134
+ - Codex on Windows records thread IDs alongside process IDs in its local log database.
135
+ - Linux focus support follows the process into tmux and then uses `wmctrl`/`xdotool` when available.
136
+
137
+ Detection is best-effort and read-only. The utility never writes to provider storage.
138
+
139
+ ## Privacy
140
+
141
+ No transcripts, caches, credentials, local names, or hidden-session state belong in this repository. The defensive `.gitignore` excludes common provider and local data paths.
142
+
143
+ ## Development
144
+
145
+ ```bash
146
+ python -m unittest discover -s tests -v
147
+ python -m build
148
+ ```
149
+
150
+ CI exercises Python 3.11–3.13 on Ubuntu and Windows.
@@ -0,0 +1,51 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.26"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "ai-sessions"
7
+ version = "3.0.0"
8
+ description = "A friendly terminal browser for local Codex CLI and Claude Code sessions"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Andrew VanDyke", email = "vandyand@gmail.com" }]
14
+ keywords = ["codex", "claude-code", "terminal", "sessions", "tui"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Environment :: Console :: Curses",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: Microsoft :: Windows",
20
+ "Operating System :: POSIX :: Linux",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Topic :: Software Development",
26
+ ]
27
+ dependencies = [
28
+ "psutil>=5.9",
29
+ "windows-curses>=2.4.1; sys_platform == 'win32'",
30
+ ]
31
+
32
+ [project.urls]
33
+ Homepage = "https://github.com/vandyand/ai-sessions"
34
+ Repository = "https://github.com/vandyand/ai-sessions"
35
+ Issues = "https://github.com/vandyand/ai-sessions/issues"
36
+
37
+ [project.scripts]
38
+ sessions = "ai_sessions.app:main"
39
+
40
+ [tool.hatch.build.targets.wheel]
41
+ packages = ["src/ai_sessions"]
42
+
43
+ [tool.hatch.build.targets.sdist]
44
+ include = ["src/ai_sessions", "tests", "README.md", "LICENSE", "pyproject.toml"]
45
+
46
+ [tool.ruff]
47
+ target-version = "py311"
48
+ line-length = 100
49
+
50
+ [tool.ruff.lint]
51
+ select = ["E4", "E7", "E9", "F", "I"]
@@ -0,0 +1,3 @@
1
+ """Browse and resume local Codex CLI and Claude Code sessions."""
2
+
3
+ __version__ = "3.0.0"
@@ -0,0 +1,3 @@
1
+ from .app import main
2
+
3
+ raise SystemExit(main())