DocumentationGetting started
Start here
Getting started
With cstudy and the toolchains installed, create a workspace, set it up, and take one problem from cstudy next to cstudy done.
On this page
Create a workspace
You practise in a workspace: a directory of your own for your solutions, notes and progress, separate from cstudy itself. Create one anywhere:
cstudy init ~/cstudy-workspace --git # --git runs git init; cstudy never commits
cd ~/cstudy-workspacecstudy init copies the practice projects and writes the project files for VS Code and IntelliJ IDEA. It installs nothing yet. It refuses to create a workspace inside another one.
| Path | What it holds |
|---|---|
python/ | The Python project: pyproject.toml, uv.lock and your solutions in practice/ |
typescript/ | The TypeScript project: package.json, tsconfig.json and practice/ |
jvm/ | The Gradle wrapper with the java/ and kotlin/ projects |
go/, rust/ | The Go module and the Cargo package, plus go.work at the root |
projects/ | One folder per project problem you start |
notes/ | Your answers to system design and code review prompts |
problems/ | Problems you write yourself |
sets.yaml | Your problem sets, once you make one |
.archive/ | Earlier attempts, moved aside by --fresh and by reviews |
.vscode/, .idea/ | Editor project files, yours to edit |
progress.db | Your attempts, reviews and benchmarks, in SQLite; ignored by git |
Run cstudy anywhere inside the workspace. From elsewhere, point at it with cstudy --workspace PATH or the CSTUDY_WORKSPACE environment variable.
Set it up with cstudy doctor
cstudy doctor checks every toolchain and the workspace, and cstudy doctor --fix sets up the projects: it runs uv sync in python/, pnpm install in typescript/, and a first Gradle build in jvm/. Go and Rust need no setup step.
cstudy doctor --fixEach line is ok, WARN (not blocking) or FAIL (blocks practice), with a fix: hint when there is one. Here, in a new workspace, the Python and TypeScript projects are not set up yet; ... stands for rows left out:
$ cstudy doctor
ok python 3.13.2
ok uv 0.10.11
ok node v24.18.0 (type stripping)
ok pnpm 9.15.9
ok java 25.0.5 (JAVA_HOME)
...
ok content /home/me/.local/share/uv/tools/coding-study/lib/python3.13/site-packages/coding_study/content (bundled)
ok installs uv tool 0.49.0 (~/.local/bin/cstudy)
ok workspace /home/me/cstudy-workspace (created with cstudy 0.49.0)
...
FAIL python/.venv missing fix: cstudy doctor --fix
FAIL typescript/node_modules missing fix: cstudy doctor --fix
...
FAIL runner python the Python workspace is not set up (python/.venv/bin/python is missing): run `uv sync --directory python` fix: cstudy doctor --fix
ok runner kotlin answers hello: jvm 25.0.5, protocol 1, stress, project, project-stress
...A missing Node.js, pnpm or JDK, or a JDK outside 21 to 26, shows as FAIL, and a missing Go or Rust as WARN; the other languages still work. Troubleshooting lists the common rows and their fixes.
Your first problem
Pick one
cstudy next suggests what to practise and prints the command that starts it. Or start any problem by its slug; cstudy list browses the catalog, and --search, --domain, --role and --scope narrow it.
$ cstudy next
new koko-eating-bananas (medium · binary-search) weakest pattern: binary-search (0.75)
start cstudy start koko-eating-bananas --lang kotlinStart it
cstudy start writes a stub with the right signature and a short summary of the problem into the language’s project, renders the statement to .statements/, and opens both in $VISUAL or $EDITOR. Without --lang it uses your default language, Python unless you change it.
$ cstudy start two-sum --lang kotlin
two-sum · easy · arrays-hashing · kotlin
stub jvm/kotlin/src/main/kotlin/practice/two_sum/Solution.kt
statement .statements/two-sum.md
next cstudy test --watchSolve it in your editor
Open the workspace root in your editor, so its language server finds every project. In VS Code and IntelliJ IDEA every cstudy action is also a task or run configuration; see Editors and debugging.
Test it
cstudy test --watch runs your code against the cases each time you save. Visible cases are always listed. Passing hidden cases collapse into a count; a failing one shows its input, the expected answer and yours.
$ cstudy test --time-limit
two-sum · kotlin · 16 cases (2 visible, 13 hidden, 1 generated) · time limit 5x · timer 12:31 / 25:00
build 1.8s (gradle, warm)
PASS ex1 0.04ms
PASS ex2 0.03ms
FAIL h1 hidden
input nums=[-3, 8, 0, 3] target=0
expected [0, 3] (unordered)
actual [2, 2]
note negatives and zero
TLE g1 hidden · 412ms > limit 95ms (5x hash-map, calibrated)
PASS 12 hidden cases
14/16 passed · 1 failed · 1 tle · total 2.6sThis run also had a time limit, which is off unless you ask for it with --time-limit: the generated case at the largest size took longer than 5 times the reference solution. The statuses are explained in Practising.
Ask for a hint, if you want one
$ cstudy hint
two-sum · hint 1 of 3
Fix one element. Which single value would complete the sum with it?Hints are counted: an attempt with a hint can be graded at most ok.
Finish it
Once every case passes, finish the attempt with how it went: easy, ok or hard. If it never passed, finish with --gave-up. cstudy computes a grade and schedules the next review.
$ cstudy done --rating ok
two-sum · kotlin · passed · 18m 40s · rating ok · hints 0
next review 2026-10-27 (in 3 days) · ease 2.50Now compare your code with the reference: cstudy solution two-sum shows the optimal approach with its explanation, and --all shows every approach on the problem’s complexity ladder. When the problem is due again, cstudy next brings it back.
Your workspace is your repository
The workspace holds your practice files, notes, previous attempts, your problem sets and your own problems. Version it in a git repository of your own: its .gitignore already leaves out per-machine state such as progress.db and build output.
Back up your progress with cstudy export, which writes progress-export.json at the workspace root for you to commit. On another machine, clone the workspace, run cstudy doctor --fix, and restore the progress with cstudy import.
Note
cstudy import only fills an empty progress.db; it never merges two histories.
Where to go next
- Practising: the daily loop in detail, reviews, benchmarks, mock interviews and stats.
- Problem kinds and tracks: progressive, concurrent, debugging and project problems.
- Problem sets: your own lists of problems to study from.
- Practising in the browser: the same loop on a local page, with
cstudy serve. - Configuration: your default language, time limits and which tracks
cstudy nextpicks from.
Written for cstudy 0.49.0. The specs in the cstudy repository are the source of truth for every detail.