- Commit as you go - Make small, focused commits after completing each feature or fix
- Push when done - Push all commits to remote when finishing a task or session
- Rebuild when done - Run
cargo build --release(thejcodesymlink picks it up automatically) - Promote to stable release - Run
scripts/install_release.shto update the stable/release binary - Test before committing - Run
cargo testto verify changes - Bump version for releases - Update version in
Cargo.tomlwhen making releases
jcode uses auto-incrementing semantic versioning (v0.1.X).
Automatic (patch):
- Build number auto-increments on every
cargo build - Stored in
~/.jcode/build_number - Example:
v0.1.1→v0.1.2→v0.1.3...
Manual (major/minor):
- For big changes, manually update major/minor version in
Cargo.toml - Minor (0.1.x → 0.2.0): New features, significant enhancements
- Major (0.x.x → 1.0.0): Breaking changes to CLI, config, or APIs
The build also includes git hash and -dev suffix for uncommitted changes (e.g., v0.1.47-dev (abc1234)).
src/is the core library and CLI entry point (src/main.rs). Key areas includesrc/agent.rs,src/provider/,src/mcp/,src/tool/, andsrc/tui/.src/bin/holds auxiliary binaries:test_api.rs(Claude SDK smoke test) andharness.rs(tool harness).tests/e2e/contains integration tests and mock providers.scripts/includes helper scripts likeagent_trace.shandtest_e2e.sh.- Docs live in
README.md,OAUTH.md, andCLAUDE.md.
cargo install --path .: install the local CLI.cargo build --release: rebuild latest (jcode on PATH picks it up automatically).scripts/install_release.sh: promote current build to stable/release.jcode: launch the TUI.jcode serve/jcode connect: start the daemon and attach a client.cargo test: run unit + integration tests.cargo test --test e2e: run only end-to-end tests.cargo run --bin test_api: Claude Code CLI smoke test.cargo run --bin jcode-harness -- --include-network: exercise tool harness with optional network calls.scripts/agent_trace.sh: end-to-end agent trace (setJCODE_PROVIDER=openai|claude).
- Logs are written to
~/.jcode/logs/(daily files likejcode-YYYY-MM-DD.log).
- Server exposes a debug socket for automation/introspection (default: main socket name with
-debug.socksuffix). - Enable debug control with
JCODE_DEBUG_CONTROL=1(or run in self-dev mode); then senddebug_commandrequests. - Protocol is newline-delimited JSON; see
Request::DebugCommandinsrc/protocol.rs.
~/.local/bin/jcodeis a symlink totarget/release/jcode— always the latest build from source.~/.jcode/builds/stable/jcodeis the stable/release binary, updated byscripts/install_release.sh.- Ensure
~/.local/binis before~/.cargo/bininPATH.
- Rust 2021 style; format with
cargo fmt. - Files/modules use
snake_case; types/traits useCamelCase; functions usesnake_case. - Keep CLI flags and subcommands consistent with existing
clappatterns.
- Unit tests live alongside modules under
src/using#[cfg(test)]. - Integration and provider mocks live in
tests/e2e/. - Before shipping changes that affect providers, run
cargo testandcargo run --bin test_api. - Use
scripts/test_e2e.shfor a full preflight (binary check + targeted suites). - Manual testing - After making TUI changes, manually test in a real terminal to verify behavior.
- Commit messages are concise, imperative, and often start with verbs like “Add …” or “Fix …” (sometimes
Fix:prefixes). - PRs should include a short summary, rationale, and the exact test commands run.
- Note which provider you validated (
openaiorclaude) and update docs when CLI behavior changes.
- If you see unexpected local changes, assume they are likely from another active agent.
- Work alongside those changes; do not stop solely because the tree changed unexpectedly.
- Do not revert or overwrite another agent’s edits unless explicitly asked.
- OAuth credentials live at
~/.codex/auth.jsonand~/.claude/.credentials.json; never commit secrets. - For Claude SDK usage, set
JCODE_CLAUDE_SDK_PYTHONas documented inCLAUDE.md.