You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Accurate counting**: tiktoken cl100k_base tokenizer (GPT-3.5/4, Claude compatible)
25
34
-**Format options**: PTX (default), TOON-strict, Markdown, XML
35
+
-**LLM-optimized**: Works with ChatGPT, Claude, GPT-4, Gemini, and any AI assistant
36
+
-**Context window aware**: Respect token limits for Claude Haiku/Sonnet/Opus, GPT-3.5/4
37
+
-**AI-friendly formatting**: Structured output for better AI code comprehension
26
38
27
39
Format reference: [johannschopplich/toon](https://github.com/johannschopplich/toon)
28
40
@@ -59,84 +71,65 @@ prx --update
59
71
60
72
promptext automatically checks for new releases once per day and notifies you when updates are available. Network failures are silently ignored to avoid disrupting normal operation.
61
73
62
-
## Basic Usage
74
+
## Use Cases
63
75
64
-
```bash
65
-
# Current directory to clipboard (PTX format)
66
-
prx
76
+
-**AI Code Review**: Feed entire projects to Claude/ChatGPT for comprehensive code analysis
77
+
-**Context Engineering**: Build optimized prompts within LLM token limits for better AI responses
78
+
-**AI Pair Programming**: Provide full codebase context to AI assistants like GitHub Copilot, Cursor, or Windsurf
79
+
-**Documentation Generation**: Help AI understand your complete project structure for accurate docs
80
+
-**Code Migration**: Give LLMs full legacy codebase context for refactoring suggestions
81
+
-**Prompt Engineering**: Create consistent, repeatable AI prompts from code for development workflows
82
+
-**Bug Investigation**: Let AI analyze related files together with proper context
83
+
-**API Integration**: Generate structured code context for AI-powered development tools
67
84
68
-
# Specific directory
69
-
prx /path/to/project
85
+
## Usage
70
86
71
-
# Filter by extensions
72
-
prx -e .go,.js,.ts
73
-
74
-
# Summary only (file list, token counts)
75
-
prx -i
87
+
### Smart Context Building (The Power Features)
76
88
77
-
# Output to file (format auto-detected from extension)
78
-
prx -o context.ptx # PTX format
79
-
prx -o context.toon # PTX format (backward compatibility)
Files ranked by total score. Ties broken by file size (smaller first).
123
-
124
-
### Token Budget Control
112
+
# Current directory to clipboard
113
+
prx
125
114
126
-
Enforce context window limits:
115
+
# Specific directory with extension filter
116
+
prx /path/to/project -e .go,.js,.ts
127
117
128
-
```bash
129
-
# Claude 3 Haiku limit
130
-
prx --max-tokens 8000
118
+
# Output to file (format auto-detected)
119
+
prx -o context.ptx # PTX (default)
120
+
prx -o context.md # Markdown
121
+
prx -o project.xml # XML
131
122
132
-
#Combined relevance + budget
133
-
prx -r "api routes handlers" --max-tokens 5000
123
+
#Summary only (file list, token counts)
124
+
prx -i
134
125
135
-
#Cost optimization for iterative queries
136
-
prx --max-tokens 3000 -o quick-context.ptx
126
+
#Preview file selection
127
+
prx --dry-run -r "auth"
137
128
```
138
129
139
-
When budget exceeded, output shows inclusion/exclusion breakdown:
130
+
### Token Budget Output
131
+
132
+
When `--max-tokens` is set and exceeded, promptext shows exactly what was included and excluded:
140
133
141
134
```
142
135
╭───────────────────────────────────────────────╮
@@ -156,6 +149,8 @@ Files included in priority order until budget exhausted.
156
149
157
150
## Output Formats
158
151
152
+
**About PTX**: PTX is a hybrid TOON format specifically created for promptext. It balances the extreme compression of TOON-strict with human readability by using explicit file paths as keys and preserving multiline code blocks. This gives you ~25-30% token savings without sacrificing clarity - perfect for AI assistants that need both efficiency and accurate file path context.
153
+
159
154
| Format | Token Efficiency | File Path Clarity | Code Preservation | Use Case |
0 commit comments