ReCodeX
Turn research papers into executable code — and verify it actually works.
ReCodeX is a VS Code extension that transforms academic research papers (PDFs) into runnable code implementations. Simply upload a paper, provide optional instructions, and ReCodeX will analyze it and generate the corresponding source code files directly in your workspace.
Features
- PDF Upload: Select and upload research papers directly from VS Code
- Upload from URL: Paste an arXiv or direct PDF link to download and process
- Custom Instructions: Provide implementation guidance (e.g., "Implement in Python with type hints")
- Automatic Code Generation: Converts paper algorithms and methods into executable code
- Multiple Output Files: Generates complete project structure with source files, README, and dependencies
- Real-time Progress Tracking: Rotating status messages show what's happening during processing
- Cancel Anytime: Stop long-running operations with the cancel button
- Backend Health Monitoring: Live connectivity status indicator
- Secure File Handling: Path validation and sanitization for safe file operations
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (
Cmd+Shift+X / Ctrl+Shift+X)
- Search for "ReCodeX"
- Click Install
From Source
Clone the repository:
git clone https://github.com/Re-Code-X/recodex-extension.git
cd recodex-extension
Install dependencies:
npm install
Compile the extension:
npm run compile
Press F5 in VS Code to launch the Extension Development Host.
Requirements
- VS Code: Version 1.107.0 or higher
- Backend Service: A running ReCodeX backend server
Quick Start
- Click the ReCodeX icon (beaker) in the Activity Bar
- Click "Upload Research Paper" or "Upload from URL"
- Enter optional implementation instructions when prompted
- Wait for processing (watch the rotating progress messages!)
- Find your generated code in a new project folder
Uploading PDF Files
Method 1: Local File Upload
- Open the Command Palette (
Cmd+Shift+P / Ctrl+Shift+P)
- Type "ReCodeX: Upload Research Paper"
- Select your PDF file
- Enter implementation instructions (optional)
- Wait for code generation
Method 2: Upload from URL
- Open the Command Palette
- Type "ReCodeX: Upload from URL"
- Paste the PDF URL (e.g.,
https://arxiv.org/pdf/1706.03762.pdf)
- Enter implementation instructions (optional)
- Wait for code generation
- Click the ReCodeX icon in the Activity Bar
- Click "Upload Research Paper" or "Upload from URL"
- Follow the prompts
Custom Implementation Instructions
After selecting a file or URL, you'll be prompted to enter custom instructions:
Enter implementation instructions (optional)
e.g., Implement the main algorithm in Python with type hints
Examples:
- "Implement in PyTorch with GPU support"
- "Use TensorFlow 2.x with Keras API"
- "Focus on the attention mechanism from Section 3"
- "Include unit tests for all functions"
Press Enter with empty input to use default behavior, or Escape to cancel.
Cancelling Operations
Long-running operations can be cancelled:
- Click the Cancel button in the sidebar
- Or click the X on the VS Code notification
PDF Requirements
| Requirement |
Details |
| File Format |
PDF only (.pdf extension) |
| File Count |
One file at a time |
| File Size |
Supported up to 10-minute processing time |
| Content |
Research papers, academic articles, technical documents |
Progress Messages
During processing, you'll see rotating status messages that reflect actual backend steps:
- "Parsing research paper..."
- "Analyzing document structure..."
- "Identifying key algorithms..."
- "Designing project architecture..."
- "Generating file structure..."
- "Writing core implementation..."
- And more...
Generated Output
Each PDF generates a complete project directory:
your-workspace/
├── .recodex/
│ └── uploads/ # Original PDFs saved here
│ └── 2025-01-15T10-30-00_paper.pdf
│
└── paper_name/ # Generated implementation
├── src/
│ ├── model.py
│ ├── trainer.py
│ └── utils.py
├── tests/
│ └── test_model.py
├── requirements.txt
└── README.md # Auto-generated with summary & quick start
The auto-generated README includes:
- Summary: Overview of the implementation
- Project Structure: ASCII tree of all files
- Quick Start: Instructions to run the code
Troubleshooting
| Issue |
Cause |
Solution |
| "Backend unavailable" |
Backend server not running |
Start the backend server and verify connectivity |
| "Open a workspace folder" |
No folder open in VS Code |
Click "Open Folder" when prompted |
| Upload times out |
Very large/complex paper |
Try a simpler paper; processing can take up to 10 minutes |
| No files generated |
Backend processing error |
Check the ReCodeX output log for details |
| Operation cancelled |
User or network interruption |
Try again; check network connection |
Viewing Logs
- Click "View Logs" in the ReCodeX sidebar, or
- Open Output panel (
View → Output) and select "ReCodeX"
Backend API
ReCodeX communicates with a backend service that processes PDFs.
Endpoints
| Endpoint |
Method |
Description |
/ |
GET |
Health check |
/implement |
POST |
Upload PDF, receive generated implementation |
POST /implement
Content-Type: multipart/form-data
Form Fields:
- file: PDF binary data (required)
- query: Custom implementation instructions (optional)
- top_k_retrieve: Number of chunks to retrieve (optional)
- top_k_rerank: Number of chunks after reranking (optional)
{
"success": true,
"filename": "paper.pdf",
"chunks_count": 142,
"project_structure": "project/\n├── src/\n│ └── model.py\n└── README.md",
"summary": "Implementation of the Transformer architecture...",
"quick_start": "1. Install: pip install -r requirements.txt\n2. Run: python src/main.py",
"files": [
{
"filename": "src/model.py",
"content": "import torch\n..."
},
{
"filename": "requirements.txt",
"content": "torch>=2.0.0\n..."
}
],
"error": null
}
Development
Project Structure
recodex-extension/
├── src/
│ ├── api/
│ │ ├── backendClient.ts # HTTP client with abort support
│ │ └── types.ts # TypeScript interfaces
│ ├── commands/
│ │ ├── uploadPaper.ts # Local file upload handler
│ │ └── uploadFromUrl.ts # URL upload handler
│ ├── ui/
│ │ └── sidebarProvider.ts # Webview sidebar with cancel button
│ ├── utils/
│ │ ├── logger.ts # Output channel logging
│ │ ├── paths.ts # Path validation utilities
│ │ ├── pdf.ts # PDF file utilities
│ │ └── progressMessages.ts # Rotating progress messages
│ ├── workspace/
│ │ ├── fileWriter.ts # Safe file writing
│ │ └── projectLayout.ts # Project directory setup
│ └── extension.ts # Extension entry point
└── package.json
Available Scripts
| Script |
Description |
npm run compile |
Compile and bundle for development |
npm run package |
Build production bundle |
npm run watch |
Watch mode for development |
npm run lint |
Run ESLint |
npm run check-types |
TypeScript type checking |
npm test |
Run extension tests |
Security
- Path Traversal Prevention: Rejects paths containing
.. or absolute paths
- Filename Sanitization: Removes dangerous characters
- Workspace Boundary Enforcement: All files written within workspace only
- Content Security Policy: Webview restricted to extension resources
- Input Validation: All API responses validated before processing
- Request Cancellation: AbortController support for clean request termination
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add 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.md file for details.
Support