1. Install Ricursor for Claude Code
Run the installer from your repository root on macOS or Linux; Windows requires WSL and a compatible Claude Code environment. Use an authorized workspace key and an existing project’s exact name. The installer verifies access, installs Bun if needed, and writes .ricursor.json, .mcp.json and .claude/settings.json. It also configures Cursor and Codex. Existing unrelated settings are preserved, but Claude’s model settings are intentionally changed to Ricursor’s Cloudflare Qwen adapter.
curl -fsSL https://ricursor.com/install.sh | sh -s -- rcsk_YOUR_KEY "YOUR_PROJECT_NAME"
# Start a new Claude Code session from this repository:
claudeClaude Code must already be installed. SessionStart launches the local Messages adapter automatically; PreToolUse directs file changes through the broker and restricts shell commands. This documented setup uses Cloudflare Qwen, not Anthropic-hosted Claude inference. The key stays in ~/.ricursor/config.json; never paste it into agent chat or commit it. The install command may remain in shell history.
2. Retrieve project rules before changing files
Confirm Claude Code discovers ricursor_broker and the ricursor_context tool. Ask the agent to call it before planning a change and to read the actual result. The configured project is supplied by the broker, and the saved key selects the workspace. Relevant project rules and shared workspace rules can be returned together. Context is a selected set, not the entire inventory; an empty result can be valid when no applicable rules are saved.
Call ricursor_context from ricursor_broker before editing. Use:
{"project":"YOUR_PROJECT_NAME","task":"implement authentication respecting saved architecture rules"}
Show the returned workspace and applicable constraints. Do not edit yet.Inspect constraints, retrieval and cursor in structuredContent or the text JSON payload. Keep cursor for a subsequent since request with the same project, task and key; apply changed rules and delta.removed to the cached selection. A fresh session can retrieve the same saved memory. Retrieval is not a guarantee that every natural-language rule is mechanically enforced.
3. Follow the evidence-linked correction workflow
When a legitimate supported change conflicts with an applicable tracked boundary or policy, the broker can return status blocked, a group_id and reasons without writing the proposed change. The agent should use those reasons to correct its plan and save the lesson with ricursor_correct. Verification is automatic: Ricursor requires a blocked or review decision from the same key and project within the last 24 hours. Use the actual returned group_id or action_id; never fabricate evidence or deliberately damage a project to create a block.
After a real broker block, call ricursor_correct with:
{"project":"YOUR_PROJECT_NAME","action_id":"RETURNED_GROUP_ID_OR_ACTION_ID","rule":"A concise lesson derived from the actual block reasons."}
Then call ricursor_context again without since.
Use a task relevant to the saved lesson and inspect the returned rule.A successful save returns id, version, kind: correction and created. created: false can mean existing evidence or an identical rule was reused, not a failed save. Read-back is a separate check: look for the returned ID/rule; use ricursor rules export if targeted context omits it. Only one correction is accepted per evidence action. Apply the revised change through broker tools, respect final: true by stopping retries, and run appropriate tests. Evidence verifies linkage to a decision—not the truth of arbitrary code or model retraining. No Console approval is needed.
4. Complement native memory, don’t replace it
Claude Code already supports persistent instructions in CLAUDE.md or AGENTS.md and auto memory notes learned from corrections and preferences. Keep those existing files and notes. They provide native session context; Ricursor adds a shared, workspace/project-scoped rule service with targeted retrieval, version refreshes and evidence-linked corrections across connected agents. Memory rotation here means refreshing the relevant selection and replacing changed or removed rules, not training new model weights.
Native instructions: CLAUDE.md / AGENTS.md and scoped rules
Native auto memory: Claude Code’s repository learnings
Ricursor: shared project rules, correction evidence, retrieval and deltas
Broker/hooks: checked supported changes, separate from memory retrievalInstructions and memory are context, not universal execution enforcement. Ricursor’s installed hook refuses native file edits and directs supported JS/TS changes through write_file, delete_file or apply_changes. Its checks cover tracked structure and applicable policies; they do not guarantee arbitrary-code correctness or eliminate hallucinations. Preserve native memory rather than clearing it as a setup step.
5. Troubleshoot setup, blocks and read-back
Broker missing: open the configured repository, inspect .mcp.json and restart Claude Code. Startup failure: check the installed executable and Bun runtime, and ensure Claude uses the same machine/WSL environment. Missing hosted tools: verify API connectivity and key access; local write tools alone do not prove remote retrieval works. Wrong project: check .ricursor.json and re-run setup with the correct project name. Do not share the machine key file or exported private rules when seeking help.
~/.ricursor/bin/ricursor rules export
~/.ricursor/bin/ricursor rules export "YOUR_PROJECT_NAME"
Correction rejected? Check the actual evidence ID, same key/project,
and a blocked/review decision from the last 24 hours.
Cursor reset required? Request context without since.A native Write/Edit denial is the installed hook working: use the broker, don’t disable protection. Broker changes support JS/TS files; arbitrary shell writes and other file types are not a promised workflow. A correction absent from a task result may not rank in the selected set: use the full export to check persistence. An authentication/model error is not proof that memory failed; inspect the local adapter and Cloudflare response separately. Do not bypass a denial or spend credentials on repeated identical retries.
Native-memory reference: Claude Code’s official memory documentation.