{
  "markdown": "# WhereWasI\n\n[![tests](https://img.shields.io/github/actions/workflow/status/sebastianbreguel/wherewasi/test.yml?branch=main&label=tests&style=flat)](https://github.com/sebastianbreguel/wherewasi/actions/workflows/test.yml) [![Python 3.12+](https://img.shields.io/badge/python-3.12%2B-blue?style=flat)](https://www.python.org/) [![license](https://img.shields.io/github/license/sebastianbreguel/wherewasi?style=flat)](LICENSE)\n\n**Claude forgets everything between sessions.** What you were doing, what's next, what broke — gone the moment you close the terminal.\n\nWhereWasI fixes that one thing well. Open a project tomorrow and the first thing you see is *the last task you were on and the next step* — so you pick up immediately. Per-project, automatic, no config.\n\nThis is **not** a memory bank. No search, no recall by topic, no accumulated history. Just the current state, to the point.\n\n## What you see\n\nWhen you open Claude Code (or **Codex CLI**) in a project, WhereWasI injects a short resume at the top of the session:\n\n```\n# where was i: wherewasi  ·  branch wherewasi-v2\n\nLast: Rewriting docs for the resume pivot (README + architecture).\nNext: Run the full test suite + ruff, then deploy with install.sh.\n\n3 uncommitted · a1b2c3d docs rewrite\n```\n\nTwo load-bearing lines — **Last** (where you were) and **Next** (what to do) — over one compact git line for grounding. No file dumps, no stale error echoes (you have `git` for that). Zero latency: it's read from a file, no LLM call at open.\n\n## How it works\n\nWhereWasI is **files + hooks. No database.** One Markdown file per project at `~/.claude/wherewasi/resume/<cwd-slug>.md` (the cwd path, slashes turned to dashes), refreshed as you work:\n\n1. **Every 25 prompts** (`UserPromptSubmit`, **no LLM**) — a cheap refresh of the git line (branch, uncommitted count, last commit). Your `Last`/`Next` narrative is preserved.\n2. **On compaction** (`PreCompact`, **LLM**) — `claude --print` reads the transcript tail and rewrites `Last` + `Next` from what you were actually doing.\n3. **On session end** (`SessionEnd`, **LLM**) — rewrites `Last` + `Next` when you leave, so a short session that never compacted isn't stale the next time you open. Runs detached, so it never delays your exit.\n4. **On session start** (`SessionStart`) — the resume file is read and injected (with git refreshed live). First time in a project? You get a minimal git-derived resume so you never open blank.\n\nReplace semantics: the file always reflects the current state. No history accumulates.\n\n## Install\n\n**Requirements:** [Claude Code](https://docs.anthropic.com/en/docs/claude-code) and/or [Codex CLI](https://developers.openai.com/codex), `python3` (stdlib only — no `uv`, no pip, no deps).\n\n**As a Claude Code plugin (recommended):**\n\n```bash\n# In Claude Code:\n/plugin install wherewasi@sebastianbreguel/wherewasi\n```\n\n**Or clone and run the installer:**\n\n```bash\ngit clone https://github.com/sebastianbreguel/wherewasi.git\ncd wherewasi && ./install.sh\n```\n\n> Use **the marketplace install OR `./install.sh`, not both** — each registers the hooks separately, so doing both fires every hook twice (and pays the compaction LLM cost twice).\n\n**Codex CLI (also supported):** `./install.sh` auto-detects `~/.codex` (or `$CODEX_HOME`) and wires Codex too. Codex hooks share Claude Code's JSON stdin/stdout wire protocol, so the same `wherewasi.py` runs unchanged. It needs `[features].hooks = true` in `~/.codex/config.toml`, and Codex may prompt to trust the hook on first launch. Resume state is **shared** with Claude (one `~/.claude/wherewasi/resume/<slug>.md` per project), so switching between the two on the same repo shows the same \"where was I\". Note: Codex has no `SessionEnd` event, so the end-of-session LLM rewrite is skipped there — `PreCompact` + the rolling git refresh keep it fresh.\n\n> **First session in a project:** you get a minimal git-only resume.\n> **After you've worked a bit:** the resume fills in with your last task + next step.\n\n```bash\n# Uninstall (also cleans up legacy engram data, if any)\ncd wherewasi && ./uninstall.sh\n```\n\n## Commands\n\n```bash\npython3 ~/.claude/tools/wherewasi.py --cwd \"$PWD\"          # print this project's resume\npython3 ~/.claude/tools/wherewasi.py --reset --cwd \"$PWD\"  # clear this project's resume\n```\n\nOr use the slash command: `/wherewasi` (show) · `/wherewasi --reset` (clear).\n\n## Privacy and transparency\n\nEverything lives in `~/.claude/wherewasi/resume/<cwd-slug>.md` (plain Markdown). Nothing leaves your machine except the one LLM call below.\n\n- **Stored**: project name, git branch + uncommitted count + last commit, and the two LLM-written `Last`/`Next` lines.\n- **NOT stored**: no full transcripts, no source code, no secrets from `.env`.\n- **LLM calls**: on compaction (`PreCompact`) and at session end (`SessionEnd`), `claude --print` (default Sonnet 4.6 — override with `WWI_MODEL`, or set it empty for your account default) reads the **tail of the transcript** to write two lines. It runs under your existing Claude Code login — **no separate API key**. Set `WWI_SKIP_LLM=1` to disable it entirely (the resume still refreshes from git on the rolling path). Note: from **2026-06-15**, `claude -p` on subscription plans (Pro/Max/Team/Enterprise) draws from a monthly [Agent SDK credit](https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan) you claim once. If it runs out, the LLM rewrite pauses but the rolling git refresh and session-start display keep working.\n\n## Environment variables\n\n| Variable | Default | Effect |\n|---|---|---|\n| `WWI_SHOW_BANNER` | `1` | Set to `0` to suppress the visible banner (context still injects) |\n| `WWI_SKIP_LLM` | unset | Set to `1` to skip the LLM rewrites (PreCompact + SessionEnd); resume still refreshes from git |\n| `WWI_MODEL` | `claude-sonnet-4-6` | Model for the LLM rewrite. Set empty to use your account default |\n| `WWI_DIGEST_EVERY` | `25` | Rolling-refresh cadence (prompts per `UserPromptSubmit` refresh) |\n\n## How it compares\n\n| | WhereWasI | claude-mem | OpenMemory | cortex |\n|---|---|---|---|---|\n| Ambient token cost | **~120** | ~2K+ | ~1K+ (MCP) | ~3K (27 tools) |\n| External services | None | Agent SDK worker | Docker + MCP server | MCP server |\n| API keys required | No | Yes | No | No |\n| Runtime | Python (stdlib) | Node worker | Docker | Rust binary |\n| Storage | One MD file/project | SQLite + worker | Docker volume | Rust store |\n| Install | `./install.sh` | npm + worker | docker compose | cargo |\n\n## Docs\n\n- [Architecture](docs/architecture.md) — files + hooks, the resume file, capture flow\n- [CLI Reference](docs/cli-reference.md) — commands, hooks, environment variables\n- [Privacy Policy](docs/privacy.md) — what's stored, what's not, network activity\n\n## License\n\nMIT\n",
  "bytes": 6793,
  "sha": "f1edd94f082d4fca8b2d7e7be9371f9c6073451b2db89822d02142a436693629",
  "repo_slug": "sebastianbreguel/engram",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_sebastianbreguel_engram_enam_dc77ebf3/readme"
}