Click the Competitive Companion button on any problem page (Codeforces, AtCoder, CSES, LeetCode, etc.).
The test case inputs are automatically written to input.txt next to your active file.
Features
Saves where you work: Writes input.txt in the folder of your currently active file (or workspace root).
Run code with Ctrl+Enter: Press Ctrl+Enter (Cmd+Enter on macOS) to instantly compile and run your code with input fed directly from input.txt in the terminal.
Multi-language support: Built-in support for C++, C, Python, Java, Rust, Go, JavaScript, TypeScript, and Kotlin, with customizable commands.
Flexible format: Combine all sample test cases or save only the first test case.
Optional expected output: Can also save sample outputs into output.txt.
Status bar & menu: Click the status bar item to run code, toggle the listener, open input.txt, or clear it.
Running Code from input.txt
When working on a problem, press Ctrl+Enter (Cmd+Enter on macOS) inside your code file (or while editing input.txt):
Automatically saves any unsaved changes in your solution and input.txt.
Compiles (if necessary) and runs the code in a dedicated terminal (CP Input TXT).
Passes input.txt into standard input (< input.txt).
Supported Placeholders in Commands
You can customize run commands for any language in settings using these placeholders:
${file}: Full path to the active code file
${fileBasename}: File name with extension (e.g. solution.cpp)
${fileBasenameNoExtension}: File name without extension (e.g. solution)
${fileDirname}: Directory containing the file
${fileExtname}: File extension (e.g. .cpp)
${inputFile}: Full path to the input file
${inputFileName}: Name of the input file (e.g. input.txt)
Settings
Setting
Default
Description
cpInputTxt.runOnCtrlEnter
true
Run code with input.txt in the terminal when pressing Ctrl+Enter
cpInputTxt.runCommands
(built-in defaults)
Custom compile and run command templates per language ID (cpp, python, java, etc.)
cpInputTxt.customRunCommand
""
Global custom command override for all languages
cpInputTxt.saveBeforeRun
true
Automatically save files before running
cpInputTxt.clearTerminalBeforeRun
false
Clear the terminal before executing run commands
cpInputTxt.port
10045
Port to receive data from Competitive Companion
cpInputTxt.fileName
input.txt
Target file name for inputs
cpInputTxt.saveLocation
activeFolder
Where to save (activeFolder or workspaceRoot)
cpInputTxt.testCaseFormat
all
Save all test cases (all) or first only (first)
cpInputTxt.openOnSave
false
Automatically open input.txt after receiving test cases