Skip to content

Commit 46d77fb

Browse files
committed
Update README.md
1 parent 4e2ce03 commit 46d77fb

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,17 @@ This re-enables the `llamacpp` container and resets `.env` to `http://llamacpp:8
189189

190190
### CLI: ctx prompt enhancer
191191

192-
A thin CLI that retrieves code context and rewrites your input into a better, context-aware prompt using the local LLM decoder. By default it prints ONLY the improved prompt.
192+
A thin CLI that retrieves code context and rewrites your input into a better, context-aware prompt using the local LLM decoder. Works with both questions and commands/instructions. By default it prints ONLY the improved prompt.
193193

194194
Examples:
195195
````bash
196-
# Default: print only the improved prompt (uses Docker llama.cpp on port 8080)
197-
scripts/ctx.py "Explain the caching logic to me in detail"
196+
# Questions: Enhanced with specific details and multiple aspects
197+
scripts/ctx.py "What is ReFRAG?"
198+
# Output: Two detailed question paragraphs with file/line references
199+
200+
# Commands: Enhanced with concrete targets and implementation details
201+
scripts/ctx.py "Refactor ctx.py"
202+
# Output: Two detailed instruction paragraphs with specific steps
198203

199204
# Via Make target (default improved prompt only)
200205
make ctx Q="Explain the caching logic to me in detail"
@@ -209,16 +214,21 @@ make ctx Q="Hybrid search details" ARGS="--language python --under scripts/ --li
209214
Include compact code snippets in the retrieved context for richer rewrites (trades a bit of speed for quality):
210215

211216
````bash
212-
# Enable detail mode (adds short snippets)
217+
# Enable detail mode (adds short snippets) - works with questions
213218
scripts/ctx.py "Explain the caching logic" --detail
214219

220+
# Detail mode with commands - gets more specific implementation details
221+
scripts/ctx.py "Add error handling to ctx.py" --detail
222+
215223
# Adjust snippet size if needed (default is 1 line when --detail is used)
216224
make ctx Q="Explain hybrid search" ARGS="--detail --context-lines 2"
217225
````
218226

219227
Notes:
220228
- Default behavior is header-only (fastest). `--detail` adds short snippets.
221229
- If `--detail` is set and `--context-lines` remains at its default (0), ctx.py automatically uses 1 line to keep snippets concise. Override with `--context-lines N`.
230+
- Detail mode is optimized for speed: automatically clamps to max 4 results and 1 result per file.
231+
- Performance: ~12-15s with detail mode vs ~45-50s without optimization.
222232

223233
GPU Acceleration (Apple Silicon):
224234
For faster prompt rewriting, use the native Metal-accelerated decoder:

0 commit comments

Comments
 (0)