Retorec Agent OS

The complete operator guide for the Retorec AI workforce — covering infrastructure setup, the memory & learning system, 184 specialized agents, human intelligence profiles, Microsoft 365 integration, the Scrum Backlog via Microsoft Lists, and the Telegram project inbox with !go action triggers.

Version 2.5  ·  May 2026  ·  Written for Mohammad Binsabt Al Saeed & Fadi Jalajel

What Is This Guide?

Retorec Agent OS is the operating infrastructure for the Retorec AI workforce. It is not a single tool — it is four interconnected systems that work together to make every Claude Code session smarter, better-equipped, and more integrated with the way your team actually works.

System What it does Where to find it
Memory System Extracts lessons, summaries, and task progress from every session into a reviewed knowledge base. A weekly synthesis layer compresses approved lessons into reusable skills agents follow going forward. Memory System →
Retorec Agents 184 specialized Claude Code agents covering every function — engineering, marketing, design, sales, finance, game development, and more. Installed once, available in every session by role name. Infrastructure →
Human Profiles A silent observation layer that builds living profiles of each team member — their knowledge areas, communication style, work patterns, and decisions — from every session they appear in. Human Profiles →
M365 Integration A custom MCP server that gives agents direct access to OneDrive files, Excel workbooks, and the ability to generate professional Word documents and PowerPoint presentations on demand. M365 Integration →
Scrum Backlog A full Scrum backlog stored in Microsoft Lists (SharePoint) — zero extra cost. Agents create epics, stories, tasks, and bugs; move items through sprints; and render live sprint boards via natural language. Scrum Backlog →
Telegram Inbox A per-project Telegram bot that receives founder messages — text, voice, images, files, and videos. Classifies and saves everything to a shared SharePoint List. Prefix with !go to execute instructions immediately without review. Telegram Inbox →
Table 1 — Retorec Agent OS Systems at a Glance
Start with Infrastructure. GitHub SSH setup, agent installation, and machine configuration must be done before anything else. Once that is complete, the memory system activates automatically and the other systems are ready to use.

Agent vs Subagent

These two terms appear throughout the guide and in Claude Code daily — and they are easy to confuse because they sound similar but refer to completely different mechanisms.

Agent definitions — persona switches within one session

The 184 agents in retorec-agents/ are .md files. Each one contains a persona: a name, a role, a set of instructions, and a specialization. When Claude Code loads one, it changes how it thinks and communicates for the rest of that conversation. It is still one process, one session, one context window. No new process is started. The agent definition is simply a behavior layer on top of Claude.

You switch agents by typing a slash command (e.g. /ui-designer) or by naming the agent in a prompt. The same session continues — history is preserved, tools are the same, context accumulates. Switching from a Backend Architect agent to a UI Designer agent in the middle of a session is like handing the keyboard to a different specialist without leaving the room.

Subagents — separate Claude processes spawned on demand

A subagent is a completely separate Claude Code process. It is spawned when Claude uses the Agent tool internally, typically to handle a parallel or isolated task. Each subagent gets its own context window and starts with no memory of the parent session. It cannot see what you discussed earlier, it cannot read the parent's work-in-progress, and it does not share state. When it finishes, it returns one result back to the parent.

Subagents are useful for parallelizing independent research, running long tasks without bloating the main context, or getting a genuinely fresh second opinion. You will see them referenced in this guide when the Agents Orchestrator or Explore agents spawn workers to handle sub-tasks simultaneously.

Agent Definition Subagent
What it is A .md persona file that changes Claude's behavior A separate Claude process spawned via the Agent tool
Session Same session — context is shared and preserved New session — no memory of the parent, fresh context
How to trigger Slash command or naming the agent in a prompt Automatically, when Claude decides a task benefits from isolation
Memory hooks One set of hooks fires at the end of the session Subagent sessions may also trigger hooks if configured
Common use Switching roles mid-project (design → engineering) Parallel research, isolated code review, long background tasks
Table 2 — Agent Definition vs Subagent
In practice, you almost always work with agent definitions — switching roles within your current session. Subagents fire behind the scenes when Claude decides a task is better handled in isolation. You do not need to configure subagents manually.

GitHub SSH Setup

Retorec uses a shared GitHub account (github@retorec.com) for all repositories. Both founders connect to it using their own SSH key — one key per machine, all pointing to the same account. Commits are still attributed to each person's individual Retorec email.

Fadi's MacBook fadi.jalajel@retorec.com 🔑 id_ed25519_retorec Mohammad's MacBook mohammad@retorec.com 🔑 id_ed25519_retorec SSH SSH GitHub github@retorec.com retorec-agent-os retorec-agents projects / repos... One GitHub account · Each person has their own SSH key · Commits attributed individually
Figure 1 — Two machines, one shared GitHub account, individual SSH keys

Fadi's setup (already complete)

Fadi's machine has two SSH keys configured — a personal key and a Retorec key — with an SSH config that routes github-retorec to GitHub using the Retorec key. All Retorec repo remotes use git@github-retorec:Retorec/repo.git. No action needed on Fadi's side.

Fadi Jalajel — Setup Complete ✓
Fadi's MacBook
🔑~/.ssh/id_ed25519_retorec
🔑~/.ssh/id_ed25519 (personal)
Mohammad — Setup Needed
Mohammad's MacBook
🔑~/.ssh/id_ed25519_retorec (to create)

Mohammad — step by step

1

Generate the Retorec SSH key

Run this in Terminal. The -f flag names the file so it doesn't overwrite any existing key.

ssh-keygen -t ed25519 -C "github@retorec.com" -f ~/.ssh/id_ed25519_retorec

Press Enter through all prompts to accept defaults (no passphrase needed).

2

Add SSH config entry

Open ~/.ssh/config (create it if it doesn't exist) and add:

# Retorec GitHub
Host github-retorec
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519_retorec
  AddKeysToAgent yes
  UseKeychain yes

This tells SSH to use the Retorec key whenever you connect to github-retorec.

3

Copy your public key and send it to Fadi

cat ~/.ssh/id_ed25519_retorec.pub

Copy the entire output (one long line starting with ssh-ed25519) and send it to Fadi.

4

Fadi adds Mohammad's key to GitHub

Fadi logs into GitHub as github@retorec.com, goes to Settings → SSH and GPG keys → New SSH key, pastes the key, and names it "Mohammad MacBook".

Only someone already logged into the GitHub account can add new SSH keys. This is a one-time action.
5

Test the connection

ssh -T git@github-retorec

You should see: Hi Retorec! You've successfully authenticated, but GitHub does not provide shell access.

That message is correct — it means the key works.

6

Clone Retorec repos using the correct host alias

Always use github-retorec (not github.com) when cloning Retorec repos:

git clone git@github-retorec:Retorec/retorec-agent-os.git ~/Retorec/retorec-agent-os
git clone git@github-retorec:Retorec/retorec-agents.git ~/Retorec/retorec-agents
If you clone with github.com instead of github-retorec, git will use the wrong SSH key and authentication will fail. Always use the alias.
7

Set your Retorec git email globally

git config --global user.email "mohammad.binsabt@retorec.com"
git config --global user.name "Mohammad Binsabt Al Saeed"

This ensures your commits are attributed to your Retorec identity, not a personal email.

Let Claude Code Do This For You paste into a new Claude Code session

Instead of following the manual steps above, paste this prompt into Claude Code and it will generate the SSH key, write the config file, and display the public key for you to hand off to Fadi.

Prompt to paste
Set up GitHub SSH access for my Retorec machine. Do the following steps in order:

1. Generate a new SSH key at ~/.ssh/id_ed25519_retorec using ed25519, with the comment "github@retorec.com" and no passphrase.
2. Add the key to the SSH agent (ssh-add ~/.ssh/id_ed25519_retorec).
3. Add this block to ~/.ssh/config (create the file if it doesn't exist, don't overwrite existing content):

Host github-retorec
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519_retorec
  AddKeysToAgent yes
  UseKeychain yes

4. Print the full public key so I can copy it and send it to Fadi.
5. Tell me exactly what to say to Fadi so he can add it to GitHub.

Do not proceed past step 4 until I confirm Fadi has added the key. After I confirm, run: ssh -T git@github-retorec and show me the result.
Steps you still need to do yourself
  • Send the public key to Fadi — Claude will print it; you copy and message it to him.
  • Wait for Fadi to add it to GitHub — only someone logged into the github@retorec.com account can do this.
  • Tell Claude "done" — then it will test the connection and confirm it works.
  • Set your git email — run git config --global user.email "mohammad.binsabt@retorec.com" (Claude can do this too if you ask).
GitHub setup complete. From this point Mohammad can push, pull, and clone all Retorec repositories using the shared account, with commits attributed to his Retorec email.

Installing Retorec Agents

The retorec-agents repository contains 184 specialized Claude Code agents covering every function Retorec works in — from engineering and design to marketing, sales, finance, and beyond. Installing them gives every Claude Code session access to the full Retorec AI workforce. Agents are stored as markdown files and load automatically when you activate them by name during a session.

Prerequisite: GitHub SSH must be set up first. The clone command uses the github-retorec SSH alias — if that is not configured on your machine, complete the GitHub SSH Setup section before continuing.

Agent Categories

The 184 agents are organized into 14 functional categories:

engineering
Backend, frontend, mobile, DevOps, security, databases, APIs
29 agents
specialized
Domain-specific experts: legal, medical, finance, government, compliance
41 agents
marketing
Content, SEO, social media, email, brand, growth, paid media
30 agents
game-development
Unity, Unreal, Godot, Roblox — design, engineering, art pipeline
20 agents
design
UI, UX, visual storytelling, accessibility, inclusive design
8 agents
sales
Deal strategy, outbound, discovery coaching, pipeline analysis
8 agents
testing
QA, API testing, performance benchmarking, evidence collection
8 agents
finance
FP&A, bookkeeping, investment research, tax strategy
5 agents
product
Product management, sprint planning, roadmap, UX research
5 agents
academic
Research, study abroad advising, corporate training design
5 agents
support
Customer service, healthcare, hospitality, retail returns
6 agents
project-management
Project shepherd, sprint prioritizer, incident response
6 agents
spatial-computing
visionOS, XR interfaces, Metal rendering, cockpit interactions
6 agents
paid-media
Google Ads, Meta, programmatic, tracking, attribution
7 agents

Installation Steps

1

Clone the retorec-agents repository

Run this once. The repo lives at ~/Retorec/retorec-agents/.

Terminal
git clone git@github-retorec:Retorec/retorec-agents.git ~/Retorec/retorec-agents
Must use github-retorec, not github.com. The alias routes the connection through the Retorec SSH key. Using the plain github.com hostname will fail with a permission denied error.
2

Run the install script

This copies all 184 agent files from the category directories into ~/.claude/agents/.

Terminal
cd ~/Retorec/retorec-agents
./scripts/install.sh --tool claude-code

You will see output like:

[OK]  Claude Code: 184 agents -> /Users/you/.claude/agents
3

Restart Claude Code

Claude Code loads agents at startup. Quit and reopen it — or if using the CLI, just close the session and start a new one. No other configuration needed.

Verifying the Install

After restarting, open Claude Code and type the prompt below. Claude will respond as the Engineering agent, confirming the agents are active and loaded.

verification prompt type this in Claude Code after restarting
Prompt to type
List the names of 5 agents that are available in your agent roster, one from each of these categories: engineering, marketing, design, sales, and finance.
Expected: Claude responds with 5 specific agent names from those categories — for example Backend Architect, SEO Specialist, UI Designer, Deal Strategist, and FP&A Analyst. If Claude says it has no agent roster or cannot find those categories, the install did not take effect — confirm you restarted Claude Code after running the script.

You can also verify the files landed on disk:

Terminal
ls ~/.claude/agents/ | wc -l    # should print 184
ls ~/.claude/agents/ | head -10  # sample of installed agents

Keeping Agents Updated

The retorec-agents repo is updated regularly as new specialists are added and existing agents are refined. Run the following two commands to pull the latest and reinstall:

Terminal — run whenever you want the latest agents
cd ~/Retorec/retorec-agents
git pull
./scripts/install.sh --tool claude-code

Then restart Claude Code. The install script overwrites existing agent files, so you always end up with the current version. No manual cleanup needed.

Let Claude Code Do This For You paste into a new Claude Code session

Claude can clone the repo and run the install script for you. Paste this into any Claude Code session that has shell access — it handles both first-time install and updates.

Prompt to paste
Install (or update) the Retorec agents on this machine. Do the following:

1. Check if ~/Retorec/retorec-agents/ already exists.
   - If it does not exist: clone it with git clone git@github-retorec:Retorec/retorec-agents.git ~/Retorec/retorec-agents
   - If it already exists: run git pull inside that directory to fetch the latest agents.
2. Run: cd ~/Retorec/retorec-agents && ./scripts/install.sh --tool claude-code
3. Confirm how many agents were installed and where they landed.
4. Tell me I need to restart Claude Code for the agents to be available, and remind me to do so.
Steps you still need to do yourself
  • GitHub SSH must be set up first — the clone uses the github-retorec alias; if SSH is not configured, the clone will fail.
  • Restart Claude Code after the script finishes — Claude cannot restart itself; agents only load at session startup.
Agents installed. From this point every Claude Code session has access to the full 184-agent Retorec workforce. To activate a specific agent, just mention its role in your prompt — for example "act as the Deal Strategist" or "switch to the UI Designer agent."

Prerequisites

Before setting up a new machine, confirm these are installed:

Check in Terminal
node --version      # need v18 or higher
npm --version       # comes with Node
python3 --version   # used by the review scripts
git --version       # need git configured

If node is missing, install it from nodejs.org (LTS version).

Also confirm Claude Code is installed:

claude --version    # should return a version number
Git identity matters. The system uses git config user.email to identify which developer ran each session. Set it to your Retorec email before doing anything else:

git config --global user.email "mohammad.binsabt@retorec.com"

One-Time Machine Setup

Do this once per machine. Takes about 5 minutes.

1. Clone retorec-agent-os 2. npm install memory/scripts/ 3. Hook config ~/.claude/settings.json 4. Get .env credentials from Fadi ✓ Done hooks fire automatically
Figure 2 — Machine setup — 4 steps, done once per machine
1

Clone retorec-agent-os

mkdir -p ~/Retorec
git clone git@github-retorec:Retorec/retorec-agent-os.git ~/Retorec/retorec-agent-os

If already cloned, pull the latest:

cd ~/Retorec/retorec-agent-os && git pull
2

Install npm dependencies for the global hook scripts

cd ~/Retorec/retorec-agent-os/memory/scripts
npm install

This installs two packages: @anthropic-ai/sdk (for synthesis) and dotenv (for loading env files).

3

Configure Stop hooks in Claude's global settings

Open or create ~/.claude/settings.json. Replace YOUR_USERNAME with your actual username (run echo $USER to find it).

{
  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "node /Users/YOUR_USERNAME/Retorec/retorec-agent-os/memory/scripts/extract-lessons.js"
          },
          {
            "type": "command",
            "command": "node /Users/YOUR_USERNAME/Retorec/retorec-agent-os/memory/scripts/save-session-summary.js"
          },
          {
            "type": "command",
            "command": "node /Users/YOUR_USERNAME/Retorec/retorec-agent-os/memory/scripts/save-session-progress.js"
          },
          {
            "type": "command",
            "command": "node /Users/YOUR_USERNAME/Retorec/retorec-agent-os/memory/scripts/extract-person-observations.js"
          }
        ]
      }
    ]
  }
}
If settings.json already has content (like plugins), add only the "hooks" block — do not replace the whole file. Merge carefully.
4

Create the .env file with credentials

Get these values from Fadi. Create ~/Retorec/retorec-agent-os/.env:

SUPABASE_URL=https://nkdbaavjmrqkdpzzkrsr.supabase.co
SUPABASE_ANON_KEY=<from Fadi>
RETOREC_API_KEY=<from Fadi>
MEMORY_API_URL=https://memory-api-fawn.vercel.app
CLAUDE_API_KEY=<Anthropic API key>

This is the single global credentials file. All hook scripts and tools load from this location automatically — you never need to copy it into individual projects.

Let Claude Code Do This For You paste into a new Claude Code session

Claude can handle steps 1–3 entirely on its own. Step 4 requires you to paste in the credentials — Claude will create the file once you provide them.

Prompt to paste
Set up the Retorec memory system on this machine. Do the following steps in order:

1. If ~/Retorec/retorec-agent-os/ does not exist, clone it:
   git clone git@github-retorec:Retorec/retorec-agent-os.git ~/Retorec/retorec-agent-os
   If it already exists, run git pull inside it instead.

2. Run npm install inside ~/Retorec/retorec-agent-os/memory/scripts/ to install the hook dependencies.

3. Open ~/.claude/settings.json (create it if it does not exist). Add the following four Stop hooks,
   replacing YOUR_USERNAME with the actual macOS username (run `echo $USER` to find it).
   If the file already has content, merge the hooks block carefully — do not overwrite existing settings:

   "hooks": {
     "Stop": [
       { "matcher": "", "hooks": [
         { "type": "command", "command": "node /Users/YOUR_USERNAME/Retorec/retorec-agent-os/memory/scripts/extract-lessons.js" },
         { "type": "command", "command": "node /Users/YOUR_USERNAME/Retorec/retorec-agent-os/memory/scripts/save-session-summary.js" },
         { "type": "command", "command": "node /Users/YOUR_USERNAME/Retorec/retorec-agent-os/memory/scripts/save-session-progress.js" },
         { "type": "command", "command": "node /Users/YOUR_USERNAME/Retorec/retorec-agent-os/memory/scripts/extract-person-observations.js" }
       ]}
     ]
   }

4. Show me the final contents of ~/.claude/settings.json so I can verify the hooks are correct.

5. Tell me what I still need to do manually (the .env file) and what values it needs.
Steps you still need to do yourself
  • Provide the .env credentials — get SUPABASE_ANON_KEY, RETOREC_API_KEY, and CLAUDE_API_KEY from Fadi, then create ~/Retorec/retorec-agent-os/.env with those values. Claude can create the file once you paste the keys into the chat.
  • GitHub SSH must be configured first — the clone in step 1 uses the github-retorec alias.
Machine setup is complete. Stop hooks will now fire automatically at the end of every Claude session.

Per-Project Setup

Do this once per project, on each machine. This tags sessions with the correct project name.

1

Create the project identity file

mkdir -p ~/Retorec/projects/your-project/.claude
echo 'PROJECT_NAME=your-project-name' > ~/Retorec/projects/your-project/.claude/project.env
Use lowercase letters and hyphens only. This name must be the same on every machine — it's how all sessions, lessons, and progress are tagged together.
2

Copy the project scripts

mkdir -p ~/Retorec/projects/your-project/scripts
cp ~/Retorec/projects/velo/scripts/identity.sh       ~/Retorec/projects/your-project/scripts/
cp ~/Retorec/projects/velo/scripts/review-lessons.sh ~/Retorec/projects/your-project/scripts/
cp ~/Retorec/projects/velo/scripts/review-skills.sh  ~/Retorec/projects/your-project/scripts/
cp ~/Retorec/projects/velo/scripts/save-lesson.sh    ~/Retorec/projects/your-project/scripts/
cp ~/Retorec/projects/velo/scripts/memory-lessons.sh ~/Retorec/projects/your-project/scripts/
chmod +x ~/Retorec/projects/your-project/scripts/*.sh

Then update the fallback project name in identity.sh:

export PROJECT_NAME="${PROJECT_NAME:-your-project-name}"
3

Set git email for this project

cd ~/Retorec/projects/your-project
git config user.email "mohammad.binsabt@retorec.com"
Let Claude Code Do This For You paste into a Claude Code session opened inside the project folder

Open Claude Code from inside the project directory, then paste this prompt. Claude will create all the files, set the project name, copy the scripts, and configure git — all in one pass.

Prompt to paste
Set up the Retorec memory system for this project. The project name is [YOUR-PROJECT-NAME] (lowercase, hyphens only).
The project lives at ~/Retorec/projects/[YOUR-PROJECT-NAME]/.

Do the following:

1. Create the directory ~/Retorec/projects/[YOUR-PROJECT-NAME]/.claude/ if it does not exist.
2. Write the file ~/Retorec/projects/[YOUR-PROJECT-NAME]/.claude/project.env with this content:
   PROJECT_NAME=[YOUR-PROJECT-NAME]
3. Create ~/Retorec/projects/[YOUR-PROJECT-NAME]/scripts/ if it does not exist.
4. Copy these five scripts from ~/Retorec/projects/velo/scripts/ into that folder:
   identity.sh, review-lessons.sh, review-skills.sh, save-lesson.sh, memory-lessons.sh
5. Make all copied scripts executable with chmod +x.
6. Open identity.sh and update the fallback PROJECT_NAME value to [YOUR-PROJECT-NAME].
7. Run: cd ~/Retorec/projects/[YOUR-PROJECT-NAME] && git config user.email "mohammad.binsabt@retorec.com"
8. Confirm every step completed and show me the contents of .claude/project.env to verify.
Steps you still need to do yourself
  • Replace [YOUR-PROJECT-NAME] in the prompt before pasting — use the exact project name in lowercase with hyphens (e.g. velo, retorec-site).
  • Machine setup must be done first — the global ~/Retorec/retorec-agent-os/.env file must exist before the hook scripts can authenticate.

Directory Structure

Understanding where everything lives is essential for both founders. The structure below is the single source of truth — reproduce it exactly on Mohammad's machine so paths, scripts, and hook commands all match.

Global Retorec workspace — ~/Retorec/

Every Retorec repository and project lives under ~/Retorec/. This is a hard convention — never save project files to the Desktop, Downloads, or any other location.

~/Retorec/
├── retorec-agent-os/          ← AI workforce infrastructure (this repo)
│   ├── dna/
│   │   └── rules/             ← identity.md, brand-system.md, methodology.md, project-structure.md
│   ├── memory/
│   │   └── scripts/           ← Hook scripts: extract-lessons.js, save-session-summary.js,
│   │                              save-session-progress.js, extract-person-observations.js,
│   │                              synthesize.js, show-profile.js
│   ├── tools/
│   │   └── m365/              ← Microsoft 365 MCP server: auth.js, graph.js, backlog.js,
│   │                              docgen-docx.js, docgen-pptx.js, index.js
│   ├── workflows/             ← Workflow templates and references
│   └── .env                   ← Global credentials (Supabase, API keys) — one file, never copied
│
├── retorec-agents/            ← 184 specialized Claude Code agent definitions
│   ├── academic/
│   ├── design/
│   ├── engineering/
│   ├── finance/
│   ├── game-development/
│   ├── marketing/
│   ├── paid-media/
│   ├── product/
│   ├── project-management/
│   ├── sales/
│   ├── spatial-computing/
│   ├── specialized/
│   ├── support/
│   └── testing/
│
├── _global/                   ← Shared non-code Retorec resources
│   ├── brand/                 ← Logos, brand guidelines, profile PDF
│   ├── finance/               ← Budgets, projections
│   ├── legal/                 ← Contracts, compliance, registration
│   ├── research/              ← Market reports, competitor analysis
│   ├── strategy/              ← Pipeline, partnerships, roadmaps
│   └── templates/             ← Reusable decks, proposals, onboarding docs
│
├── DNA-Guide/
│   └── agents-guide.md        ← Narrative guide to the 184 agents
│
└── projects/                  ← All Retorec projects live here (see layout below)
    ├── <project-a>/           ← Each follows the standard per-project layout
    ├── <project-b>/
    └── <project-c>/           ← No separate repo per project — all tracked here

Per-project layout — ~/Retorec/retorec-agent-os/projects/<name>/

Every project follows this exact structure. Agents enforce it — any file saved to the wrong location gets moved back on the next session.

~/Retorec/retorec-agent-os/projects/<project-name>/
├── CLAUDE.md                  ← Project brief for all agents (committed to git)
├── CLAUDE.local.md            ← Personal overrides — never committed
├── .gitignore
│
├── .claude/
│   ├── settings.json          ← Shared tool permissions (committed)
│   ├── settings.local.json    ← Personal permission overrides (gitignored)
│   ├── project.env            ← PROJECT_NAME tag — hooks use this to attribute sessions
│   ├── commands/              ← Project-specific slash commands
│   ├── rules/                 ← Project-specific instruction files
│   ├── agents/                ← Project-specific agent definitions
│   └── memory/                ← Auto-memory files written by Claude (gitignored)
│
├── docs/                      ← PRDs, specs, wireframes, diagrams (HTML/MD/PDF)
├── scripts/                   ← Shell helpers: review-lessons.sh, synthesize.sh, etc.
│
├── src-<project-name>/
│   ├── backend/               ← Node.js / Express API
│   ├── mobile/                ← React Native apps (one subfolder per app)
│   └── web/                   ← React web apps (one subfolder per app)
│
└── operation/                 ← Post-launch operations and automation (committed to git)
    ├── ops.md                 ← Live operational brief — agents read this
    ├── reporting/             ← Dashboards, KPI definitions, data exports (exports/ gitignored)
    ├── customer-service/      ← Templates, playbooks, SLAs (tickets/ gitignored)
    ├── knowledge/             ← Product docs, runbooks, improvement log
    ├── presence/              ← Brand, social strategy, web copy, news
    ├── roadmap/               ← Backlog and release planning
    └── incidents/             ← Incident log and post-mortems
project.env vs .env
.claude/project.env contains only PROJECT_NAME — it tells the hook scripts which project this session belongs to. Credentials (Supabase keys, API keys) live in ~/Retorec/retorec-agent-os/.env and are loaded globally — no copying needed.

Local folder → GitHub mapping

Everything lives in one private repo: github.com/Retorec/retorec-agent-os. The table below shows how each local directory maps to its path inside that repo.

What Local path Path in GitHub repo
AI workforce OS (this repo) ~/Retorec/retorec-agent-os/ / (repo root)
Global agent definitions ~/Retorec/retorec-agent-os/agents/ agents/
DNA rules (identity, brand, methodology, structure) ~/Retorec/retorec-agent-os/dna/ dna/
Memory hook scripts ~/Retorec/retorec-agent-os/memory/ memory/
Tools (M365, Telegram inbox) ~/Retorec/retorec-agent-os/tools/ tools/
Operator guide (this document) ~/Retorec/retorec-agent-os/docs/ docs/
All projects ~/Retorec/retorec-agent-os/projects/ projects/
Project: <name> ~/Retorec/retorec-agent-os/projects/<name>/ projects/<name>/
Project source code ~/Retorec/retorec-agent-os/projects/<name>/src-<name>/ projects/<name>/src-<name>/
Project shared memory (Fadi) ~/Retorec/retorec-agent-os/projects/<name>/memory/fadi/ projects/<name>/memory/fadi/
Project shared memory (Mohammad) ~/Retorec/retorec-agent-os/projects/<name>/memory/mhd/ projects/<name>/memory/mhd/
Project operation directory ~/Retorec/retorec-agent-os/projects/<name>/operation/ projects/<name>/operation/
Global credentials (never committed) ~/Retorec/retorec-agent-os/.env — gitignored, never in GitHub
Table — Local folder to GitHub repo path mapping

Collaboration Agents — Why They Exist

Two agents exist specifically for Retorec's two-founder workflow. They are not general-purpose tools — they encode the exact setup standard and daily discipline that keeps both developers in sync without any manual coordination overhead.

Project Setup Agent — strong yes.
Every new project has 8 specific steps with exact requirements — memory dirs, correct gitignore, Shared Memory block in CLAUDE.md, project.env, and more. Without a dedicated agent, any agent could set it up inconsistently. One call and the structure is correct, committed, and pushed. Mistakes in setup compound throughout the project lifecycle, so automating this precisely is high-value.
Session Start Agent — yes, but reframed.
Git handles the actual sync — two commands. What you actually want is not a sync agent but a briefing agent: you call it at the beginning of a working session and it pulls latest, reads both memory/fadi/ and memory/mhd/, checks if your partner has pushed anything since your last session, and gives you a structured briefing — what changed, what they're working on, any open questions left in their memory. That's the part that takes real effort without an agent and gets skipped. The discipline of git pull is easy; knowing what your partner did while you were away is not.
AgentTriggerWhat it does
/retorec-project-setup Starting a new project Creates full directory, CLAUDE.md with all sections, .gitignore, project.env, memory dirs, git init, first commit, push
/retorec-session-start Beginning any work session git pull, reads both memory dirs, summarises partner's recent changes, flags open questions, confirms branch is clean
Table — Collaboration Agents at a Glance

/retorec-project-setup

Call once — when starting a new project

Start a Claude Code session from any directory — you do not need to create the project folder first. The agent creates everything using absolute paths inside ~/Retorec/retorec-agent-os/projects/.

No separate GitHub repo needed. Projects live inside the existing retorec-agent-os repo under projects/<name>/. The agent's final step is a simple git add projects/<name>/ && git commit && git push to github.com/Retorec/retorec-agent-os — nothing else to create beforehand. Mohammad gets the new project the next time he runs git pull.

What the agent asks you

#InputExample
1Project name (slug)velo
2One-paragraph product brief"Ride-hailing app for Kuwait..."
3Retorec's roleCo-founder / builder / vendor
4Tech stack per layerBackend: Node.js, Mobile: React Native
5Systems to build1. Driver app, 2. Passenger app, 3. Admin API
Table — Inputs the Project Setup Agent Collects

If you say "use defaults", it proceeds with the Retorec standard stack.

What it creates

1

Full directory structure

~/Retorec/projects/<name>/
├── .claude/{commands, rules, agents}
├── memory/{fadi, mhd}           ← committed to git
├── docs/
├── scripts/
├── src-<name>/{backend, mobile, web}
└── design/{wireframes, assets}
2

CLAUDE.md with all 8 required sections

Product brief, Retorec's role, tech stack, systems to build, key data concepts, directory structure, active agents, and the full Shared Memory block — so memory routing works from session one.

3

Correct .gitignore

Excludes node_modules/, .env, CLAUDE.local.md, settings.local.json. Does not exclude memory/ or .claude/project.env — both are committed.

4

.claude/project.env and settings.json

PROJECT_NAME=<name> for hook attribution, plus shared tool permissions for the project.

5

Commit to retorec-agent-os and push

No git init. The agent runs git add projects/<name>/ inside the parent repo, commits, and pushes to github.com/Retorec/retorec-agent-os. Mohammad gets it on his next git pull — no separate clone needed.

One-time setup flow

# 1. Open Claude Code from anywhere
# 2. /retorec-project-setup
# Done — project is at ~/Retorec/retorec-agent-os/projects/<name>/ and live on GitHub

# Mohammad (gets the new project automatically):
cd ~/Retorec/retorec-agent-os
git pull

/retorec-session-start

Call at the start of every session

Start Claude Code from inside ~/Retorec/projects/<name>/ — the agent reads .claude/project.env to identify the project. It then runs the full briefing sequence automatically, no prompts needed.

What it runs (in order)

StepWhat happens
1Confirms you're inside a Retorec project (reads project.env)
2git pull origin main — reports what changed or flags conflicts
3Identifies the active developer from git config user.email
4Reads every file in memory/fadi/ and memory/mhd/
5Checks recent git commits from your partner (last 7 days)
6Produces the briefing (see below)
7Optionally suggests the best agent for what you're working on today
Table — Session Start Agent Execution Sequence

Briefing output

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  SESSION START — velo
  Developer: Fadi · 11 May 2026
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

SYNC
  2 commits pulled
  · Mohammad — "Complete driver onboarding flow"
  · Mohammad — "Fix auth token refresh on 401"

PARTNER UPDATE  (Mohammad)
  · Completed driver onboarding — signup, document upload, approval flow
  · Auth token refresh now handles 401s automatically
  · Working on trip state machine (in_progress per his memory)

YOUR OPEN ITEMS  (from memory/fadi/)
  · Passenger app map screen — waiting on trip state machine API
  · Review push notification provider decision (open question)

SHARED OPEN QUESTIONS
  · Push notification provider not decided — Firebase vs OneSignal

REPO STATE
  Branch: main
  Clean: yes
  Ahead of origin: no

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Ready. What are you working on today?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
If git pull returns a merge conflict, the agent stops immediately after Step 2 and focuses entirely on reporting the conflicting files. Resolve conflicts before continuing — do not proceed with a dirty merge state.

Daily habit

cd ~/Retorec/projects/<project-name>
# Open Claude Code here
/retorec-session-start
# ... do your work ...
git add memory/fadi/   # or memory/mhd/
git commit -m "..."
git push

The briefing stays under 30 lines every time. If both memory directories are empty (early in a project), it notes that and moves on — it never errors on missing data.

Operation Directory — Post-Launch Management

Once a product is live, the work doesn't stop at the code — it shifts. Reporting needs to be tracked, customers need to be supported, knowledge needs to be documented, the brand needs to be maintained, and incidents need to be logged. The operation/ directory is the structured home for all of that. Its purpose is twofold: to manage the product's live operations, and to automate them by giving agents a clear, consistent place to read context and take action.

Agents working on a live project need to know more than just the code — they need to know the current operational status, what customers are saying, what's in the roadmap, what incidents have occurred, and what the brand guidelines are. The operation/ directory puts all of that in one committed, structured location so any agent — whether handling customer service, drafting a release note, updating the social calendar, or triaging an incident — has everything it needs without being told where to look.

Why it's in git: Operational knowledge belongs with the product, not in someone's local folder or a disconnected spreadsheet. When both founders clone the repo, they get the full operational context alongside the source code — and so does every agent that opens the project.

Directory Structure

The operation/ tree is standard across all Retorec projects. Two subdirectories are gitignored due to PII risk; everything else is committed.

operation/
├── ops.md                        ← live operational brief (agents read this)
├── reporting/
│   ├── dashboards/               ← Power BI .pbix files, Excel workbooks
│   ├── kpis/                     ← KPI definitions, targets, tracking docs
│   └── exports/                  ← ⛔ gitignored — raw data dumps / PII
├── customer-service/
│   ├── templates/                ← response templates and macros
│   ├── scripts/                  ← escalation playbooks, issue resolutions
│   ├── slas/                     ← SLA definitions and response time targets
│   └── tickets/                  ← ⛔ gitignored — live ticket data / PII
├── knowledge/
│   ├── product/                  ← what it does, how it works, user FAQs
│   ├── runbooks/                 ← operational how-tos, deploy, rollback
│   └── improvements/             ← logged issues, feature requests
├── presence/
│   ├── brand/                    ← project brand assets and guidelines
│   ├── social/
│   │   ├── strategy/             ← platform strategy, audience, tone
│   │   └── content/              ← drafts, published pieces, calendar
│   ├── web/                      ← web copy updates, SEO notes
│   └── news/                     ← release notes, feature announcements
├── roadmap/
│   ├── backlog/                  ← feature requests from users and ops data
│   └── releases/                 ← past and upcoming releases
└── incidents/                    ← incident log and post-mortems
Figure — operation/ directory tree (standard for all Retorec projects)
SubdirectoryWhat Goes HereGitignored?
reporting/dashboards/Power BI files, Excel workbooks, KPI trackersNo
reporting/kpis/KPI definitions, targets, formulasNo
reporting/exports/Raw data exports, CSV dumps with PIIYes
customer-service/templates/Response templates, macrosNo
customer-service/scripts/Escalation playbooks, resolution guidesNo
customer-service/slas/SLA definitions and response time targetsNo
customer-service/tickets/Live ticket data, customer conversationsYes
knowledge/product/Product FAQs, how-it-works docsNo
knowledge/runbooks/Deploy, rollback, operational how-tosNo
knowledge/improvements/Logged issues, feature requests from opsNo
presence/brand/Brand assets and guidelinesNo
presence/social/Social strategy, content drafts, calendarNo
presence/web/Web copy updates, SEO notesNo
presence/news/Release notes, feature announcementsNo
roadmap/backlog/Feature requests, user feedbackNo
roadmap/releases/Past and upcoming release plansNo
incidents/Incident log and post-mortemsNo
Table — operation/ subdirectories, purpose, and gitignore status

ops.md — The Operational Brief

operation/ops.md is the live operational brief for the product. It's the equivalent of CLAUDE.md for post-launch operations — agents read it to understand the current state of the product without needing to ask. It's updated by developers whenever something meaningful changes: a release ships, an incident resolves, a KPI target changes.

Standard template — ops.md
Created automatically by /retorec-project-setup. Update the fields marked with <!-- --> as the product evolves.
# <Project Name> — Operations Brief

**Status**: pre-launch
**Live since**: <!-- update on launch date -->
**Current version**: 0.1.0
**Last updated**: <date>

---

## Product Summary
<!-- One sentence: what this product does and who it's for -->

## Environments
| Environment | URL   | Notes |
|-------------|-------|-------|
| Production  | —     |       |
| Staging     | —     |       |

## Current State
**Operational status**: healthy / degraded / incident

**Active priorities**:
- <!-- what the team is focused on right now -->

**Known issues**:
- <!-- production bugs or limitations operators should be aware of -->

## Recent Releases
| Version | Date | What changed |
|---------|------|-------------|
|         |      |              |

## Key Metrics
| Metric | Target | Current |
|--------|--------|---------|
|        |        |         |

## Customer Service
**Support channel**: <!-- email / chat / in-app -->
**SLA — first response**: <!-- e.g. 4 business hours -->
**Escalation contact**: Fadi Jalajel

## Contacts & Ownership
| Area                 | Owner                     |
|----------------------|---------------------------|
| Technical issues     | Fadi Jalajel              |
| Business / strategy  | Mohammad Binsabt Al Saeed |
| Customer escalations | Fadi Jalajel              |

## Operational Notes
<!-- Quirks, manual processes, external dependencies -->
Figure — standard ops.md template created for every new project

Setting Up the Operation Directory

If you're using /retorec-project-setup, the operation/ directory and ops.md are created automatically — nothing to do. For an existing project that doesn't have it yet:

cd ~/Retorec/projects/<name>

# Create all subdirectories
mkdir -p operation/{reporting/{dashboards,kpis,exports},customer-service/{templates,scripts,slas,tickets},knowledge/{product,runbooks,improvements},presence/{brand,social/{strategy,content},web,news},roadmap/{backlog,releases},incidents}

# Add .gitkeep so git tracks empty dirs
find operation -type d -exec touch {}/.gitkeep \;

# Add gitignore entries (append to existing .gitignore)
echo "operation/reporting/exports/" >> .gitignore
echo "operation/customer-service/tickets/" >> .gitignore

# Create ops.md from the template (copy from project-structure.md or write manually)
# Then commit everything
git add operation/ .gitignore
git commit -m "Add operation/ directory structure"
After launch: The first thing to update in ops.md is Status (pre-launch → healthy), Live since (set the date), and Environments (add your production URL). From there, keep Current State and Key Metrics updated at every sprint review.

The Learning Loop

Claude Session Stop Hook fires automatically Pending Queue lessons + progress You Review approve / skip Approved Lessons agents read this at session start weekly Synthesis finds patterns Skill Candidates pending review You Review approve / reject Skills Registry agents follow these Every session feeds the loop · Weekly synthesis compresses knowledge into skills
Figure 3 — The Retorec Memory Learning Loop

Architecture & Storage

The memory system supports two interchangeable storage backends, controlled by a single environment variable. SharePoint is the default — it costs nothing extra (included in M365) and writes directly to SharePoint Lists via the Microsoft Graph API. The Supabase + Vercel backend remains fully operational as an alternative.

YOUR MACHINE ~/.claude/settings.json (hooks) · memory/scripts/backends/index.js · MEMORY_BACKEND env var runs locally MEMORY_BACKEND switches the active path sharepoint (default) supabase (alternative) MICROSOFT GRAPH API graph.microsoft.com/v1.0 · OAuth2 client credentials direct SHAREPOINT LISTS 7 Memory_* lists · M365 tenant · Zero extra cost storage MEMORY API (VERCEL) Express.js · memory-api-fawn.vercel.app · API key HTTP SUPABASE PostgreSQL · 7 tables · Cloud-hosted storage Both backends implement identical interfaces — only the storage layer differs ★ SharePoint is the default — free with M365 Basic, no extra infrastructure needed
Figure 4 — Dual-Backend Architecture — SharePoint (default) and Supabase/Vercel (alternative), switchable via env var
SharePoint is the default backend. Both founders already have M365 Basic, so SharePoint Lists cost nothing extra. The Supabase + Vercel backend remains fully operational — switch to it any time by changing MEMORY_BACKEND=supabase in ~/Retorec/retorec-agent-os/.env.

Backend Configuration

A single environment variable selects which backend all memory scripts use. Set it in ~/Retorec/retorec-agent-os/.env:

ValueBackendStatus
MEMORY_BACKEND=sharepoint SharePoint Lists via Microsoft Graph API Default
MEMORY_BACKEND=supabase PostgreSQL via Supabase + Vercel API Alternative
Table 3 — Memory Backend Options (MEMORY_BACKEND)

If the variable is absent, SharePoint is used. No other code changes are required — the backends/index.js selector automatically routes all hook scripts and CLI tools to the correct adapter.

Switching backends does not migrate data. Lessons, summaries, and observations saved to SharePoint will not appear if you switch to Supabase, and vice versa. Only switch backends if you intend to use the new one going forward from that point.

SharePoint Lists (Default Backend)

Seven SharePoint Lists, each prefixed Memory_, replace the Supabase tables one-for-one. They live on your M365 tenant at https://retorec.sharepoint.com/Lists/ and are managed entirely via the Microsoft Graph API — no additional subscriptions or infrastructure needed.

One-time setup

Run this once to create all seven lists with the correct columns:

node ~/Retorec/retorec-agent-os/memory/scripts/setup-sharepoint.js

The script is safe to re-run — it skips lists that already exist. Once created, the lists are shared across all machines and founders (same M365 tenant).

The seven Memory_* lists

Memory_Lessons
Unified lesson store. Status field controls lifecycle: pending → agent extracts, approved / active → loaded into sessions, superseded / rejected → archived. Fields: Lesson, ProjectName, SessionId, UserEmail, DeviceId, Importance, Scope, Source, Status, SupersededBy.
Human approved
Memory_SessionSummaries
One row per session. Auto-filled by the Stop hook. Fields: ProjectName, UserEmail, DeviceId, SummaryText, and SharePoint's built-in Created timestamp.
Auto-filled
Memory_SessionProgress
Structured task list per session. Each row is one task. Fields: ProjectName, SessionId, UserEmail, DeviceId, Feature, TaskDescription, Status (done / in_progress / pending / blocked / rejected / reverted / failed), Comments, ResourcesUsed, Output.
Auto-filled
Memory_SynthesisReports
Weekly synthesis output. Fields: ProjectName, ReportText, Themes (JSON), EvolutionSuggestions (JSON), SkillCandidates (JSON), LessonCount.
Weekly job
Memory_PendingSkills
Skill candidates proposed by synthesis. Fields: ProjectName, SkillDescription, TriggerContext, ImplementationNotes, Scope, SourceSynthesisId, Status (pending / approved / rejected).
From synthesis
Memory_Persons
Person registry. One row per email. Fields: Email, Name, Role. Auto-created by the Stop hook on first observation. Upserted by GET-then-create (SharePoint has no native upsert).
Auto-created
Memory_PersonObservations
Raw observations about each team member. Fields: Email, SessionId, ProjectName, Category (knowledge / skill / acquired_skill / interest / creativity / work_style / decision), Observation, Evidence. No review queue — saved directly from the Stop hook.
Auto-filled · No review

Reviewing lessons in SharePoint

The review-lessons.sh bash script is Supabase-only. When using SharePoint, review and approve lessons directly in the SharePoint list UI:

  1. Open https://retorec.sharepoint.com/Lists/Memory_Lessons
  2. Filter by Status = pending
  3. Read each lesson and set Status to approved (to activate it) or rejected (to discard)
  4. To edit the lesson text before approving, click the row and edit the Lesson field inline

Applying evolution suggestions in SharePoint

When synthesis proposes that a lesson should be superseded, apply it manually:

  1. Open Memory_Lessons, find the item by its SharePoint ID
  2. Set Status → superseded
  3. Optionally set SupersededBy to the ID of the replacement lesson

Supabase Tables (Alternative Backend)

When MEMORY_BACKEND=supabase, all scripts route through the Vercel Memory API (https://memory-api-fawn.vercel.app) backed by PostgreSQL on Supabase. This backend is fully operational and requires no changes to use.

The Supabase backend uses separate tables for pending and approved lessons (pending_lessons and lessons), whereas SharePoint uses a single Memory_Lessons list controlled by a Status field. Functionally equivalent — just a different schema shape.

For a full list of Supabase tables and the REST API endpoints, see API Endpoints Reference →

What Gets Stored

Seven data stores in the active backend. Each serves a different part of the loop:

Names below use the Supabase convention. In SharePoint, each maps to a Memory_* list — e.g. lessonsMemory_Lessons. The data shape and purpose are identical regardless of which backend is active.
lessons / Memory_Lessons (approved)
The approved knowledge base. Lessons that agents read at the start of every session. Fields: lesson text, importance (low/medium/high), scope (global/project), status (active/superseded/archived). In SharePoint, a single list with a Status column covers both pending and approved lessons.
Human approved
pending_lessons / Memory_Lessons (pending)
Raw lesson candidates extracted automatically from session transcripts. They wait here until a founder reviews them. Nothing in here affects future sessions. In SharePoint, these are rows in Memory_Lessons with Status = pending.
Auto-filled
session_summaries / Memory_SessionSummaries
One paragraph per session describing what happened. Generated automatically when the session ends. Useful for quickly understanding any session without reading the full transcript.
Auto-filled
session_progress / Memory_SessionProgress
Structured task list per session. Each row is one task with status (done / in_progress / blocked / rejected / failed), resources used, and output produced.
Auto-filled
synthesis_reports / Memory_SynthesisReports
Weekly analysis reports. Each report contains theme clusters, evolution suggestions (redundant lessons), and skill candidates for review.
Weekly job
pending_skills / Memory_PendingSkills
Skill candidates proposed by the synthesis job, waiting for founder review. Approve to promote to the active skills registry, or reject to discard.
From synthesis
persons / Memory_Persons
One record per team member identified by email. Stores name, role, and timestamps. Created automatically the first time someone's session triggers an observation extraction.
Auto-created
person_observations / Memory_PersonObservations
Raw observations about each team member accumulated across all sessions. Seven categories: knowledge, skill, acquired_skill, interest, creativity, work_style, decision. No review queue — saved directly. Synthesized into a profile on demand.
Auto-filled · No review

Shared Developer Memory

Every project has a memory/ directory at its root — committed to Git and shared between all developers. When Fadi's Claude writes something to memory, Mohammad's Claude sees it on the next git pull, and vice versa. No manual handoff needed.

This is different from the Retorec memory system. SharePoint lessons and session summaries track what AI agents learn and improve over time. The memory/ directory tracks working context within a project — decisions made, current state, open questions — so both developers are always starting from the same picture.
Fadi's Machine writes → memory/fadi/ Mohammad's Machine writes → memory/mhd/ GitHub Repo memory/fadi/ · memory/mhd/ both committed · both visible to all git push git push git pull → reads mhd/ too git pull → reads fadi/ too
Figure — Shared Developer Memory — each person writes to their own namespace, both read all

How Claude routes automatically

The CLAUDE.md in every project contains a Shared Memory block that instructs Claude to determine the active developer from git config user.email and write to the correct directory. No manual switching — it is automatic.

DeveloperEmailWrites toReads from
Fadi fadi.jalajel@retorec.com memory/fadi/ memory/fadi/ + memory/mhd/
Mohammad mohammad.binsabt@retorec.com memory/mhd/ memory/fadi/ + memory/mhd/
Table — Shared Memory Routing by Developer

What belongs in memory files

Write thisNot this
Decisions made — "chose Postgres over Mongo because of join requirements"Credentials or API keys
Current state — "auth module complete, payments in progress"Session-specific ephemera
Open questions — "still need to decide on push notification provider"Content already in CLAUDE.md or docs/
Established patterns — "all API responses wrap in { ok, data, error }"Full code listings or large outputs
Table — What to Write to Memory vs. What to Leave Out

Setting Up Shared Memory

One-time — per project

New projects

The setup command in the project structure standard creates the directories automatically:

mkdir -p ~/Retorec/projects/<name>/{memory/{fadi,mhd}, ...}
touch memory/fadi/.gitkeep memory/mhd/.gitkeep
git add memory/
git commit -m "Add shared memory directories"

Existing projects (retrofit)

cd ~/Retorec/projects/<project>
mkdir -p memory/fadi memory/mhd
touch memory/fadi/.gitkeep memory/mhd/.gitkeep
git add memory/
git commit -m "Add shared memory directories"
git push

Mohammad gets both directories the moment he pulls. No further setup needed on his end.

Add the Shared Memory block to CLAUDE.md

Copy this verbatim into every project's CLAUDE.md:

## Shared Memory

At the start of every session:
1. Read ALL files in memory/fadi/ and memory/mhd/
2. Treat their contents as active project context — decisions made, current
   state, open questions, patterns established

When writing memory during or at the end of a session:
- Determine the active developer from: git config user.email
  - fadi.jalajel@retorec.com       → write to memory/fadi/
  - mohammad.binsabt@retorec.com   → write to memory/mhd/
- Keep memory files focused: decisions, current state, open questions, patterns
- Never write credentials, personal notes, or session-specific ephemera

At the end of every session:
- Commit and push memory/ along with any other session changes
Make sure memory/ is NOT in your project's .gitignore. Only .claude/memory/ (Claude Code's internal scratch space) should be excluded — the project-level memory/ directory must be committed.

Daily & Weekly Rhythm

The system has three operating tempos. Know which is automatic and which you trigger manually.

⚡ Automatic — every session
Lessons extracted from transcript
Session summary written
Task progress captured
Person observations silently saved
✓ Manual — after sessions
Run review-lessons.sh
Approve, edit, or skip lessons
Save manual lessons if needed
Do this whenever feels right
◎ Manual — weekly
Run synthesize.js
Review theme clusters output
Run review-skills.sh
Approve skill candidates

How Hooks Work (Automatic)

Fully Automatic

Every time a Claude Code session ends, four scripts fire in the background. You do not trigger these — Claude Code handles it.

All four run in the background — you don't see them, they just happen Session ends / /exit Stop Hook triggers 4 scripts extract-lessons.js → pending_lessons save-session-summary.js → session_summaries save-session-progress.js → session_progress extract-person-obs.js → person_observations no review needed
Figure 5 — Stop hooks fire automatically — 4 scripts, running in the background after every session
How does it know which project? The scripts read .claude/project.env from the current working directory when they fire. Without PROJECT_NAME set, sessions are tagged as unknown.

Verifying hooks fired

After a session ends, wait a few seconds then run:

cd ~/Retorec/projects/your-project
bash scripts/review-lessons.sh

If lessons appear in the review UI, the hooks fired correctly.

Reviewing Lessons

Manual — run after sessions

Run this whenever you want to process the pending lesson queue. Batch after every few sessions, or review daily — whatever fits your rhythm.

SharePoint backend: Open https://retorec.sharepoint.com/Lists/Memory_Lessons, filter by Status = pending, and set each lesson to approved or rejected directly in the list. The bash script below is for the Supabase backend only.

Supabase backend — interactive terminal review:

cd ~/Retorec/projects/your-project
bash scripts/review-lessons.sh

The script shows each pending lesson one at a time:

╔══════════════════════════════════════════╗
║        Retorec Lesson Review             ║
╚══════════════════════════════════════════╝
  Project: velo   Pending: 3

┌─ Lesson 1 of 3 ── ↑ seen 3x

  Always quote URLs containing ? in zsh — unquoted ? triggers glob expansion

  Importance:  high
  Scope:       global
  From:        fadi.jalajel@retorec.com @ Fadis-MacBook-Pro.local

  [s] save  [e] edit  [k] skip  [q] quit
  → 
KeyWhat it does
sSave to the approved lessons table. This lesson will now be loaded into future sessions.
eEdit text, importance, or scope before saving. Then confirm.
kSkip — removes from pending without saving.
qQuit — unreviewed lessons remain pending for next time.
Table 4 — Lesson Review Keyboard Commands (Supabase)

The ↑ seen Nx badge shows how many times this lesson was extracted across different sessions. Seen 4 times = much stronger signal than seen once. Prioritize those.

Saving a Manual Lesson

Manual — any time

To save a lesson directly — after a conversation, a decision, or something you just know — without going through the review flow:

bash scripts/save-lesson.sh <project> "lesson text" <importance> <scope>
Examples
bash scripts/save-lesson.sh velo \
  "Always validate the API response before rendering — never trust shape." \
  high global

bash scripts/save-lesson.sh velo \
  "The driver rating algorithm uses a 30-day rolling window, not lifetime." \
  medium project

Importance: low / medium / high  ·  Scope: global / project

Viewing Active Lessons

Manual — on demand

To see all approved active lessons for this project:

bash scripts/memory-lessons.sh

Agents automatically load these at the start of every session — so everything approved here actually influences future work.

Running Synthesis

Weekly — run manually

Once a week (or whenever the lesson base feels substantial), run the synthesis job. It needs at least 2 approved lessons to run.

cd ~/Retorec/projects/your-project
node ~/Retorec/retorec-agent-os/memory/scripts/synthesize.js
Example output
🔬 Retorec Synthesis — velo
──────────────────────────────────────────────────
Fetching approved lessons...  Found 8 active lessons
Running AI synthesis...

── Summary ──────────────────────────────────
The knowledge base reflects patterns around API safety, zsh shell quirks,
and identity resolution.

── Themes (3) ──────────────────────────────
  • Shell Safety (3 lessons)
  • API Defensive Patterns (2 lessons)
  • Identity Resolution (1 lesson)

── Skill Candidates (2) ────────────────────
  • zsh URL Quoting Guard
  • API Response Validation Pattern

Staging 2 skill candidate(s) for review...
✓ Synthesis complete.
Evolution suggestions appear when the synthesis job finds redundant or outdated lessons. These are recommendations only — apply them manually, never automatically.

Reviewing Skills

Manual — after synthesis

After synthesis, review the proposed skill candidates.

SharePoint backend: Open https://retorec.sharepoint.com/Lists/Memory_PendingSkills, filter by Status = pending, and set each candidate to approved or rejected directly in the list. The bash script below is for the Supabase backend only.

Supabase backend — interactive terminal review:

bash scripts/review-skills.sh
╔══════════════════════════════════════════╗
║        Retorec Skill Review              ║
╚══════════════════════════════════════════╝
  Project: velo   Pending: 2

┌─ Skill 1 of 2 ──────────────────────────────

  zsh URL Quoting Guard

  Description:
  Always wrap URLs containing ? or & in double quotes in zsh shell scripts
  to prevent glob expansion from silently corrupting query parameters.

  Trigger context:
  Any time a curl command contains query string parameters

  Scope: global

  [a] approve  [k] skip  [r] reject  [q] quit
  → 
KeyWhat it does
aApprove — promotes the skill to the active registry. Agents will follow it in future sessions.
kSkip — leaves it pending for later.
rReject — discards it permanently.
qQuit — unreviewed skills stay pending.
Table 5 — Skill Review Keyboard Commands (Supabase)

Human Profiles — Understanding Your Team

Every Claude session now quietly observes the human participating in it. Over many sessions, these observations accumulate into a living profile — a structured picture of each person's knowledge, skills, interests, creativity, and how they work. Profiles are never injected into agent context automatically. They are private, on-demand, and built purely from evidence in actual transcripts.

Why this matters for Retorec. As the AI workforce grows, agents need to understand who they are working with — not just what task is requested. A profile lets an agent know that Mohammad has deep finance expertise, or that Fadi prefers structured output and moves fast on decisions. That context changes the quality of every interaction.
Session 1 transcript Session 2 transcript Session N transcript ... more sessions ... Stop Hook extract-person-obs.js runs after each session person_observations accumulates silently no review required tagged by session + project on demand show-profile.js Claude Opus synthesizes 8-section profile in your terminal Observations accumulate every session · Profile generated in seconds whenever you need it
Figure 6 — Profile System — silent accumulation, on-demand synthesis

How Profiles Build Up

At the end of every session, the fourth Stop hook — extract-person-observations.js — reads the transcript and asks Claude Opus to extract 3 to 5 observations about the human participant. It identifies the person from their git email, upserts a record in the persons table, and saves each observation directly to person_observations. No pending queue. No review step. The data just accumulates.

Each observation is tagged with the session ID, project name, category, the observation itself, and a short evidence reference — a 5–10 word pointer to what in the transcript led to it. This means every profile claim is grounded in actual evidence, not guesswork.

Short or generic sessions produce no observations. If a session is too brief or consists only of simple lookups, the extractor returns an empty array and nothing is saved. The system only captures observations when there is clear evidence to support them.

Observation Categories

Seven categories. Each captures a different dimension of the person:

CategoryWhat it capturesExample observation
knowledge A domain or topic the person clearly understands Deep understanding of PostgreSQL schema design and indexing strategies
skill A capability they demonstrated during the session Diagnosed a data pipeline failure by reading raw API responses
acquired_skill Something they learned or now understand that they did not before Now understands how SSH host aliases route to different identity files
interest A recurring theme or area they consistently care about Strong interest in AI agent memory and compounding knowledge systems
creativity An original idea, novel approach, or problem reframed in a new way Proposed building living profiles of team members from session transcripts
work_style How they communicate, structure requests, or prefer output Prefers index-first delivery — wants a table of contents before large output
decision A significant choice or direction they explicitly set Chose no-review model for person observations — speed over oversight
Table 6 — Observation Categories

Viewing a Profile

Manual — on demand

Profiles are never shown automatically. You request them by running show-profile.js with an email address. Claude Opus reads all accumulated observations for that person and synthesizes them into a structured 8-section report printed directly in your terminal.

List all persons in the system

node ~/Retorec/retorec-agent-os/memory/scripts/show-profile.js --list
Example output
Persons in the system:

  fadi.jalajel@retorec.com — Fadi Jalajel (Co-Founder, Deputy CEO)
  mohammad.binsabt@retorec.com — Mohammad Binsabt Al Saeed (Co-Founder, CEO)

Generate a profile

node ~/Retorec/retorec-agent-os/memory/scripts/show-profile.js fadi.jalajel@retorec.com
Example output
Fetching observations for fadi.jalajel@retorec.com...
Found 24 observations across 8 sessions.

Generating profile...

════════════════════════════════════════════════════════════
  PROFILE: fadi.jalajel@retorec.com
════════════════════════════════════════════════════════════

1. Overview
Fadi Jalajel is Co-Founder and Deputy CEO of Retorec, operating as both
a strategic leader and hands-on product builder. Across observed sessions
he consistently drives from problem definition to working code, with
minimal time spent in abstract planning...

2. Knowledge & Expertise
Demonstrates strong command of AI agent infrastructure, memory system
architecture, PostgreSQL, and Node.js API design. Familiar with Vercel
deployment, SSH key management, and GitHub workflows...

3. Skills
Capable of diagnosing and resolving API integration issues in real time.
Able to orchestrate multi-step technical builds across backend, database,
and deployment layers simultaneously...

4. Acquired Skills
Now understands how Claude Code Stop hooks fire and how transcript data
is passed to external scripts via stdin. Learned SSH host alias routing
during the GitHub setup session...

5. Interests & Recurring Themes
Consistently returns to compounding AI intelligence — the idea that
agents should get smarter with every interaction. Strong recurring
interest in the Retorec Memory System and its expansion...

6. Creativity & Problem-Solving
Proposed the Human Profile System as a natural extension of the memory
loop — reframing session transcripts as observations about people rather
than just project knowledge. Novel and immediately implementable...

7. Work Style & Communication
Requests are direct and action-oriented. Prefers index-first delivery
for large outputs. Rarely asks for explanations of the obvious. Moves
fast once a direction is agreed...

8. Decision Patterns
Consistently chooses speed over ceremony — opted for no-review model
for profile observations, chose Vercel over self-hosted for the API,
cut Obsidian integration when the ROI was unclear...

Working with this person: Move fast and be decisive — Fadi responds well
to confident recommendations with clear tradeoffs. Lead with the actionable
output; keep explanations tight and tied to what he is building right now.

════════════════════════════════════════════════════════════

Each section is synthesized purely from accumulated observations — nothing is invented. The more sessions run, the richer the profile becomes. Early profiles (fewer than 5 sessions) will be sparse; after 10–15 sessions they become genuinely detailed.

Using Profiles Effectively

When to generate a profile

Privacy design

Profiles are not automatically loaded into any agent's context. An agent only sees a profile if you explicitly paste it in. This is intentional — profile data is detailed and personal, and should be shared with agents only when the context calls for it.

The profile grows automatically. You never need to manage it. Every session adds observations. Run show-profile.js whenever you want the current synthesis. The output improves on its own as sessions accumulate.

Running a profile for Mohammad

Once Mohammad's machine is set up with the correct git email and hooks configured, his sessions will automatically build his profile. Run this from either machine to view it:

node ~/Retorec/retorec-agent-os/memory/scripts/show-profile.js mohammad.binsabt@retorec.com
Profiles require sessions. A profile for a new person will show "No observations found" until at least one session has been run with hooks active and git email correctly configured. Run a real session first, wait a few seconds, then generate the profile.

M365 Integration — OneDrive, Excel, Word & PowerPoint

The Retorec M365 MCP server is a custom-built integration that gives Claude Code agents direct, programmatic access to Microsoft 365 — specifically OneDrive file storage, Excel workbooks, Word document generation, and PowerPoint presentation generation. It is built and owned by Retorec, using Microsoft's official MSAL authentication library and the Microsoft Graph API. No third-party services are involved.

This is Path B — fully automated. Agents access OneDrive without a human opening any application. A brief is read, a deliverable is generated, and the result is saved to OneDrive — all within a single Claude Code session, with no manual steps.
Claude Code agent session retorec-m365 MCP server tools/m365/index.js MSAL Microsoft Graph API graph.microsoft.com M365 Tenant OneDrive Excel Word / DOCX PowerPoint / PPTX Retorec-owned · Official MSAL auth · No third-party servers · Runs locally
Figure 7 — Claude Code → retorec-m365 MCP server → Microsoft Graph API → your M365 tenant

Activating the MCP Server

The server is already built, installed, and registered. One-time activation:

1

Confirm the .env file has credentials

cat ~/Retorec/retorec-agent-os/tools/m365/.env

You should see three non-empty values: M365_TENANT_ID, M365_CLIENT_ID, M365_CLIENT_SECRET.

2

Restart Claude Code

The MCP server config is read at startup. Quit and reopen Claude Code — the retorec-m365 server will connect automatically.

3

Verify it connected

In a new Claude Code session, type:

what MCP tools do you have available?

You should see all 8 M365 tools listed: list_drive_items, download_file, upload_file, read_excel, write_excel, convert_to_pdf, create_word_document, create_powerpoint.

If tools don't appear, check that ~/.claude/mcp.json exists and points to the correct path. Confirm Node.js can run the server: node ~/Retorec/retorec-agent-os/tools/m365/index.js (should hang silently — that means it started correctly; press Ctrl+C to exit).

8 Tools at a Glance

list_drive_items
Browse files and folders inside a OneDrive directory.
In: user_email, folder_path (optional)
Out: list of names, types, sizes, dates
download_file
Download any OneDrive file to a local temp path so the agent can read it.
In: user_email, onedrive_path
Out: local file path
upload_file
Upload any local file to a specific OneDrive path. Overwrites if it exists.
In: user_email, local_path, onedrive_path
Out: confirmation + OneDrive URL
read_excel
Read cell values from an Excel workbook stored in OneDrive as structured data.
In: user_email, onedrive_path, sheet_name, range
Out: 2D grid of cell values
write_excel
Write values directly into a specific cell range in an Excel workbook.
In: user_email, onedrive_path, sheet_name, range, values
Out: confirmation
convert_to_pdf
Convert a Word, PowerPoint, or Excel file in OneDrive to PDF via Graph API.
In: user_email, onedrive_path
Out: local path of downloaded PDF
create_word_document
Generate a formatted .docx with title page, headings, paragraphs, bullet lists, numbered lists, and tables. Retorec brand colours applied.
In: title, subtitle, author, sections[ ]
Out: local .docx path → follow with upload_file
create_powerpoint
Generate a .pptx with 5 slide layouts: title, content, table, split (two-column), and blank. Two themes: "clean" and "retorec".
In: title, theme, slides[ ]
Out: local .pptx path → follow with upload_file

Test 1 — Browse Your OneDrive

Type this in Claude Code
list_drive_items Prompt to type
List the files and folders in my OneDrive root. My email is fadi.jalajel@retorec.com
What you should see
A list of your OneDrive root contents — folder names, file names, sizes, and last modified dates.

Example:
Found 3 item(s) in "root":
[folder] Attachments
[folder] Microsoft Copilot Chat Files
[folder] Whiteboards

To browse a subfolder, add the path:

List the files inside the "Documents" folder in my OneDrive. Email: fadi.jalajel@retorec.com

Test 2 — Upload a File to OneDrive

Type this in Claude Code
upload_file Prompt to type

First create a small test file, then upload it:

Create a text file at /tmp/hello-retorec.txt with the content "Retorec M365 test — uploaded by agent" and upload it to my OneDrive at "Retorec-Tests/hello.txt". My email is fadi.jalajel@retorec.com
What you should see
Uploaded "/tmp/hello-retorec.txt" → OneDrive: "Retorec-Tests/hello.txt"
URL: https://retorec-my.sharepoint.com/personal/fadi_jalajel_retorec_com/...

Then open OneDrive in your browser and confirm the file appeared at Retorec-Tests/hello.txt.

Test 3 — Download a File from OneDrive

Type this in Claude Code
download_file Prompt to type

Use the file you just uploaded in Test 2, or any existing file in your OneDrive:

Download the file "Retorec-Tests/hello.txt" from my OneDrive and tell me what it contains. My email is fadi.jalajel@retorec.com
What you should see
Downloaded "Retorec-Tests/hello.txt" → /tmp/retorec-m365/[timestamp]-hello.txt (38 B)

The file contains: "Retorec M365 test — uploaded by agent"

This is also how agents read Word briefs — download the DOCX, then read and act on its content.

Test 4 — Read an Excel File

Type this in Claude Code
read_excel Prompt to type

You need an .xlsx file in your OneDrive first. Upload any Excel file or create one in OneDrive, then:

Read the data from the Excel file at "Documents/budget.xlsx" in my OneDrive. Read the first sheet, range A1:E10. My email is fadi.jalajel@retorec.com
What you should see
Excel "Documents/budget.xlsx" — Sheet: "Sheet1" — Range: A1:E10

Item     Q1    Q2    Q3    Q4
Revenue  50000  62000  ...
...

(10 rows × 5 columns)

Omit the range parameter to read the entire used area of the sheet automatically.

Test 5 — Write to an Excel File

Type this in Claude Code
write_excel Prompt to type
Write the following data to "Documents/budget.xlsx" in my OneDrive, Sheet1, starting at cell A1:
Headers: Month, Revenue, Expenses, Profit
Row 1: January, 50000, 32000, 18000
Row 2: February, 62000, 35000, 27000
Row 3: March, 58000, 31000, 27000
My email is fadi.jalajel@retorec.com
What you should see
Written 4 row(s) to "Documents/budget.xlsx" — Sheet: "Sheet1" — Range: "A1:D4"

Open the file in Excel or OneDrive to confirm the data appeared. The cells are updated live — no need to re-upload the file.

Test 6 — Convert a File to PDF

Type this in Claude Code
convert_to_pdf Prompt to type

Works with any .docx, .pptx, or .xlsx file already stored in OneDrive:

Convert the file "Documents/budget.xlsx" in my OneDrive to PDF and tell me where it was saved. My email is fadi.jalajel@retorec.com
What you should see
Converted "Documents/budget.xlsx" → PDF saved at: /tmp/retorec-m365/[timestamp]-budget.pdf (124.3 KB)

The PDF is saved locally. To send it to OneDrive, follow up with: "Now upload that PDF to my OneDrive at Deliverables/budget.pdf"

Test 7 — Create a Word Document

Type this in Claude Code
create_word_document Prompt to type
Create a Word document titled "Q2 Project Brief" with the following content:
- A subtitle: "Retorec AI Workforce"
- Author: Fadi Jalajel
- Section heading "Objectives" with a bullet list: Deploy 50 agents, Integrate M365, Launch client pilot
- Section heading "Budget" with a table: columns are Item / Cost / Timeline, rows are: Agent infrastructure / $12,000 / Q2 | M365 integration / $3,500 / May | Client pilot / $8,000 / June
Then upload it to my OneDrive at "Documents/Q2-Brief.docx". My email is fadi.jalajel@retorec.com
What you should see
Word document created: /tmp/retorec-m365/q2-project-brief-[timestamp].docx (9.4 KB)
Uploaded → OneDrive: "Documents/Q2-Brief.docx"
URL: https://retorec-my.sharepoint.com/...

Open the file in OneDrive — you should see a formatted document with a title page, Retorec purple headings, and a styled table.

Supported section types: heading (level 1–3), paragraph, bullets, numbered, table, divider, pagebreak

Test 8 — Create a PowerPoint

Type this in Claude Code
create_powerpoint Prompt to type
Create a PowerPoint presentation titled "Retorec Q2 Strategy" using the retorec dark theme with these slides:
1. Title slide: "Retorec Q2 Strategy", subtitle "AI Workforce Expansion", footer "Confidential"
2. Content slide titled "Key Objectives" with bullets: Deploy 50 agents by June / Full M365 integration live / First external client pilot launched
3. Table slide titled "Budget Summary" with columns Item / Cost / Timeline and rows: Agent infrastructure / $12,000 / Q2 | M365 integration / $3,500 / May | Client pilot / $8,000 / June
4. Split slide titled "Risks vs Opportunities" — left side bullets: Timeline pressure / Auth complexity — right side bullets: First mover in Kuwait / Compounding DNA
5. Blank slide: title "Always Aim Higher", content "retorec.com"
Then upload it to my OneDrive at "Presentations/Q2-Strategy.pptx". My email is fadi.jalajel@retorec.com
What you should see
PowerPoint created: /tmp/retorec-m365/retorec-q2-strategy-[timestamp].pptx (88.2 KB)
Uploaded → OneDrive: "Presentations/Q2-Strategy.pptx"
URL: https://retorec-my.sharepoint.com/...

Open the file in PowerPoint or OneDrive — you should see a 5-slide deck with the dark Retorec theme, purple accent bars, and proper layout per slide type.

Slide types: titlecontent (bullets or body text) — tablesplit (two columns) — blank (title + optional text)
Themes: clean (white, professional) · retorec (dark, purple branded)

Full Agent Workflow — Brief to Deliverable

This is the complete pattern agents follow: read a brief from OneDrive, do the work, produce a deliverable, save it back. You can trigger this with a single prompt.

Example prompt
Read the brief at "Briefs/client-brief.docx" from my OneDrive (fadi.jalajel@retorec.com),
understand the requirements, then create a proposal as a Word document and a summary deck
as a PowerPoint. Save both to "Deliverables/client-proposal.docx" and
"Deliverables/client-proposal.pptx" in my OneDrive.

The agent will:

  1. Call download_file to pull the brief locally
  2. Read and analyze the content
  3. Call create_word_document with a structured proposal
  4. Call upload_file to save the DOCX
  5. Call create_powerpoint with a summary deck
  6. Call upload_file to save the PPTX
Both files land in OneDrive automatically. No human opened Word or PowerPoint. No files were manually attached or uploaded. The agent handled the full loop — read, think, generate, deliver.

M365 API endpoints reference

ToolGraph API call
list_drive_itemsGET /users/{email}/drive/root/children
download_fileGET /users/{email}/drive/root:/{path}:/content
upload_filePUT /users/{email}/drive/root:/{path}:/content
read_excelGET /drives/{id}/items/{id}/workbook/worksheets/{name}/range
write_excelPATCH /drives/{id}/items/{id}/workbook/worksheets/{name}/range
convert_to_pdfGET /users/{email}/drive/root:/{path}:/content?format=pdf
create_word_documentLocal generation (docx library) → PUT to OneDrive via upload_file
create_powerpointLocal generation (pptxgenjs library) → PUT to OneDrive via upload_file
Table 7 — M365 MCP Tool → Microsoft Graph API Mapping

Scrum Backlog — Microsoft Lists

The Scrum Backlog integration stores all software development work items inside Microsoft Lists (SharePoint) — zero extra cost, fully integrated with your M365 tenant. Agents can create epics, stories, tasks, bugs, and spikes; move items through a sprint; and render a live sprint board — all via natural language prompts.

📋
Storage
SharePoint List named "Retorec Backlog" on your M365 tenant — no external tools or subscriptions.
🔄
Methodology
Full Scrum — epics, story points, sprint assignment, acceptance criteria, and a Kanban-style sprint board.
🤖
Agent-native
Claude reads and writes the backlog through natural language. No ticket UI needed — describe what you want and it's done.

Item types & statuses

Item TypesStatusesPriorities
Epic · Story · Task · Bug · Spike Backlog · Ready · In Sprint · In Progress · In Review · Done · Cancelled Critical · High · Medium · Low
Table 8 — Scrum Backlog Item Types, Statuses & Priorities

One-Time Setup

Run setup_backlog once. It checks whether the SharePoint list already exists — if not, it creates it and provisions all custom columns automatically. After that, the list is ready to use forever.

Prerequisite: The M365 MCP server must already be running and authenticated (see Activating the Server). The app registration needs the Sites.ReadWrite.All Microsoft Graph permission to create and manage SharePoint lists.
Claude Code prompt — one-time backlog setup paste into a Claude Code session
Use the setup_backlog tool to initialise the Retorec Backlog list on SharePoint.
Tell me the list URL when done so I can bookmark it.
What you still need to do manually:

5 Tools at a Glance

🏗️
setup_backlog
Creates the "Retorec Backlog" SharePoint list and all custom columns. Safe to re-run — skips if list already exists.
create_backlog_item
Adds a new item (Epic, Story, Task, Bug, or Spike) with title, type, priority, sprint, story points, and acceptance criteria.
📄
list_backlog_items
Returns items filtered by sprint, status, type, assignee, or epic. Grouped by type for readability.
✏️
update_backlog_item
Updates any field on an existing item by ID — move status, change assignee, adjust story points, reassign to a sprint.
🗂️
get_sprint_board
Renders a Kanban-style sprint board for a named sprint — columns, item counts, story points done vs total, and completion %.

Test: Setup Backlog

Prompt
Run setup_backlog and show me the SharePoint list URL.
Expected result
✓ "Retorec Backlog" created successfully.
  List ID : <guid>
  Site ID : <guid>
  URL     : https://retorec.sharepoint.com/Lists/Retorec%20Backlog
  Columns : 10/10 created

Next: use create_backlog_item, list_backlog_items, update_backlog_item, get_sprint_board.

Test: Create a Backlog Item

Prompt
Create a Story in the backlog: "As a user I can log in with my email and password."
Priority: High. Story points: 5. Sprint: Sprint 1.
Acceptance criteria: login succeeds with valid credentials; login fails with invalid credentials.
Expected result
Created #2 [Story] "As a user I can log in with my email and password." [5pts]
Status: Backlog | Priority: High | Sprint: Sprint 1

Test: List Backlog Items

Prompt
List all backlog items in Sprint 1.
Expected result
3 item(s) found:

── Story (2) ──
  #2  As a user I can log in with my email and password. [5pts]  —  Backlog | High | Sprint 1
  #3  As a user I can reset my password via email. [3pts]  —  Backlog | Medium | Sprint 1

── Task (1) ──
  #4  Set up CI/CD pipeline  —  Backlog | High | Sprint 1

Test: Update a Backlog Item

Prompt
Move backlog item #2 to "In Progress" and assign it to Fadi.
Expected result
Updated #2: Status → In Progress | AssignedTo → Fadi

Test: Sprint Board

Prompt
Show me the sprint board for Sprint 1.
Expected result
Sprint Board: Sprint 1
─────────────────────────────────────────
Items: 1/4 done   Points: 3/16 (19%)

── In Sprint (1) ──
  • #4 [Task] Set up CI/CD pipeline — Fadi

── In Progress (1) ──
  • #2 [Story] As a user I can log in with my email and password. (5pts) — Fadi

── In Review (0) ──
  (empty)

── Done (1) ──
  • #3 [Story] As a user I can reset my password via email. (3pts)

── Cancelled (0) ──
  (empty)

Scrum Workflow with Agents

Agents can run every Scrum ceremony as a conversational flow. Here is the standard pattern for each event.

Sprint Planning

At the start of a sprint, define items and assign them to the sprint.

Example prompt
We're starting Sprint 2. Pull everything in the backlog with status "Ready" and move
them into Sprint 2. Assign the 3 highest-priority stories to Fadi and the rest to the
team backlog. Show me the sprint board when done.

Daily Standup

Ask for a snapshot of what's in flight across the team.

Example prompt
Give me a daily standup summary for Sprint 2: what's In Progress, what's In Review,
and what's blocked or hasn't moved since yesterday's sprint board.

Moving Items Through the Board

During the sprint, agents update status as work progresses.

Example prompt
Item #7 is done — move it to Done. Item #9 is blocked — add a note in its description
and move it back to In Sprint. Show me the updated board.

Sprint Review & Retrospective

At the end of a sprint, get a completion summary and close out the sprint.

Example prompt
Sprint 2 is over. Show me the final sprint board. Cancel any items still In Sprint
that weren't started. List all Done items with their story points so I can calculate
velocity. Then create these 4 new stories in the backlog for Sprint 3: [list them].
No separate tool needed. The backlog lives in Microsoft Lists — your team can also view and edit it directly at the SharePoint URL. Agents write to the same list, so agent changes are immediately visible in the browser and vice versa.

Telegram Inbox — Project Communication Channel

Every Retorec project gets a dedicated Telegram group with a bot. Founders use it as a live channel to send instructions, share insights, forward meeting notes, drop files, and record voice memos — all from any device, at any time. The bot receives everything, classifies it, saves it to a shared Microsoft List, and posts a confirmation back to the group. At the next Claude Code session, unread items surface automatically in the briefing. Nothing gets lost.

What you sendWhat the bot doesWhere it ends up
Text messageClassifies intent, saves to inboxRetorec_ProjectInbox list · Status: new
Voice messageTranscribes audio → saves transcript + audio fileList + SharePoint file library
ImageDescribes image via Claude Vision → saves descriptionList + SharePoint file library
File (PDF/Word/Excel)Uploads to SharePoint → extracts text if possibleList + SharePoint file library
VideoUploads to SharePoint, saves duration + captionList + SharePoint file library
!go + instructionExecutes immediately — writes file, no review neededProject directory + List · Status: routed
Table — What the bot does with each message type

How It Works

The flow for a normal message (no !go):

Founder sends anything to the project Telegram group
        ↓
Bot receives message
        ↓
1. Download media if present (voice/image/file/video)
2. Transcribe audio  →  Claude Haiku Whisper-style
   Describe image    →  Claude Haiku Vision
   Upload file       →  SharePoint document library
        ↓
3. Classify with Claude Haiku:
   type: text / voice / image / file / video
   intent: instruction / insight / update / meeting-note / file / question
        ↓
4. Save record to Retorec_ProjectInbox (Status = new)
        ↓
5. Post confirmation back to the group:
   "✓ Voice message received — classified as instruction
    Saved to inbox. Review it at your next session with /retorec-inbox"
Figure — Normal message flow (queued for manual review)

At session start, /retorec-session-start queries the list and surfaces the count:

INBOX
  3 unread Telegram messages — run /retorec-inbox to review

The !go Trigger

Prefix any message with !go (case-insensitive: !go, !Go, !GO) to bypass the review queue and execute immediately. The bot interprets the instruction, writes the appropriate file into the project directory, updates the list, and reports back — all within seconds of sending.

Same trigger word across all projects. !go is universal — no per-project secret code to remember.
Example — adding a backlog item from Telegram
Fadi sends:  "!go Add Apple Pay support to the checkout flow in the velo backlog"

Bot replies in the group (within ~5 seconds):
  ⚡ !go executed
  Added Apple Pay support requirement to backlog

  → Written to ~/Retorec/projects/velo/operation/roadmap/backlog/apple-pay-2026-05-14.md
Example — saving a meeting note
Fadi sends:  "!go Meeting with Kuwait Airways today. Decision: we build the
              mobile app first, web portal in Q3. Budget approved at KD 45,000."

Bot replies:
  ⚡ !go executed
  Recorded meeting decision — Kuwait Airways engagement scope

  → Written to ~/Retorec/projects/velo/operation/knowledge/product/kuwait-airways-decision-2026-05-14.md
Example — ambiguous instruction (falls back to review queue)
Fadi sends:  "!go fix the thing we discussed"

Bot replies:
  ⚠ !go — needs more context
  Instruction was unclear — no specific action could be determined.
  Added to your review queue. Run /retorec-inbox to clarify.

When an instruction is ambiguous, the bot downgrades it to Status = new — it appears in the review queue at your next session so nothing falls through the cracks.

Media Support

TypeProcessingWhat's saved to the List
Voice message Audio downloaded → transcribed via Claude → uploaded to SharePoint Full transcript as RawText · audio file URL as MediaUrl
Image Downloaded → described via Claude Vision → uploaded to SharePoint 1-2 sentence description as RawText · image URL as MediaUrl
File (PDF / Word / Excel) Downloaded → text extracted if possible → uploaded to SharePoint Filename + caption as RawText · file URL as MediaUrl
Video Downloaded → uploaded to SharePoint Duration + caption as RawText · video URL as MediaUrl
Text + caption Saved as-is Full text as RawText
Table — Media processing per type
Media files land in SharePoint: the file library at SharePoint → Sites → Retorec → Documents → Inbox → <project-name>/. The MediaUrl column in the list links directly to each file. When you route a voice message to a project directory, the transcript becomes the file content and the audio URL is preserved as a reference — nothing is lost.

Setting It Up — Per Project

One-time setup per project. The SharePoint list is shared — create it once for all projects.

1

Create the SharePoint list (once, not per project)

cd ~/Retorec/retorec-agent-os/tools/telegram-inbox
npm install
cp projects/.env.example projects/.env.velo   # edit this first
npm run setup-list

This creates Retorec_ProjectInbox in your SharePoint tenant with all 13 columns. Running it again on an existing list is safe — it skips existing columns.

2

Find your SharePoint site ID

node scripts/get-site-id.js

Copy the ID shown and paste it as SHAREPOINT_SITE_ID in your .env.<project> file.

3

Create a Telegram bot via @BotFather

  1. Open Telegram → search @BotFather → start chat
  2. Send /newbot
  3. Name it: Velo Project (display name, can be anything)
  4. Username: retorec_velo_bot (must be unique, ends in "bot")
  5. Copy the token BotFather gives you → paste as TELEGRAM_BOT_TOKEN
4

Create the project group and get the chat ID

  1. Create a new Telegram group: Velo — Project
  2. Add your bot to the group (search by its username)
  3. Send any message in the group
  4. Get the chat ID: open https://api.telegram.org/bot<TOKEN>/getUpdates in your browser
  5. Find "chat":{"id": -100xxxxxxxxxx} — copy that number (negative)
  6. Paste as TELEGRAM_CHAT_ID in your .env.velo file
5

Complete the .env file

# projects/.env.velo
PROJECT_NAME=velo
TELEGRAM_BOT_TOKEN=<from BotFather>
TELEGRAM_CHAT_ID=<negative number from getUpdates>
MS_TENANT_ID=<same as your M365 MCP server .env>
MS_CLIENT_ID=<same as your M365 MCP server .env>
MS_CLIENT_SECRET=<same as your M365 MCP server .env>
SHAREPOINT_SITE_ID=<from get-site-id.js>
ANTHROPIC_API_KEY=<your Anthropic key>

The MS_ credentials are identical to what you already have for the M365 MCP server — no new app registration needed.

6

Install PM2 and start the bot

npm install -g pm2
./deploy.sh

You should see telegram-inbox-velo running. Verify with:

pm2 list
pm2 logs telegram-inbox-velo
7

Adding a second project

cp projects/.env.velo projects/.env.<new-project>
# Edit the new file — change PROJECT_NAME, TOKEN, CHAT_ID
cp projects/velo.config.json projects/<new-project>.config.json
# Edit projectName and projectDir in the config
./deploy.sh   # picks up the new .env file automatically

No code changes needed. deploy.sh finds every .env.* file in projects/ and starts a bot for each one.

8

Deploying a core update to all bots

git pull origin main   # get latest core/ changes
./deploy.sh            # restarts all running bots

All project bots run the same core/ codebase. One deploy updates all of them.

/retorec-inbox — Reviewing Your Queue

When the session-start briefing shows unread inbox items, run /retorec-inbox to process them. The agent presents each item as a card, waits for your routing decision, writes the file, updates the list, and posts a confirmation back to the Telegram group.

Example card
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  INBOX  [2 of 3] — velo
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  From:   Fadi
  When:   Today 09:32
  Type:   voice (transcribed)
  Class:  instruction

  "The checkout flow needs to support Apple Pay.
   Prioritise it — customers are asking for it."

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  What should I do with this?

  [1] operation/roadmap/backlog/
  [2] operation/knowledge/improvements/
  [3] operation/knowledge/product/
  [4] memory/fadi/
  [5] memory/mhd/
  [6] docs/
  [7] operation/incidents/
  [8] Custom path
  [9] Archive (no action)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

After you choose, the agent writes the file and posts back to the Telegram group:

✓ Inbox item from Fadi (09:32) processed
→ Routed to operation/roadmap/backlog/apple-pay-2026-05-14.md
ScenarioWhat the agent does
Normal message, clear intentPresents routing menu, writes on your choice
Voice messageShows full transcript; audio URL preserved in the written file
Image or fileShows description / filename + SharePoint URL
Ambiguous contentAsks a clarifying question before offering routing options
ArchiveMarks Status = archived, no file created, no Telegram reply
SharePoint unreachableWrites file locally, logs the list update failure
Table — /retorec-inbox behaviour by scenario

Hello World — Full Walkthrough

This section walks you through the entire system using a sample project called hello-memory. By the end you will have run a session, reviewed lessons, run synthesis, and approved a skill — one full loop.

Estimated time: 15–20 minutes. Complete the GitHub SSH setup and machine setup (including the global .env) first.
1

Create the sample project

mkdir -p ~/Retorec/projects/hello-memory/{.claude,scripts}
cd ~/Retorec/projects/hello-memory
git init
git config user.email "mohammad.binsabt@retorec.com"
2

Set up project identity

echo 'PROJECT_NAME=hello-memory' > .claude/project.env

Credentials are loaded automatically from ~/Retorec/retorec-agent-os/.env — no copying needed.

3

Copy the scripts

cp ~/Retorec/projects/velo/scripts/*.sh scripts/
chmod +x scripts/*.sh

Open scripts/identity.sh and update the fallback project name:

export PROJECT_NAME="${PROJECT_NAME:-hello-memory}"
4

Verify hooks are configured

cat ~/.claude/settings.json

You should see four hook commands. If not, go back to Machine Setup.

5

Start a Claude session and have a real conversation

claude

Ask Claude something with back-and-forth. At least 5–6 messages — the transcript needs content for extraction. Try:

You: explain how binary search works and write a Python example
Claude: [explains, writes code]
You: what are the limitations of binary search?
Claude: [answers]
You: how would you use this in a database lookup?
Claude: [answers]

Exit with /exit or Ctrl+C.

6

Review pending lessons

Wait 10–15 seconds after the session ends, then:

bash scripts/review-lessons.sh

You should see 1–5 lesson candidates. Save at least 2.

If "No pending lessons" appears — check that .claude/project.env exists and the hook paths in settings.json use your correct username.
7

Add a manual lesson

bash scripts/save-lesson.sh hello-memory \
  "Binary search only works on sorted data — always verify sort order before applying." \
  high global
8

View your active lessons

bash scripts/memory-lessons.sh

You should see the lessons you approved listed with IDs, importance, and scope.

9

Run synthesis

node ~/Retorec/retorec-agent-os/memory/scripts/synthesize.js

Takes 15–30 seconds. The job calls Claude Opus to analyze your lessons.

10

Review skill candidates

bash scripts/review-skills.sh

If skills appear, press a to approve or r to reject. If none appear, the knowledge base is too small — run more sessions, approve more lessons, then try again.

11

Done — the loop is running

You have completed one full cycle: session → extraction → review → synthesis → skill approval.

From here the system runs on its own rhythm:

  • Every Claude session extracts lessons automatically
  • You review lessons whenever you want with review-lessons.sh
  • Weekly you run synthesize.js and review-skills.sh

Test Drive — Telegram Inbox

This walkthrough tests the full Telegram inbox flow end to end: bot receives a message, classifies it, saves it to SharePoint, posts a confirmation back to the group, and the session-start briefing surfaces it. Estimated time: 20–30 minutes (most of it is BotFather setup, which you only do once).

Prerequisites: complete the main Hello World walkthrough above, have the M365 MCP server working (so your MS Graph credentials are confirmed), and have npm available. The Telegram inbox bot lives at ~/Retorec/retorec-agent-os/tools/telegram-inbox/.
1

Install dependencies

cd ~/Retorec/retorec-agent-os/tools/telegram-inbox
npm install

Installs: node-telegram-bot-api, @anthropic-ai/sdk, node-fetch, dotenv.

2

Create the Telegram bot via @BotFather

  1. Open Telegram on your phone or desktop
  2. Search for @BotFather and open the chat
  3. Send: /newbot
  4. When asked for a name, type: Hello Memory Test
  5. When asked for a username, type: retorec_hello_test_bot (must end in "bot" and be globally unique — add your name if taken)
  6. BotFather replies with a token like: 7612345678:AAFxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  7. Copy this token — you will need it in the next step
3

Create a Telegram test group and add the bot

  1. Create a new Telegram group — name it Hello Memory — Project
  2. Add @retorec_hello_test_bot as a member
  3. Send any message in the group (e.g. "test")
  4. Open this URL in your browser (replace TOKEN with yours):
    https://api.telegram.org/botTOKEN/getUpdates
  5. Find the "chat":{"id": ...} value — it will be a negative number like -1001234567890
  6. Copy this chat ID
4

Find your SharePoint site ID

# Create a temporary .env with just your MS credentials
cp projects/.env.example projects/.env.hello-memory
# Fill in MS_TENANT_ID, MS_CLIENT_ID, MS_CLIENT_SECRET, ANTHROPIC_API_KEY
# Leave the rest blank for now — we're just finding the site ID

node scripts/get-site-id.js

The script lists all SharePoint sites your app registration can see. Copy the ID of your Retorec site.

5

Complete the .env file

# projects/.env.hello-memory
PROJECT_NAME=hello-memory
TELEGRAM_BOT_TOKEN=7612345678:AAFxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TELEGRAM_CHAT_ID=-1001234567890
MS_TENANT_ID=your-tenant-id
MS_CLIENT_ID=your-client-id
MS_CLIENT_SECRET=your-client-secret
SHAREPOINT_SITE_ID=your-site-id-from-step-4
ANTHROPIC_API_KEY=your-anthropic-key
Never commit .env.* files. They are gitignored. The projects/.env.example template is the only file that gets committed.
6

Create the SharePoint list (one-time, shared across all projects)

npm run setup-list

Expected output:

Creating list: Retorec_ProjectInbox...
✓ List created: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  Adding column: Project... ✓
  Adding column: Sender... ✓
  Adding column: Timestamp... ✓
  ... (13 columns total)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Retorec_ProjectInbox is ready.
  All project bots will now write to this list.

If you see "already exists" for any column, that's fine — the script is idempotent.

7

Add the hello-memory project config

cp projects/velo.config.json projects/hello-memory.config.json

Edit hello-memory.config.json — change projectName to hello-memory and projectDir to ~/Retorec/projects/hello-memory.

8

Start the bot

npm install -g pm2   # skip if already installed
./deploy.sh

Expected output:

→ Project: hello-memory
  Starting new process...
  ✓ telegram-inbox-hello-memory running

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  All bots deployed. Run: pm2 list

Verify the bot is live:

pm2 logs telegram-inbox-hello-memory --lines 5

You should see: [hello-memory] Bot started — listening for messages in chat -100...

9

Test 1 — Send a plain text message

In the Hello Memory — Project Telegram group, send:

We should add a dark mode to the app. Users have been requesting it for months.

Expected bot reply within 3–5 seconds:

✓ Message received — classified as insight
Saved to inbox. Review it at your next session with /retorec-inbox

Open Microsoft Lists in your browser → Retorec_ProjectInbox.
You should see a new row with: Project=hello-memory, Classification=insight, Status=new.

10

Test 2 — Send a voice message

In the same group, record and send a short voice message (10–20 seconds). Say something like:

"Reminder — we need to finalise the pricing page before the end of the week. Talk to Mohammad about the KD vs USD decision."

Expected bot reply:

✓ Voice message received — classified as instruction
Saved to inbox. Review it at your next session with /retorec-inbox

In Microsoft Lists, the new row should have MessageType=voice and RawText containing the transcript of what you said. The MediaUrl column will contain the SharePoint URL of the audio file.

11

Test 3 — Send an image

Take a screenshot of anything (a competitor website, a wireframe sketch, a photo from your phone) and send it to the group, with a caption:

[image] Caption: Competitor pricing page — reference for our own layout

Expected bot reply:

✓ Image received — classified as insight
Saved to inbox. Review it at your next session with /retorec-inbox

In Microsoft Lists: MessageType=image, RawText contains Claude Vision's 1–2 sentence description of the image, MediaUrl links to the uploaded image in SharePoint.

12

Test 4 — The !go trigger

Send this message exactly:

!go Add a backlog item: implement dark mode toggle — high priority, requested by multiple users

Expected bot reply within 5–8 seconds:

⚡ !go executed
Added dark mode toggle to backlog — high priority user request

→ Written to ~/Retorec/projects/hello-memory/operation/roadmap/backlog/dark-mode-toggle-2026-05-14.md

Verify the file was created on disk:

cat ~/Retorec/projects/hello-memory/operation/roadmap/backlog/dark-mode-toggle-*.md

In Microsoft Lists: the row for this message should have Status=routed and RoutedTo populated — it was never in the review queue.

13

Test 5 — Review the queue at session start

Open a new Claude Code session in the hello-memory project directory:

cd ~/Retorec/projects/hello-memory
claude

Run the session-start agent:

/retorec-session-start

Expected briefing includes:

INBOX
  3 unread Telegram messages — run /retorec-inbox to review

(3 because the text, voice, and image messages are new — the !go message was already routed.)

Now run the inbox agent:

/retorec-inbox

The agent presents the first item as a card with routing options. Choose option [1] (backlog) for the dark mode insight, then [2] (improvements) for the voice note, and so on. After each choice, check that:

  • The file was created in the right directory
  • The Microsoft List row shows Status=routed
  • The Telegram group received a confirmation message
14

All tests passed ✓

The Telegram inbox is fully operational. The full verified flow is:

  • Text / voice / image → classified → saved to SharePoint List → confirmed in group
  • !go → executed immediately → file written → confirmed in group
  • Session start → inbox count shown when items are waiting
  • /retorec-inbox → one-by-one review → file created → list updated → Telegram confirmation
To add the bot to a real project, copy .env.hello-memory to .env.<project>, create a new BotFather bot, update the 3 project-specific values (TOKEN, CHAT_ID, PROJECT_NAME), and run ./deploy.sh. No code changes needed.

API Endpoints Reference

These endpoints apply to the Supabase backend only (MEMORY_BACKEND=supabase). When using SharePoint (the default), all writes and reads go directly to Microsoft Graph API — there is no REST API layer to call manually. To inspect SharePoint data, open the Memory_* lists at https://retorec.sharepoint.com/Lists/.

Base URL: https://memory-api-fawn.vercel.app
All endpoints require: x-api-key: <RETOREC_API_KEY>

MethodEndpointWhat it does
GET/healthHealth check — no auth required
POST/lessonsSave an approved lesson
GET/lessons?project_name=XFetch all active approved lessons
PATCH/lessons/:idUpdate status (active / superseded / archived)
POST/pending-lessonsStage a lesson candidate for review
GET/pending-lessons?project_name=X&status=pending&include_frequency=trueFetch pending lessons with frequency counts
PATCH/pending-lessons/:idUpdate status (approved / skipped)
POST/session-summariesSave a session summary
GET/session-summaries?project_name=XFetch session summaries
POST/session-progressSave task progress records
GET/session-progress?project_name=XFetch task progress
POST/synthesis-reportsSave a synthesis report
GET/synthesis-reports?project_name=XFetch synthesis reports
POST/skillsAdd an approved skill to the registry
GET/skills?project_name=XFetch active skills
POST/pending-skillsStage a skill candidate
GET/pending-skills?project_name=X&status=pendingFetch pending skills
PATCH/pending-skills/:idUpdate status (approved / rejected)
POST/personsUpsert a person record (email required, name/role optional)
GET/personsList all persons in the system
POST/person-observationsSave a single observation (email, category, observation, evidence)
GET/person-observations?email=X&category=YFetch all observations for a person — category filter is optional
Table 9 — Supabase Memory API Endpoints (MEMORY_BACKEND=supabase only)

Shell Commands Reference

CommandBackendWhen to use
node ~/Retorec/retorec-agent-os/memory/scripts/setup-sharepoint.jsSharePointOne-time — create all 7 Memory_* lists on your SharePoint site
bash scripts/review-lessons.shSupabaseAfter sessions — interactive terminal review of pending lessons
bash scripts/review-skills.shSupabaseAfter synthesis — interactive terminal review of skill candidates
bash scripts/memory-lessons.shSupabaseAny time — view all active approved lessons
bash scripts/save-lesson.sh <project> "text" <imp> <scope>SupabaseAny time — save a lesson manually from the terminal
node ~/Retorec/retorec-agent-os/memory/scripts/synthesize.jsBothWeekly — analyze approved lessons and propose skill candidates
node ~/Retorec/retorec-agent-os/memory/scripts/show-profile.js --listBothAny time — list all persons tracked in the system
node ~/Retorec/retorec-agent-os/memory/scripts/show-profile.js <email>BothAny time — generate and print a full AI-synthesized profile for a person
Table 10 — Shell Commands Reference
ImportanceUse when
highGetting this wrong causes failures or significant wasted time
mediumUseful to remember — improves efficiency or quality
lowNice to know — minor observation or reference fact
Table 11 — Lesson Importance Levels

Troubleshooting

No lessons appear after a session

  1. Confirm ~/.claude/settings.json has the hooks block with your correct username.
  2. Confirm .claude/project.env exists in the project root with PROJECT_NAME set.
  3. Confirm ~/Retorec/retorec-agent-os/.env has all required credentials (see below).
  4. Run the hook manually to see errors:
    cd ~/Retorec/projects/hello-memory
    node ~/Retorec/retorec-agent-os/memory/scripts/extract-lessons.js

Required credentials by backend

CredentialSharePoint (default)Supabase
MEMORY_BACKENDsharepoint (or omit)supabase
M365_TENANT_IDRequiredNot needed
M365_CLIENT_IDRequiredNot needed
M365_CLIENT_SECRETRequiredNot needed
SHAREPOINT_HOSTRequired (retorec.sharepoint.com)Not needed
MEMORY_API_URLNot neededRequired
RETOREC_API_KEYNot neededRequired
CLAUDE_API_KEYRequired (synthesis + profiles)Required (synthesis + profiles)
Table 12 — Required Credentials by Backend

SharePoint: "No lists found" or "site not found"

The SharePoint lists haven't been created yet. Run the one-time setup:

node ~/Retorec/retorec-agent-os/memory/scripts/setup-sharepoint.js

SharePoint: Graph API returns 401

M365_CLIENT_ID, M365_CLIENT_SECRET, or M365_TENANT_ID in ~/Retorec/retorec-agent-os/.env is wrong or missing. Verify the app registration in Azure AD has Sites.ReadWrite.All permission granted.

Sessions tagged as "unknown" project

PROJECT_NAME was not found. Check .claude/project.env exists and contains PROJECT_NAME=your-project-name.

Supabase API returns 401 Unauthorized

The RETOREC_API_KEY in ~/Retorec/retorec-agent-os/.env is wrong or missing. Check with Fadi.

SSH authentication fails on git push/pull

Make sure you're using github-retorec (not github.com) in your remote URL:

git remote set-url origin git@github-retorec:Retorec/repo-name.git

Synthesis fails with "CLAUDE_API_KEY not set"

Add CLAUDE_API_KEY=<your Anthropic key> to ~/Retorec/retorec-agent-os/.env.

Synthesis says "Not enough lessons — need at least 2"

SharePoint: Open Memory_Lessons, filter by Status = approved or active — fewer than 2 have been approved yet.
Supabase: Run review-lessons.sh or add manual ones with save-lesson.sh.

Scripts show wrong user email (personal instead of Retorec)

cd ~/Retorec/projects/your-project
git config user.email "mohammad.binsabt@retorec.com"

review-lessons.sh: "command not found: python3"

This script is Supabase-only. Install Python 3 if needed: brew install python3

show-profile.js: "No observations found"

No sessions have fired the profile hook yet for that email. Check two things:

  1. Confirm git config user.email returns the correct Retorec email in the project directory.
  2. Confirm the fourth hook (extract-person-observations.js) is present in ~/.claude/settings.json.

Run a real session (not a trivial one), wait 10 seconds, then try again.

show-profile.js: profile is very sparse

Fewer than 5 sessions have been observed. This is expected early on. Profiles improve significantly after 8–10 sessions. Short or purely lookup-based sessions produce no observations — sessions with back-and-forth decisions, design discussions, and problem-solving generate the richest data.

Person email is showing as "unknown"

The user_email field comes from git config user.email in the working directory. Set it correctly before starting a session:

git config user.email "fadi.jalajel@retorec.com"

Retorec Agent OS vs Claude Team / Enterprise

A common question: if we already have a Claude Team or Enterprise subscription, what does Retorec Agent OS add? The answer is that they operate at completely different layers — they are complementary, not competing.

What Claude Team / Enterprise Is

A subscription tier for the claude.ai web interface. It gives your team a better chat experience:

FeatureWhat it does
Shared ProjectsConversations grouped into folders, shared with teammates
Custom System PromptsOne system prompt per workspace or project
Conversation historyPersists within claude.ai sessions
Admin controlsUser management, SSO / SAML (Enterprise tier)
Usage analyticsToken usage per seat
Longer contextHigher context window limits
Priority accessNo rate limits at peak hours

In short: a better web chat for a team. The intelligence is Claude the model. The workspace is claude.ai. That is the full scope.

What Retorec Agent OS Is

An execution operating system built on top of Claude Code (the CLI), not the web interface. It operates one layer deeper — closer to your file system, your git repo, your live projects:

FeatureWhat it does
150+ specialised agentsEach with its own identity, rules, and automatic routing logic
Persistent cross-session memoryGit-committed, shared between developers, survives restarts and months
Project structure standardEnforced scaffold for every project from day one — no improvisation
Methodology enforcementValidate → Architect → Engineer → Scale baked into every session
Session protocolsStart / end briefings, memory writes, partner sync routines
Telegram inboxPer-project bots, messages classified and routed, !go action trigger
Operation directoriesAgents have live context to manage and automate projects post-launch
Tool permissionsFine-grained control over what agents can read, write, and execute
DNA rulesIdentity, brand, methodology — loaded into every agent on every session

The Five Real Differences

1. Memory
Claude Team remembers conversations within the web UI for that browser session. Retorec Agent OS writes structured memory files to git — cross-machine, cross-developer, compounding over time. Mohammad can pull the repo and instantly know what Fadi's Claude decided three weeks ago.

2. Agent Specialisation
Claude Team gives you one Claude per conversation. Retorec has 150+ agents, each pre-configured for a domain. When the task shifts from backend architecture to brand design, the right agent activates automatically — with the right rules already loaded.

3. Project Intelligence
Claude Team has no concept of a "project" beyond a folder of conversations. Retorec Agent OS knows the project's tech stack, methodology, current operational state, and every decision ever recorded — and loads all of it into the agent before it writes a single line.

4. Automation
Claude Team is fully manual: you open a conversation, you get a response. Retorec can run Telegram bots, session hooks, scheduled routines, and multi-step pipelines without a human initiating each step.

5. Compounding Intelligence
Claude Team starts fresh every session. Retorec's memory compounds — every session adds to what the agents know about your business, your decisions, and your standards. That accumulation is what Retorec calls Agentic DNA: intelligence that cannot be copied because it is built from your own history.

How the Layers Stack

┌─────────────────────────────────────────────────┐
│            Retorec Agent OS                     │  ← your operating system
│  agents · memory · projects · DNA               │
│  session protocols · Telegram · operation/      │
├─────────────────────────────────────────────────┤
│            Claude Code  (CLI)                   │  ← the engine
│  reads CLAUDE.md · executes tools · uses files  │
├─────────────────────────────────────────────────┤
│        Claude Pro / Max / API subscription      │  ← the model access layer
│          (what powers Claude Code)              │
└─────────────────────────────────────────────────┘

              (separate track)
┌─────────────────────────────────────────────────┐
│         Claude Team / Enterprise                │  ← web interface tier
│   shared conversations · SSO · admin controls  │
└─────────────────────────────────────────────────┘

When to Use Each

SituationUse
Non-technical teammates need to chat with Claude via a browserClaude Team / Enterprise
Building software, running agents, writing codeRetorec Agent OS + Claude Code
You need SSO, compliance, or seat managementClaude Enterprise
You need memory that outlasts a session and spans two developersRetorec Agent OS
You need 150+ specialised agents with domain expertiseRetorec Agent OS
You need automated project operations post-launchRetorec Agent OS
The honest summary: Claude Team / Enterprise gives you a better chat. Retorec Agent OS gives you a workforce. They are not in competition — you can run both. Claude Team for colleagues using the web interface; Retorec Agent OS for the builders running Claude Code on real projects.

Retorec Agent OS v1.8  ·  May 2026  ·  Questions: fadi.jalajel@retorec.com