Skip to content
rentfreecoPublic

Repository files navigation

rentfree: living rent free in your AI agents

Website · Get started · CLI reference · API reference · Changelog

@rentfree/cli on npm @rentfree/sdk on npm CI Node.js 20 or later MIT licence

rentfree gives coding agents a memory that lasts between sessions. It captures what happens, turns it into memories, and hands back the right context for the next turn, within a token budget. This repository holds rf, its command line, and the TypeScript SDK rf is built on.

Quick start

npm install -g @rentfree/cli

# Sign in through the browser; a first sign-in is a sign-up
rf init

# In your project: give Claude Code a memory of every session there
rf hooks install

That is all Claude Code needs. To try it by hand, write a memory and ask for the context a turn would get:

rf remember "Deploys go out from main, once CI is green." --type decision
rf context "how do we deploy?"

The get started guide goes further, and the concepts explain collections, sessions, recap, and memories.

Built for agents

Memory in every session

One command wires rentfree into Claude Code. Each session starts with what it remembers and is recapped when it ends, with no tokens spent on either.

$ rf hooks install
Installed 4 hooks in .claude/settings.json:
event             command
SessionStart      rf hooks run session-start
UserPromptSubmit  rf hooks run prompt
Stop              rf hooks run stop
SessionEnd        rf hooks run session-end

Context within a budget

One call returns what the next turn needs: the profile, then the memories and passages that bear on the question. Text for a model, JSON for a script.

$ rf context "how do we deploy?"
## Memories
- Deploys go out from main once CI is green.
- Migrations run before the api deploys.
## From your documents
### runbook.md · Deploying
Run the release workflow from main.

Every memory traceable

Each memory keeps the words it came from and every change made to it, so you can see why your agent believes something, and correct it.

$ rf memories sources mem_8KfQ2
from                     quote
session ses_4tR event 9  deploy only from main
session ses_8Wm event 3  CI must pass first
source src_2Lk           release from main

From code

The SDK is the same api, typed by the contract the api itself validates with:

import { createClient } from "@rentfree/sdk";

const rf = createClient({ apiKey: process.env.RF_API_KEY });

const { collections } = await rf.me.get();
const collectionId = collections.find((c) => c.isDefault)!.id;

// Text for the next turn's prompt, within a budget
const pack = await rf.context({
  collectionId,
  query: "how do we deploy?",
  tokenBudget: 1500,
});
console.log(pack.text);

What is here

Path What it is On npm
packages/cli rf, the command line @rentfree/cli
packages/sdk The API's contract, its OpenAPI document, and the TypeScript client rf is built on @rentfree/sdk
packages/eslint-config, packages/typescript-config The configs both build with

The rentfree service itself is not in this repository.

Documentation

Developing

Node.js 24 and pnpm, through Corepack:

corepack enable
pnpm install
pnpm build
pnpm test

node packages/cli/dist/rf.mjs --help runs the CLI you just built. It talks to https://api.rentfree.dev unless --api-url, RF_API_URL, or the address saved at login says otherwise.

How this repository is kept

The CLI and SDK are developed beside the service, in a private repository, and every change to them is copied here as one commit. Issues and pull requests are welcome here. A pull request is applied in the private repository and comes back with the next copy, credited to you, rather than merged here, where the next copy would replace it. CONTRIBUTING.md has the details.

Releases

Both packages are released together, at one version, from this repository. Each release's notes are on the releases page.

License

MIT

Releases

Packages

Contributors

Languages