Metadata-Version: 2.4
Name: dream-cli
Version: 0.1.0
Summary: Dreaming over a directory's Claude Code sessions: memory notes proposed with evidence, kept only when you tick them
Keywords: claude-code,memory,dreaming,agents,cli
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# dream-cli

**Dreaming over your Claude Code sessions.** `dream` reads the sessions that ran in a directory, proposes memory
notes, each with evidence quoted from the transcripts, and writes the ones you tick into `.dream/memory/`, which your
next sessions read through one line in `CLAUDE.md`.

- **Out of band:** one read-only `claude` session reads many sessions at once, so it sees patterns no single session
  sees: the correction you keep repeating, the failure that recurs, how you like things done.
- **Checked:** every quote it cites is looked up in the transcript line it names; candidates without real evidence
  are dropped.
- **Yours to choose:** nothing becomes memory until you tick it, and `dream apply` writes exactly what you ticked.
  The memory is plain Markdown you can read, diff and commit.

"Dreaming" is the name Anthropic's research gives to this kind of offline pass over past transcripts; dream-cli is an
independent implementation of it for Claude Code's local sessions.

## Install

```bash
uv tool install dream-cli     # or: pipx install dream-cli, pip install dream-cli
```

Python 3.11+ and [Claude Code](https://claude.com/claude-code) (`claude` on `PATH`). No other dependency. (The
package is `dream-cli`; `dream` on PyPI is an unrelated project.)

From a checkout: `uv tool install .`, or run `./dream.sh` without installing.

## Use

```bash
cd <your project>
dream list                    # its sessions, numbered; 'next' marks what a run would take
dream --dry-run               # the digest of the last 10 sessions not dreamt yet (no model is called)
dream                         # dream over them: a headless, read-only claude session (several minutes)
$EDITOR .dream/runs/1/proposal.md    # tick [x] what should enter the memory
dream apply                   # write exactly the ticked notes into .dream/memory/
```

Then add this line to your project's `CLAUDE.md` (dream prints it; it never edits `CLAUDE.md` itself):

```text
@.dream/memory/MEMORY.md
```

and commit `.dream/memory/` when you're happy with it. Run outputs (`.dream/runs/`) quote your transcripts and stay
out of git.

Choose what to dream over with `--last N`, `--since 2026-11-20`, `--pick 1,3,5-8` (numbers from `dream list`) or
`--session <id>`; `--subdirs` and `--worktrees` take in sessions started below the directory or in its other
worktrees. A dream reads a few tens of thousands of tokens of digest plus what it searches in the transcripts:
expect several minutes and millions of cached tokens for ten long sessions.

## How it works

The [design](docs/design.md) has the whole of it: how sessions are found, the digest, the dream's session and its
safeguards, the checks, the proposal, the memory format and the safety rules.

## Develop

```bash
uv venv .venv && uv pip install --python .venv/bin/python -r requirements-dev.txt
.venv/bin/pytest -q && ruff check .
```

The tests never call a model: a fake `claude` stands in, and the fixture has real Claude Code record shapes with
neutral text.

Releases go through `development`, a release branch and PyPI's Trusted Publishing: see
[releasing](docs/releasing.md).

## License

[Apache License 2.0](LICENSE).
