Quickctx
Quickly extract file contents and code context to share with LLMs.
Quickctx is designed for one thing: getting your code into LLM conversations as fast as possible. Point it at files or directories, and instantly get markdown-formatted output ready to copy/paste into ChatGPT, Claude, or any other LLM.
Why Quickctx?
When working with LLMs on code, you need to:
- Share multiple files at once without manually copying each one
- Provide proper context (file paths, language syntax highlighting)
- Quickly extract symbols and documentation for deeper analysis
- Get files back out after the LLM generates or modifies them
Quickctx does all of this in a single command.
Features
Core Features
- Copy multiple files into a single markdown document, ready to paste
- Paste files from markdown back to the filesystem (bidirectional workflow)
- Analyze code using Language Server Protocol (LSP) to extract symbols, types, and documentation
- Fast - optimized for quick context extraction, respects
.gitignoreby default
Copy & Paste
- Multiple output formats (simple, comment-style, heading-style)
- Smart fence detection - automatically avoids code fence conflicts
- Gitignore support - respects
.gitignorepatterns by default - Language detection - automatic syntax highlighting based on file extension
Analysis Features
- Auto-detection - automatically detects project root and language type
- LSP integration - uses existing LSP servers (rust-analyzer, pylsp, etc.)
- Symbol extraction - functions, methods, types, variables, and global symbols
- Documentation - retrieves doc comments and hover information
- Multiple formats - markdown (human-readable), JSON, CSV, compact, symbol-list
- Caching - symbol cache for improved performance
- Diagnostics - optional error and warning reporting
- Symbol filtering - extract only specific symbols
Installation
Package Managers (Recommended)
Homebrew (macOS/Linux):
Scoop (Windows):
scoop bucket add caddyglow https://github.com/CaddyGlow/homebrew-packages
scoop install quickctx
See INSTALL.md for detailed installation instructions and other methods.
Using Install Script
Unix-like systems (Linux, macOS, Android/Termux):
|
Or with wget:
|
Windows (PowerShell):
irm https://raw.githubusercontent.com/CaddyGlow/quickctx/main/install.ps1 | iex
Custom installation directory:
# Unix-like systems - set QUICKCTX_INSTALL_DIR
|
For manual installation or troubleshooting, see install.sh or install.ps1.
From Cargo
# Install from crates.io
# Or use cargo-binstall for faster binary installation
This installs both quickctx and quickctx-analyze binaries.
From Source
The binaries will be available at:
target/release/quickctxtarget/release/quickctx-analyze
Updating
Quickctx includes a built-in self-update feature:
# Check for updates
# Install latest version (interactive)
# Install without confirmation
Quickctx automatically checks for updates every 7 days and notifies you if a new version is available.
Quick Start
Typical LLM Workflow
1. Extract files to clipboard:
# Get all source files, copy output to clipboard
| | |
# Or save to file first
2. Paste into your LLM conversation (ChatGPT, Claude, etc.)
3. Get generated/modified code back:
# Paste the LLM's response back to files
Common Commands
Copy specific files:
Copy entire directory:
Copy with glob patterns:
Choose output format:
Analyze code symbols:
# Get function signatures, types, and documentation
Usage
Copy Mode
)
)
Paste Mode
)
Analysis Mode
<FILE>... )
)
)
)
)
Output Formats
Copy Formats
Simple Format
file.c
```c
int main() {
}
#### Comment Format
```markdown
```c
// src/main.c
int main() {
return 0;
}
#### Heading Format
```markdown
## `src/main.c`
```c
int main() {
return 0;
}
### Analysis Formats
#### Markdown Format
```markdown
# Code Analysis: `src/lib.rs`
## Functions
### `run` (Function)
**Signature:** `fn(cfg: RuntimeConfig) -> Result<()>`
**Location:** Line 42-58
**Documentation:** Main entry point for the application...
---
JSON Format
Compact Format
One-line summaries per symbol for quick scanning.
CSV Format
Structured data for spreadsheet analysis:
file,name,kind,signature,line_start,line_end
src/lib.rs,run,Function,"fn(cfg: RuntimeConfig) -> Result<()>",42,58
Symbol List Format
Simple list of symbol names, one per line.
Smart Fence Detection
Quickctx automatically detects code fences in your files and adjusts the delimiter to avoid conflicts:
Input file contains:
```rust
let x = 42;
```
Output uses 4 backticks:
example.md
````markdown
```rust
let x = 42;
```
````
Gitignore Support
By default, quickctx respects .gitignore files:
# Respects .gitignore (default)
# Include ignored files
# Use custom ignore file
# Add additional exclude patterns
Configuration File
Create a quickctx.toml file for project-specific settings:
[]
= 1
[]
# Copy mode settings
= ["src/", "tests/"]
= "heading"
= "backtick"
= true
= ["*.tmp", "*.bak"]
# output = "project.md"
# ignore_files = [".customignore"]
[]
# Paste mode settings
# output_dir = "restored/"
= "skip"
[]
# Optional: default output format
= "markdown"
# Additional paths to search for LSP server binaries
# These paths will be prepended to PATH when spawning LSP servers
# Supports tilde expansion (e.g., ~/.local/bin)
= [
"~/.local/share/nvim/mason/bin", # Mason LSP servers
# "~/mycode/.venv/bin", # Python virtual environment
]
# LSP server commands/paths by language
[]
= "rust-analyzer"
= "pyright-langserver --stdio"
= "typescript-language-server --stdio"
= "typescript-language-server --stdio"
= "gopls"
Use it with:
# Config file is loaded automatically if quickctx.toml exists
# Or specify a custom config file
Binary Search Paths
The bin_paths configuration in [analyze] allows you to extend the PATH when searching for LSP server binaries. This is useful for LSP servers installed in non-standard locations:
- Mason (neovim package manager):
~/.local/share/nvim/mason/bin - Python virtual environments:
~/myproject/.venv/bin - Custom installations:
~/.local/bin,/opt/lsp-servers/bin
Features:
- Tilde expansion:
~/is automatically expanded to your home directory - Prepended to PATH: These paths are added before the existing PATH
- Multiple paths: Add as many directories as needed
Configuration Priority
Settings are applied in this order (highest to lowest priority):
- CLI arguments - highest priority
- Configuration file -
quickctx.tomlor--configfile - Built-in defaults - lowest priority
Requirements
For Copy/Paste Operations
No additional dependencies required.
For Analysis
You need the appropriate LSP server installed for your language:
- Rust:
rust-analyzer(usually installed with rustup) - Python:
pylsporpyright-langserver - TypeScript/JavaScript:
typescript-language-server - Go:
gopls
Examples
Example 1: Working with LLMs
Get your code into an LLM conversation:
# Quick: pipe directly to clipboard
|
# Or save to file and review first
# Include specific files only
|
# Get detailed symbol analysis for complex refactoring
Then paste into ChatGPT/Claude with a prompt like:
"Here's my codebase. Can you help me refactor the error handling to use a custom Result type?"
Example 2: Share Code Snippets
Share project files with colleagues or in bug reports:
Example 3: Documentation
Paste code examples from documentation:
Example 4: Project Templates
Create and instantiate project templates:
# Copy template
# Paste template
Example 5: Code Analysis
Generate comprehensive code analysis:
# Analyze all source files
# Extract just function names
# Get diagnostics
# Filter specific symbols
Example 6: Multiple Files Analysis
Analyze multiple files efficiently:
# Analyze all files in one pass (shares LSP server)
# Use glob pattern with find
Use Cases
- Working with LLMs: The primary use case - quickly copy your codebase into ChatGPT, Claude, or other AI assistants for code reviews, debugging, refactoring, and feature development
- Code Reviews: Share multi-file context with reviewers without juggling multiple attachments
- Bug Reports: Create minimal reproducible examples with all necessary files in one block
- Documentation: Embed live code examples that can be extracted and run
- Project Exploration: Quickly understand unfamiliar codebases by analyzing symbols and structure
- Templates: Distribute project scaffolds as single markdown files
- Teaching: Create code tutorials with complete, executable examples
- Migration: Move code snippets between projects with full context
Building from Source
Prerequisites
- Rust 1.70 or higher (Rust 2024 edition)
Build
Run Tests
# Run all tests
# Run specific test
# Run tests with output
Code Quality
# Lint with Clippy
# Format code
# Check formatting
How It Works
Copy & Paste Operations
- Copy: Walks directory tree respecting gitignore → loads file contents → renders to markdown with smart fence detection
- Paste: Parses markdown with pulldown-cmark → detects file paths from format-specific patterns → writes files with conflict handling
Analysis
- Project Detection: Walks up directory tree to find project markers (Cargo.toml, package.json, etc.)
- LSP Server: Spawns appropriate LSP server as subprocess
- JSON-RPC Communication: Communicates with server over stdin/stdout using JSON-RPC 2.0
- Symbol Extraction: Requests document symbols and hover information
- Caching: Stores results for improved performance on repeated analysis
- Formatting: Renders output in selected format (markdown, JSON, CSV, etc.)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by the need to share code context with AI assistants
- Built with modern Rust 2024 edition best practices
- Uses the excellent
ignorecrate for gitignore support - LSP integration for accurate, language-aware code analysis
Support
If you encounter any issues or have questions, please open an issue.