reprompt-cli 0.1.1__tar.gz → 0.3.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.
Files changed (86) hide show
  1. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/.github/workflows/ci.yml +4 -4
  2. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/.github/workflows/publish.yml +2 -2
  3. reprompt_cli-0.3.0/.pre-commit-config.yaml +7 -0
  4. reprompt_cli-0.3.0/CHANGELOG.md +74 -0
  5. reprompt_cli-0.3.0/CLAUDE.md +67 -0
  6. reprompt_cli-0.3.0/CODE_OF_CONDUCT.md +11 -0
  7. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/PKG-INFO +69 -23
  8. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/README.md +68 -22
  9. reprompt_cli-0.3.0/docs/launch-post.md +106 -0
  10. reprompt_cli-0.3.0/docs/retention-features-spec.md +1245 -0
  11. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/pyproject.toml +1 -1
  12. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/__init__.py +1 -1
  13. reprompt_cli-0.3.0/src/reprompt/adapters/claude_code.py +262 -0
  14. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/adapters/openclaw.py +42 -10
  15. reprompt_cli-0.3.0/src/reprompt/cli.py +330 -0
  16. reprompt_cli-0.3.0/src/reprompt/config.py +119 -0
  17. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/core/analyzer.py +24 -4
  18. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/core/dedup.py +18 -4
  19. reprompt_cli-0.3.0/src/reprompt/core/effectiveness.py +89 -0
  20. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/core/pipeline.py +51 -7
  21. reprompt_cli-0.3.0/src/reprompt/core/session_meta.py +22 -0
  22. reprompt_cli-0.3.0/src/reprompt/core/timeutil.py +57 -0
  23. reprompt_cli-0.3.0/src/reprompt/core/trends.py +204 -0
  24. reprompt_cli-0.3.0/src/reprompt/embeddings/local_embed.py +45 -0
  25. reprompt_cli-0.3.0/src/reprompt/embeddings/openai_embed.py +58 -0
  26. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/output/markdown.py +6 -2
  27. reprompt_cli-0.3.0/src/reprompt/output/terminal.py +149 -0
  28. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/storage/db.py +272 -0
  29. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_adapter_claude.py +82 -1
  30. reprompt_cli-0.3.0/tests/test_adapter_openclaw.py +190 -0
  31. reprompt_cli-0.3.0/tests/test_cli.py +178 -0
  32. reprompt_cli-0.3.0/tests/test_config.py +88 -0
  33. reprompt_cli-0.3.0/tests/test_db.py +237 -0
  34. reprompt_cli-0.3.0/tests/test_db_trends.py +139 -0
  35. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_dedup.py +36 -1
  36. reprompt_cli-0.3.0/tests/test_effectiveness.py +130 -0
  37. reprompt_cli-0.3.0/tests/test_embeddings_local.py +113 -0
  38. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_embeddings_ollama.py +3 -5
  39. reprompt_cli-0.3.0/tests/test_embeddings_openai.py +134 -0
  40. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_install_hook.py +24 -25
  41. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_output.py +47 -0
  42. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_pipeline.py +61 -0
  43. reprompt_cli-0.3.0/tests/test_timeutil.py +78 -0
  44. reprompt_cli-0.3.0/tests/test_trends.py +183 -0
  45. reprompt_cli-0.3.0/tests/test_trends_cli.py +138 -0
  46. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/uv.lock +45 -45
  47. reprompt_cli-0.1.1/CHANGELOG.md +0 -34
  48. reprompt_cli-0.1.1/src/reprompt/adapters/claude_code.py +0 -140
  49. reprompt_cli-0.1.1/src/reprompt/cli.py +0 -177
  50. reprompt_cli-0.1.1/src/reprompt/config.py +0 -44
  51. reprompt_cli-0.1.1/src/reprompt/output/terminal.py +0 -65
  52. reprompt_cli-0.1.1/tests/test_adapter_openclaw.py +0 -64
  53. reprompt_cli-0.1.1/tests/test_cli.py +0 -96
  54. reprompt_cli-0.1.1/tests/test_config.py +0 -22
  55. reprompt_cli-0.1.1/tests/test_db.py +0 -108
  56. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/.editorconfig +0 -0
  57. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  58. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  59. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  60. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/.github/dependabot.yml +0 -0
  61. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/.gitignore +0 -0
  62. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/CONTRIBUTING.md +0 -0
  63. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/LICENSE +0 -0
  64. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/SECURITY.md +0 -0
  65. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/adapters/__init__.py +0 -0
  66. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/adapters/base.py +0 -0
  67. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/core/__init__.py +0 -0
  68. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/core/library.py +0 -0
  69. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/core/models.py +0 -0
  70. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/embeddings/__init__.py +0 -0
  71. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/embeddings/base.py +0 -0
  72. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/embeddings/ollama.py +0 -0
  73. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/embeddings/tfidf.py +0 -0
  74. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/output/__init__.py +0 -0
  75. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/output/json_out.py +0 -0
  76. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/py.typed +0 -0
  77. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/src/reprompt/storage/__init__.py +0 -0
  78. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/__init__.py +0 -0
  79. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/conftest.py +0 -0
  80. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/fixtures/claude_session.jsonl +0 -0
  81. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/fixtures/openclaw_session.jsonl +0 -0
  82. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_analyzer.py +0 -0
  83. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_e2e.py +0 -0
  84. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_library.py +0 -0
  85. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_markdown.py +0 -0
  86. {reprompt_cli-0.1.1 → reprompt_cli-0.3.0}/tests/test_models.py +0 -0
@@ -14,13 +14,13 @@ jobs:
14
14
  os: [ubuntu-latest, macos-latest]
15
15
  python-version: ["3.10", "3.11", "3.12"]
16
16
  steps:
17
- - uses: actions/checkout@v4
17
+ - uses: actions/checkout@v6
18
18
  - name: Set up Python
19
- uses: actions/setup-python@v5
19
+ uses: actions/setup-python@v6
20
20
  with:
21
21
  python-version: ${{ matrix.python-version }}
22
22
  - name: Install uv
23
- uses: astral-sh/setup-uv@v4
23
+ uses: astral-sh/setup-uv@v7
24
24
  - name: Install dependencies
25
25
  run: uv pip install --system -e ".[dev]"
26
26
  - name: Lint
@@ -31,6 +31,6 @@ jobs:
31
31
  run: pytest tests/ -v --cov=reprompt --cov-report=xml
32
32
  - name: Upload coverage
33
33
  if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
34
- uses: codecov/codecov-action@v4
34
+ uses: codecov/codecov-action@v5
35
35
  with:
36
36
  file: coverage.xml
@@ -11,8 +11,8 @@ jobs:
11
11
  publish:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v4
15
- - uses: actions/setup-python@v5
14
+ - uses: actions/checkout@v6
15
+ - uses: actions/setup-python@v6
16
16
  with:
17
17
  python-version: "3.12"
18
18
  - name: Install build tools
@@ -0,0 +1,7 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.11.6
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
@@ -0,0 +1,74 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.3.0] - 2026-03-11
6
+
7
+ ### Added
8
+ - `reprompt trends` — prompt evolution tracking with specificity scoring, delta arrows, insights
9
+ - `reprompt effectiveness` — session quality scoring (clean exit, error ratio, duration heuristics)
10
+ - Session metadata extraction during scan (tool calls, errors, duration, final status)
11
+ - Hot Phrases: TF-IDF now extracts bigram/trigram phrases instead of single words
12
+ - Prompt snapshots table for time-series trend data
13
+ - IDE prefix stripping (`<ide_opened_file>`, `<ide_selection>`) — preserves real user questions
14
+ - Compact/continuation message filtering (blocks session compaction noise)
15
+ - Troubleshooting FAQ in README (Anaconda NumPy conflict)
16
+
17
+ ### Changed
18
+ - "Hot Terms" → "Hot Phrases" in terminal report (n-gram based, stopwords filtered)
19
+ - Tests: 176 → 246
20
+
21
+ ## [0.2.0] - 2026-03-11
22
+
23
+ ### Added
24
+ - `reprompt search <query>` command for keyword search across prompt history
25
+ - Local embedding backend (`pip install reprompt-cli[local]`, sentence-transformers)
26
+ - OpenAI embedding backend (`pip install reprompt-cli[openai]`)
27
+ - TOML config file support (`~/.config/reprompt/config.toml`)
28
+ - K-means clustering output in terminal report
29
+ - TF-IDF hot terms table in terminal report
30
+ - OpenClaw adapter supports new `~/.openclaw/` path (backward compatible)
31
+ - Competitive comparison table in README
32
+
33
+ ### Fixed
34
+ - `install-hook` now registers in Claude Code `settings.json` (was writing unregistered shell script)
35
+ - `ollama_url` config setting now propagates to OllamaEmbedder
36
+ - Pattern IDs are stable across report runs (upsert instead of clear+re-insert)
37
+ - Text truncation in all outputs now shows `...` suffix
38
+ - JSON output uses `print()` instead of Rich `console.print()` to avoid markup corruption
39
+
40
+ ### Changed
41
+ - Tests: 118 → 176
42
+ - OpenClaw adapter checks both `~/.openclaw/` (new) and `~/.opencode/` (legacy)
43
+
44
+ ## [0.1.1] - 2026-03-10
45
+
46
+ ### Fixed
47
+ - Prevent connection leak in all database methods (try/finally)
48
+ - Fix session marking for incremental scan accuracy
49
+ - Fix purge validation for date format parsing
50
+ - Fix pattern dedup to avoid duplicate entries
51
+ - Improve Ollama error messages when server is unreachable
52
+ - Fix JSON output (`--format json`) producing invalid escape sequences
53
+
54
+ ### Added
55
+ - `--version` / `-V` flag to CLI
56
+ - mypy strict mode compliance
57
+
58
+ ## [0.1.0] - 2026-03-10
59
+
60
+ ### Added
61
+
62
+ - Initial release
63
+ - Claude Code session adapter (JSONL format)
64
+ - OpenClaw session adapter
65
+ - Two-layer deduplication (SHA-256 exact + TF-IDF semantic)
66
+ - TF-IDF hot terms analysis
67
+ - K-means prompt clustering
68
+ - Prompt pattern library with auto-categorization
69
+ - Rich terminal reports with tables and bar charts
70
+ - JSON output for CI/pipeline integration
71
+ - Markdown export for prompt library
72
+ - `install-hook` command for Claude Code automation
73
+ - Ollama embedding backend (optional)
74
+ - Zero-config defaults with env var and TOML override
@@ -0,0 +1,67 @@
1
+ # reprompt
2
+
3
+ CLI tool that extracts, deduplicates, and analyzes prompts from AI coding sessions.
4
+
5
+ ## Build & Test
6
+
7
+ ```bash
8
+ uv venv && uv pip install -e ".[dev]"
9
+ uv run pytest tests/ -v # run tests
10
+ uv run pytest tests/ -v --cov=reprompt # with coverage
11
+ uv run ruff check src/ tests/ # lint
12
+ uv run ruff format src/ tests/ # format
13
+ uv run mypy src/reprompt/ # type check (strict)
14
+ uv run python -m build # build wheel
15
+ ```
16
+
17
+ ## Architecture
18
+
19
+ ```
20
+ src/reprompt/
21
+ ├── cli.py # Typer CLI (scan, report, search, library, status, purge, install-hook)
22
+ ├── config.py # pydantic-settings, env vars (REPROMPT_ prefix) + TOML config
23
+ ├── core/
24
+ │ ├── models.py # Prompt dataclass (auto SHA-256 hash)
25
+ │ ├── dedup.py # Two-layer dedup: exact hash + TF-IDF cosine
26
+ │ ├── analyzer.py # TF-IDF hot terms + K-means clustering
27
+ │ ├── library.py # Pattern extraction + keyword categorization
28
+ │ └── pipeline.py # Orchestrator: scan → dedup → store → analyze → cluster
29
+ ├── adapters/
30
+ │ ├── base.py # BaseAdapter ABC
31
+ │ ├── claude_code.py # Claude Code JSONL parser
32
+ │ └── openclaw.py # OpenClaw JSON parser (supports ~/.openclaw/ + legacy ~/.opencode/)
33
+ ├── embeddings/
34
+ │ ├── base.py # BaseEmbedder ABC
35
+ │ ├── tfidf.py # Default (sklearn, zero config)
36
+ │ ├── ollama.py # Optional: pip install reprompt-cli[ollama]
37
+ │ ├── local_embed.py # Optional: pip install reprompt-cli[local] (sentence-transformers)
38
+ │ └── openai_embed.py # Optional: pip install reprompt-cli[openai]
39
+ ├── storage/
40
+ │ └── db.py # SQLite: prompts, processed_sessions, prompt_patterns, term_stats
41
+ └── output/
42
+ ├── terminal.py # Rich tables + bar charts + hot terms + clusters
43
+ ├── json_out.py # JSON for pipelines
44
+ └── markdown.py # Markdown export
45
+ ```
46
+
47
+ ## Data Flow
48
+
49
+ ```
50
+ Session files → Adapter.parse() → list[Prompt]
51
+ → DedupEngine: SHA-256 exact → TF-IDF cosine similarity
52
+ → SQLite: insert unique prompts, mark dupes
53
+ → Analyzer: TF-IDF hot terms + K-means clusters
54
+ → Library: extract high-frequency patterns, auto-categorize
55
+ → Output: terminal / JSON / Markdown
56
+ ```
57
+
58
+ ## Key Conventions
59
+
60
+ - Package name: `reprompt-cli` (PyPI), CLI command: `reprompt`
61
+ - Python >=3.10, type hints required, mypy strict
62
+ - ruff for lint + format (line-length=100)
63
+ - All db methods use try/finally for conn.close()
64
+ - Pattern upsert (not clear+re-insert) for stable IDs
65
+ - Prompts starting with `<` are filtered (system-injected XML)
66
+ - Config: env vars (REPROMPT_ prefix) > TOML (~/.config/reprompt/config.toml) > defaults
67
+ - Tests: pytest, 176 tests, 95% coverage target
@@ -0,0 +1,11 @@
1
+ # Code of Conduct
2
+
3
+ This project follows the [Contributor Covenant v2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
4
+
5
+ We are committed to providing a welcoming and inclusive experience for everyone.
6
+
7
+ ## Reporting
8
+
9
+ If you experience or witness unacceptable behavior, please report it by opening a [GitHub issue](https://github.com/reprompt-dev/reprompt/issues) or contacting the maintainers directly.
10
+
11
+ Reports will be reviewed and addressed promptly.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reprompt-cli
3
- Version: 0.1.1
3
+ Version: 0.3.0
4
4
  Summary: Discover, analyze, and evolve your best prompts from AI coding sessions
5
5
  Project-URL: Homepage, https://github.com/reprompt-dev/reprompt
6
6
  Project-URL: Repository, https://github.com/reprompt-dev/reprompt
@@ -47,6 +47,8 @@ Description-Content-Type: text/markdown
47
47
 
48
48
  > Discover, analyze, and evolve your best prompts from AI coding sessions.
49
49
 
50
+ *repomix packs your code for AI. reprompt extracts insights from AI.*
51
+
50
52
  Every developer's AI session history contains reusable prompt patterns -- scattered across hundreds of session files. **reprompt** extracts them, deduplicates, analyzes frequency, and builds a personal prompt library that evolves over time.
51
53
 
52
54
  ## Quick Start
@@ -58,6 +60,25 @@ reprompt report
58
60
  reprompt library
59
61
  ```
60
62
 
63
+ ## Terminal Report
64
+
65
+ ```
66
+ reprompt -- AI Session Analytics
67
+ ========================================
68
+
69
+ Overview
70
+ Total prompts: 1,247
71
+ Unique (deduped): 832
72
+ Sessions scanned: 156
73
+ Sources: claude-code, openclaw
74
+
75
+ Top Prompt Patterns
76
+ # | Pattern | Count | Category
77
+ 1 | fix the failing test... | 42 | debug
78
+ 2 | add unit tests for... | 38 | test
79
+ 3 | refactor X to use... | 27 | refactor
80
+ ```
81
+
61
82
  ## Features
62
83
 
63
84
  - **Auto-detection** -- finds Claude Code and OpenClaw sessions automatically
@@ -68,17 +89,36 @@ reprompt library
68
89
  - **Rich reports** -- beautiful terminal output with tables and bar charts
69
90
  - **Multiple formats** -- terminal, JSON (for pipelines), Markdown (for docs)
70
91
  - **Pluggable adapters** -- add support for any AI coding tool
92
+ - **Prompt search** -- find past prompts by keyword across all sessions
71
93
  - **Zero config** -- works out of the box, customize via env vars or TOML
72
94
 
95
+ ## How reprompt Compares
96
+
97
+ | Feature | reprompt | prompt-manager | agent-sessions | cclog |
98
+ |---------|----------|---------------|----------------|-------|
99
+ | Multi-tool support | ✅ Claude, OpenClaw, + adapters | ✅ Multiple | ✅ Multiple | ❌ Claude only |
100
+ | Exact dedup (SHA-256) | ✅ | ❌ | ❌ | ❌ |
101
+ | Semantic dedup (TF-IDF) | ✅ | ❌ | ❌ | ❌ |
102
+ | Hot terms analysis | ✅ TF-IDF | ❌ | ❌ | ❌ |
103
+ | K-means clustering | ✅ | ❌ | ❌ | ❌ |
104
+ | Pattern library | ✅ Auto-categorized | ❌ | ❌ | ❌ |
105
+ | CLI interface | ✅ | ✅ TUI | ❌ macOS app | ✅ |
106
+ | JSON/Markdown export | ✅ | ❌ | ❌ | ❌ |
107
+ | Pluggable adapters | ✅ | ✅ | ❌ | ❌ |
108
+ | Zero config | ✅ | ✅ | ✅ | ✅ |
109
+
73
110
  ## Supported AI Tools
74
111
 
75
112
  | Tool | Status | Session Path |
76
113
  |------|--------|-------------|
77
114
  | Claude Code | Supported | `~/.claude/projects/` |
78
- | OpenClaw / OpenCode | Supported | `~/.opencode/sessions/` |
115
+ | OpenClaw / OpenCode | Supported | `~/.openclaw/` + `~/.opencode/sessions/` |
116
+ | Codex CLI | Planned (v0.4) | `~/.codex/` |
117
+ | Aider | Planned | `~/.aider/` |
118
+ | Gemini CLI | Planned | `~/.gemini/` |
119
+ | Continue.dev | Via MCP | MCP protocol |
120
+ | Zed | Via MCP | MCP protocol |
79
121
  | Cursor | Planned | -- |
80
- | Codex CLI | Planned | -- |
81
- | Gemini CLI | Planned | -- |
82
122
 
83
123
  ## Usage
84
124
 
@@ -98,6 +138,10 @@ reprompt report
98
138
  # JSON output (for CI/pipelines)
99
139
  reprompt report --format json
100
140
 
141
+ # Search your prompt history
142
+ reprompt search "authentication"
143
+ reprompt search "debug" --limit 5
144
+
101
145
  # View your prompt library
102
146
  reprompt library
103
147
 
@@ -117,25 +161,6 @@ reprompt install-hook
117
161
  reprompt purge --older-than 90d
118
162
  ```
119
163
 
120
- ## Terminal Report
121
-
122
- ```
123
- reprompt -- AI Session Analytics
124
- ========================================
125
-
126
- Overview
127
- Total prompts: 1,247
128
- Unique (deduped): 832
129
- Sessions scanned: 156
130
- Sources: claude-code, openclaw
131
-
132
- Top Prompt Patterns
133
- # | Pattern | Count | Category
134
- 1 | fix the failing test... | 42 | debug
135
- 2 | add unit tests for... | 38 | test
136
- 3 | refactor X to use... | 27 | refactor
137
- ```
138
-
139
164
  ## Configuration
140
165
 
141
166
  Zero config by default. Customize with environment variables or TOML:
@@ -189,6 +214,27 @@ class MyToolAdapter(BaseAdapter):
189
214
  return Path(self.default_session_path).expanduser().exists()
190
215
  ```
191
216
 
217
+ ## Troubleshooting
218
+
219
+ ### NumPy conflict in Anaconda environments
220
+
221
+ If you see an error like:
222
+ ```
223
+ A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x
224
+ ```
225
+
226
+ This happens when Anaconda's base environment has packages compiled against NumPy 1.x but a newer NumPy 2.x is installed. **This is not a reprompt bug** — it's an environment conflict.
227
+
228
+ **Fix:** Install reprompt in an isolated environment using pipx:
229
+
230
+ ```bash
231
+ pip3 install --user pipx
232
+ pipx install reprompt-cli
233
+ reprompt scan
234
+ ```
235
+
236
+ pipx creates a dedicated virtualenv for reprompt, avoiding conflicts with your system Python or Anaconda.
237
+
192
238
  ## Contributing
193
239
 
194
240
  See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
@@ -7,6 +7,8 @@
7
7
 
8
8
  > Discover, analyze, and evolve your best prompts from AI coding sessions.
9
9
 
10
+ *repomix packs your code for AI. reprompt extracts insights from AI.*
11
+
10
12
  Every developer's AI session history contains reusable prompt patterns -- scattered across hundreds of session files. **reprompt** extracts them, deduplicates, analyzes frequency, and builds a personal prompt library that evolves over time.
11
13
 
12
14
  ## Quick Start
@@ -18,6 +20,25 @@ reprompt report
18
20
  reprompt library
19
21
  ```
20
22
 
23
+ ## Terminal Report
24
+
25
+ ```
26
+ reprompt -- AI Session Analytics
27
+ ========================================
28
+
29
+ Overview
30
+ Total prompts: 1,247
31
+ Unique (deduped): 832
32
+ Sessions scanned: 156
33
+ Sources: claude-code, openclaw
34
+
35
+ Top Prompt Patterns
36
+ # | Pattern | Count | Category
37
+ 1 | fix the failing test... | 42 | debug
38
+ 2 | add unit tests for... | 38 | test
39
+ 3 | refactor X to use... | 27 | refactor
40
+ ```
41
+
21
42
  ## Features
22
43
 
23
44
  - **Auto-detection** -- finds Claude Code and OpenClaw sessions automatically
@@ -28,17 +49,36 @@ reprompt library
28
49
  - **Rich reports** -- beautiful terminal output with tables and bar charts
29
50
  - **Multiple formats** -- terminal, JSON (for pipelines), Markdown (for docs)
30
51
  - **Pluggable adapters** -- add support for any AI coding tool
52
+ - **Prompt search** -- find past prompts by keyword across all sessions
31
53
  - **Zero config** -- works out of the box, customize via env vars or TOML
32
54
 
55
+ ## How reprompt Compares
56
+
57
+ | Feature | reprompt | prompt-manager | agent-sessions | cclog |
58
+ |---------|----------|---------------|----------------|-------|
59
+ | Multi-tool support | ✅ Claude, OpenClaw, + adapters | ✅ Multiple | ✅ Multiple | ❌ Claude only |
60
+ | Exact dedup (SHA-256) | ✅ | ❌ | ❌ | ❌ |
61
+ | Semantic dedup (TF-IDF) | ✅ | ❌ | ❌ | ❌ |
62
+ | Hot terms analysis | ✅ TF-IDF | ❌ | ❌ | ❌ |
63
+ | K-means clustering | ✅ | ❌ | ❌ | ❌ |
64
+ | Pattern library | ✅ Auto-categorized | ❌ | ❌ | ❌ |
65
+ | CLI interface | ✅ | ✅ TUI | ❌ macOS app | ✅ |
66
+ | JSON/Markdown export | ✅ | ❌ | ❌ | ❌ |
67
+ | Pluggable adapters | ✅ | ✅ | ❌ | ❌ |
68
+ | Zero config | ✅ | ✅ | ✅ | ✅ |
69
+
33
70
  ## Supported AI Tools
34
71
 
35
72
  | Tool | Status | Session Path |
36
73
  |------|--------|-------------|
37
74
  | Claude Code | Supported | `~/.claude/projects/` |
38
- | OpenClaw / OpenCode | Supported | `~/.opencode/sessions/` |
75
+ | OpenClaw / OpenCode | Supported | `~/.openclaw/` + `~/.opencode/sessions/` |
76
+ | Codex CLI | Planned (v0.4) | `~/.codex/` |
77
+ | Aider | Planned | `~/.aider/` |
78
+ | Gemini CLI | Planned | `~/.gemini/` |
79
+ | Continue.dev | Via MCP | MCP protocol |
80
+ | Zed | Via MCP | MCP protocol |
39
81
  | Cursor | Planned | -- |
40
- | Codex CLI | Planned | -- |
41
- | Gemini CLI | Planned | -- |
42
82
 
43
83
  ## Usage
44
84
 
@@ -58,6 +98,10 @@ reprompt report
58
98
  # JSON output (for CI/pipelines)
59
99
  reprompt report --format json
60
100
 
101
+ # Search your prompt history
102
+ reprompt search "authentication"
103
+ reprompt search "debug" --limit 5
104
+
61
105
  # View your prompt library
62
106
  reprompt library
63
107
 
@@ -77,25 +121,6 @@ reprompt install-hook
77
121
  reprompt purge --older-than 90d
78
122
  ```
79
123
 
80
- ## Terminal Report
81
-
82
- ```
83
- reprompt -- AI Session Analytics
84
- ========================================
85
-
86
- Overview
87
- Total prompts: 1,247
88
- Unique (deduped): 832
89
- Sessions scanned: 156
90
- Sources: claude-code, openclaw
91
-
92
- Top Prompt Patterns
93
- # | Pattern | Count | Category
94
- 1 | fix the failing test... | 42 | debug
95
- 2 | add unit tests for... | 38 | test
96
- 3 | refactor X to use... | 27 | refactor
97
- ```
98
-
99
124
  ## Configuration
100
125
 
101
126
  Zero config by default. Customize with environment variables or TOML:
@@ -149,6 +174,27 @@ class MyToolAdapter(BaseAdapter):
149
174
  return Path(self.default_session_path).expanduser().exists()
150
175
  ```
151
176
 
177
+ ## Troubleshooting
178
+
179
+ ### NumPy conflict in Anaconda environments
180
+
181
+ If you see an error like:
182
+ ```
183
+ A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x
184
+ ```
185
+
186
+ This happens when Anaconda's base environment has packages compiled against NumPy 1.x but a newer NumPy 2.x is installed. **This is not a reprompt bug** — it's an environment conflict.
187
+
188
+ **Fix:** Install reprompt in an isolated environment using pipx:
189
+
190
+ ```bash
191
+ pip3 install --user pipx
192
+ pipx install reprompt-cli
193
+ reprompt scan
194
+ ```
195
+
196
+ pipx creates a dedicated virtualenv for reprompt, avoiding conflicts with your system Python or Anaconda.
197
+
152
198
  ## Contributing
153
199
 
154
200
  See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
@@ -0,0 +1,106 @@
1
+ # Launch Post Draft
2
+
3
+ Target: Hacker News (Show HN), Reddit (r/programming, r/MachineLearning), Twitter/X
4
+
5
+ ---
6
+
7
+ ## Show HN: reprompt -- Discover and reuse your best prompts from AI coding sessions
8
+
9
+ Every developer using AI coding tools has hundreds of session files scattered across their system. Buried in those sessions are the prompts that actually worked -- the ones that led to clean implementations, successful debugging, and productive refactoring.
10
+
11
+ **reprompt** is a CLI tool that extracts prompts from your AI coding session history, deduplicates them (exact + semantic), analyzes frequency patterns, and builds a personal prompt library that evolves over time.
12
+
13
+ ### What it does
14
+
15
+ - Scans Claude Code and OpenClaw/OpenCode sessions automatically
16
+ - Two-layer dedup: SHA-256 for exact matches, TF-IDF cosine similarity for semantic near-duplicates
17
+ - Discovers your "hot terms" via TF-IDF analysis
18
+ - K-means clustering groups similar prompts into themes
19
+ - Auto-categorizes patterns: debug, implement, test, review, refactor, explain, config
20
+ - Exports as terminal report, JSON (for pipelines), or Markdown
21
+
22
+ ### Quick start
23
+
24
+ ```bash
25
+ pipx install reprompt-cli
26
+ reprompt scan # finds sessions automatically
27
+ reprompt report # see your patterns
28
+ reprompt library # browse your prompt library
29
+ ```
30
+
31
+ ### Why I built this
32
+
33
+ After 6+ months of daily AI-assisted coding, I realized I was re-inventing prompts constantly. The same debugging approach, the same "add tests for X" pattern, the same refactoring instructions -- typed fresh each time.
34
+
35
+ Session files are write-once logs. They're not designed for retrieval. reprompt turns that dead data into a living library of your best practices.
36
+
37
+ ### Technical details
38
+
39
+ - Python, MIT licensed, pip-installable
40
+ - Zero external dependencies for core (scikit-learn for TF-IDF/clustering, Rich for terminal output)
41
+ - Pluggable adapter pattern -- adding a new AI tool is ~30 lines
42
+ - Optional embedding backends: Ollama, sentence-transformers, OpenAI
43
+ - SQLite storage, zero config defaults
44
+
45
+ GitHub: https://github.com/reprompt-dev/reprompt
46
+ PyPI: https://pypi.org/project/reprompt-cli/
47
+
48
+ ---
49
+
50
+ ## Twitter/X version (thread)
51
+
52
+ **Tweet 1:**
53
+ I built reprompt -- a CLI that mines your AI coding sessions for reusable prompt patterns.
54
+
55
+ After months of Claude Code, I realized my best prompts were buried in hundreds of JSONL files. Same patterns, retyped from scratch every time.
56
+
57
+ `pipx install reprompt-cli`
58
+
59
+ **Tweet 2:**
60
+ How it works:
61
+ 1. Scans your Claude Code / OpenClaw sessions
62
+ 2. SHA-256 + TF-IDF dedup (exact + semantic)
63
+ 3. K-means clustering for theme discovery
64
+ 4. Auto-categorizes: debug, implement, test, review...
65
+ 5. Builds a prompt library that grows over time
66
+
67
+ **Tweet 3:**
68
+ Three commands to get started:
69
+
70
+ ```
71
+ reprompt scan # auto-detect sessions
72
+ reprompt report # see your patterns
73
+ reprompt library # browse & export
74
+ ```
75
+
76
+ Zero config. MIT licensed. Adapter pattern makes adding new AI tools trivial (~30 lines).
77
+
78
+ GitHub: https://github.com/reprompt-dev/reprompt
79
+
80
+ ---
81
+
82
+ ## Reddit r/programming version
83
+
84
+ **Title:** reprompt: CLI tool to extract, deduplicate, and analyze prompts from your AI coding sessions
85
+
86
+ **Body:**
87
+
88
+ I've been using Claude Code daily for months and noticed I kept writing the same types of prompts over and over. My session history had hundreds of files with reusable patterns buried in them -- but no way to search or learn from them.
89
+
90
+ So I built **reprompt**, a CLI that:
91
+
92
+ - Auto-detects Claude Code and OpenClaw session files
93
+ - Extracts user prompts and deduplicates them (SHA-256 exact + TF-IDF semantic)
94
+ - Runs TF-IDF analysis to find your "hot terms"
95
+ - Uses K-means clustering to group similar prompts
96
+ - Auto-categorizes patterns into debug/implement/test/review/refactor/explain/config
97
+ - Exports as rich terminal report, JSON, or Markdown
98
+
99
+ It's designed to be extensible -- adding support for a new AI tool is just subclassing `BaseAdapter` and implementing `parse_session()`. Cursor and Codex CLI adapters are planned.
100
+
101
+ Install: `pipx install reprompt-cli`
102
+
103
+ - GitHub: https://github.com/reprompt-dev/reprompt
104
+ - PyPI: https://pypi.org/project/reprompt-cli/
105
+ - License: MIT
106
+ - Python 3.10+