Skip to content

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

crossweave

test

A tiny, dependency-free wrapper that weaves the AI coding-agent CLIs — Claude Code, OpenAI Codex CLI, Kimi CLI, step, pi, opencode, Kiro CLI — behind one set of flags, plus cross-tool session discovery, resume, and handoff — and reads ZCode's local session store alongside them.

No daemon, no config file, no build step — just a small Python package (src/crossweave/) that reads each tool's own on-disk session store directly. Formerly named clisweave (and aimux before that); the cw command was never renamed — cx (the mark's own name: X is cross) now ships alongside it.

crossweave demo: a unified session list across claude/codex/kimi/step/zcode, then an LLM-judged topic search narrowing it down to the one relevant session

CodeBuddy and WorkBuddy support is currently disabled. Their session stores are not scanned, and the standalone cb command is no longer installed. Existing conversation files are left untouched.

Install

Via pip (the package is named crossweave on PyPI; the commands installed are cw, cx and crossweave, plus the legacy clisweave, ai, aim and aimux aliases kept so existing scripts and links keep working, and a legacy ai-sessions that is no longer advertised — an active PyPI package of the same name owns that word, and cw sessions / cw resume is the same surface):

pip install crossweave

XWeave is this project's reserved alternate spelling — pip install xweave installs crossweave (the packaging/xweave/ forwarding package holds the name; its version mirrors crossweave's).

Via curl (macOS/Linux, or Windows with Git Bash/WSL), one line, no manual clone:

curl -fsSL https://raw.githubusercontent.com/uhuntu/crossweave/master/install.sh | bash

Via irm (Windows PowerShell, no Git Bash/WSL/Cygwin needed):

irm https://raw.githubusercontent.com/uhuntu/crossweave/master/install.ps1 | iex

Via git, if you'd rather clone it yourself first:

git clone https://github.com/uhuntu/crossweave.git
cd crossweave && ./install.sh        # Windows PowerShell: .\install.ps1

Whichever of the last three you use, it clones the repo to ~/.local/share/crossweave first (override with CROSSWEAVE_REPO_DIR, or the source with CROSSWEAVE_REPO_URL — a fork or a mirror), then wires up cw, cx, crossweave, and the clisweave/aim/aimux compatibility aliases in ~/.local/bin (override with CROSSWEAVE_BIN_DIR) — as symlinks on install.sh, or native .cmd launchers on install.ps1. Existing ai and ai-sessions links keep working, but a fresh install creates neither (ai is too generic a name to own, and an active PyPI package owns the ai-sessions word; cw sessions / cw resume is the same surface). To avoid taking over an unrelated command, the standalone installers skip cw and cx with a warning if any already exists. The old CLISWEAVE_REPO_DIR/CLISWEAVE_BIN_DIR and AIMUX_REPO_DIR/AIMUX_BIN_DIR variables remain accepted for compatibility. Nothing is copied — the clone stays the source of truth.

Requires claude, codex, kimi, step, pi and/or opencode already installed and on PATH (only the ones you actually use need to be present). ZCode needs nothing on PATH for its sessions to be listed — its SQLite store under ~/.zcode/cli/db is read directly — but the full experience (cw zcode, cw resume zcode <id>, handing context to zcode) wants the zcode CLI on PATH; the desktop app alone still lists sessions and gets the workspace deep link.

Windows note: running the curl one-liner from PowerShell/cmd (rather than Git Bash) can invoke the WSL bash launcher by mistake instead of Git's — use irm above, or run curl from Git Bash directly. install.sh also copes if Git Bash lacks symlink privilege (falls back to a generated launcher instead of a broken copy) or python3 on PATH is the Microsoft Store's no-op stub (probes python/py -3 instead). Files installed by install.sh are still extensionless with a shebang line, though, which PowerShell can't execute directly — install.ps1's .cmd launchers don't have that problem. If you stick with install.sh, call cw from Git Bash instead, or add a function to your PowerShell $PROFILE:

function cw { & "C:\Path\To\python.exe" "$HOME\.local\share\crossweave\bin\cw" @args }

Update

cw update        # update crossweave itself
cw update tools  # update claude, codex, kimi, and step (whichever are installed)
cw update all    # both

cw update detects how crossweave itself was installed and does the right thing: git pull --ff-only for a curl/git install, pip install --upgrade crossweave for a pip install.

cw update tools runs each CLI's own update command (claude update, codex update, kimi update --yes), skipping any that aren't installed. If one fails, the others still run; the exit code reflects the worst failure. ZCode is not attempted; its desktop app manages updates.

Two fallbacks exist for flaky networks, both confirmed live on 2026-09-24:

  • Retries: claude (no fallback mirror; can hit its own internal download deadline) and kimi (its update check intermittently hangs at connect time) are retried on failure.
  • Proxy fallback: set CROSSWEAVE_UPDATE_PROXY (e.g. http://127.0.0.1:7897) and any failed tool update retries through that proxy. The first attempt is always direct, so this only ever kicks in as a fallback. This exists because some networks sever long TLS transfers mid-flight — codex's ~146MB asset died at ~60MB on every direct attempt, resume ignored, while the same transfer through a working local proxy finished in under a minute. kimi update passes --yes so its interactive picker can't abort the run.

Equivalent manual commands for updating crossweave itself, if you'd rather:

  • pip: pip install --upgrade crossweave
  • curl: re-run the same one-liner — it fast-forwards the existing clone before relinking
  • git: git -C /path/to/crossweave pull — the symlinks point straight into the repo, so this alone is enough

Personal aliases

cw is the command the project ships; what your hands type is yours. cw alias add <name>... creates launchers in ~/.local/bin (override with CROSSWEAVE_BIN_DIR) pointing at the installation you are running — cw alias add xx ai is the whole ritual, and the launchers follow that install through cw update. cw alias list reads the set back; cw alias remove undoes it. The names live in ~/.config/crossweave/aliases.json, and cw alias add with no arguments re-creates every name in it — on a fresh machine: install, copy that one file over (or just remember the names), run the one command. Names have to survive every namespace a command name lives in — bin-dir filenames, PyPI-adjacent words (PEP 503), shell words (# starts a comment in all three major shells) — so letters, digits, ., _ and - only; the installer's own commands (cw, cx, crossweave) are refused, and a file the mechanism did not create is never overwritten. The installer itself never creates or removes personal aliases; this command is their only manager.

Extra homes (dual-boot / mounted partitions)

On a dual-boot machine or when another OS's disk is mounted locally (e.g. a Windows partition at /mnt/win), cw can read those session stores directly alongside your primary home — no sync, no ssh, no daemon:

# ~/.config/crossweave/homes (one path per line; `#` comments ignored)
echo /mnt/win > ~/.config/crossweave/homes
# or per-run via env var (colon-separated on POSIX, semicolon on Windows):
CROSSWEAVE_EXTRA_HOMES=/mnt/win cw
# show only sessions from a specific home (or `local` for primary only):
cw --home win                   # shorthand for `cw sessions --home win`
cw --home /mnt/win              # also works directly without prior configuration
cw --home local                 # primary home only

A Windows mount root (such as /mnt/win) automatically expands its Users/* subdirectories (skipping built-in system folders like Public, Default, All Users); a direct user home path (such as /mnt/win/Users/Administrator) is read as-is, and an unmounted path is skipped quietly. Extra-home sessions merge into cw, cw sessions, cw ui, cw search, cw show, cw note, and cw wiki; cw delete works with the usual confirmation and backup, while cw rename refuses to modify extra-home stores in place. Resuming one (cw resume <N> / cw <N>) automatically hands its context off to a fresh session of the same tool in your current environment instead of attempting an in-place native resume.

Other machines

A session that happened on the laptop does not exist on the desktop — each tool's store is per-machine, and no amount of local reading can answer "where was that conversation". crossweave's answer is an index, not a service: every machine publishes a small JSON file describing its own sessions, and the files meet in a directory you sync yourself (Syncthing, git, Dropbox — anything that moves files):

mkdir -p ~/.config/crossweave/machines   # the directory's existence is the switch
# point your sync tool of choice at it, on every machine that runs cw

From then on every listing refreshes this machine's index in that directory (metadata only — tool, id, title, directory, timestamp; the transcripts never leave the machine they live on), and cw sessions --machines merges the others in: local rows first, then a second section of remote rows, each naming the machine it lives on. A row the local store also holds — mirrored stores do this — stays a plain resumable local row. A truly remote row resumes where it lives: cw resume <N> (or cw <N>) opens an ssh session to that machine and runs cw resume there, in your terminal — the session's own tool, on its own machine, with its own files; quitting it brings you back. Words after the row ride along as they would locally. The handoff to a different tool still refuses a remote row, naming the machine, since the transcript would have to travel. Without the directory nothing changes: no publish, no merge, no new behavior to learn — and CROSSWEAVE_MACHINES_DIR moves the directory, CROSSWEAVE_MACHINE_NAME overrides the name a machine publishes under. Indexes older than two weeks drop out of the merge with a note: a machine unused that long is a ghost, not a pointer.

No always-on sync tool? The pull mode needs none: cw sessions --machines 241 149 — each target is any ssh destination (an alias from ~/.ssh/config works as-is, jump hosts included), and cw has the remote run cw machines, which prints that machine's index JSON on the spot. Nothing is configured, nothing is stored. A target that is unreachable, or still runs a cw older than this feature, costs one stderr line and never takes the listing down — the remote pays one cw update, and a password-only host needs key auth (or a live mux master), since the pull runs BatchMode rather than hang at a login prompt. The two transports feed the same merge: a synced directory and ssh targets mix freely in one --machines.

cw machines is the overview: this machine, every machine in the sync directory, and any ssh destinations you name (cw machines 241-tunnel 149-tunnel) or have named before, each with its cw version, session count, newest session and how fresh its index is — the quick answer to "which machines can cw see, and are they current?". Piped (which is how an ssh pull meets it) or with --json, it prints this machine's index JSON instead, as it always has, so older cw installs pulling from this one are unaffected.

You name an ssh destination once. Every target that answers a pull — from cw machines <targets> or cw sessions --machines <targets> — is remembered (in ~/.cache/crossweave/ssh_targets.json, a cache, not a config: delete it and nothing breaks), and from then on a bare cw machines or cw sessions --machines pulls them again on its own; a plain cw stays offline. A target that does not answer is never remembered, and a remembered one that is down costs one stderr line rather than being forgotten — the machine may just be off — while cw machines --forget <target> drops it for good. Two aliases that reach the same machine are pulled once, through the newest one that worked, and a machine the sync directory already covers is not pulled at all. Several targets are pulled at once, so a host that is off holds up no other.

A pull over ssh brings back the machine's notes too (cw machines --notes on its side prints them). They are kept in this vault under _machines/<machine>/<project>/, apart from this machine's own notes, so Obsidian shows where each came from and a pull never overwrites one. Each pull replaces that machine's folder whole, so a note deleted there goes here as well. A fresh cw codex (or cw context) in a project then reads the same-named project's notes from every machine, newest first within the usual three. Each pulled note says which machine it is on ((claude, 2026-11-06, on swc-build)), and its resume line says the session lives there. Plain cw and a tool launch never go over ssh: they read the copy the last pull left. A machine with a cw older than this sends no notes, and that is not an error.

cw machines update [tools|all] runs cw update with the same argument on this machine and on every machine cw knows (the remembered targets, plus the sync directory's machines by name), all at once. Each machine's output is printed as one block when it finishes, then one line says how many updated and which failed; the exit code is non-zero if any did. It runs non-interactively, through the remote's login shell, so each machine updates with its own PATH and its own CROSSWEAVE_UPDATE_PROXY.

Where the resume connects: a row pulled over ssh goes back through the destination it was pulled from; a row from the sync directory uses the machine's own name, so a Host <name> entry in ~/.ssh/config is all it takes (cw says so if the name does not reach anything). On the remote it runs your login shell interactively ($SHELL -il), so the tool finds the same PATH and environment it would if you had ssh'd in and typed the command, and it finds cw on PATH or at the installer's ~/.local/bin/cw; a Windows host gets the cw.cmd launcher. Both the pull and the resume tolerate a host alias that also carries a long-lived tunnel's RemoteForwards: the pull drops forwards it never needs, and the resume lets a forward that is already held by the tunnel fail with a warning instead of ending the connection.

Usage

cw                          # recent sessions across all supported tools (same as `cw sessions`)
cw sessions --machines      # + other machines' sessions (a synced index dir)
cw sessions --machines 241 149   # ...or pulled fresh over ssh, no setup
cw claude -p "prompt"       # -> claude -p "prompt"
cw codex -p -m o3 "prompt"  # -> codex exec -m o3 "prompt"
cw kimi -c                  # -> kimi -c
cw step -p "summarize"      # -> step -p "summarize"
cw kiro -p "prompt"        # -> kiro-cli chat --no-interactive "prompt"
cw kiro -c                 # -> kiro-cli chat --resume
cw zcode                    # open the ZCode app on this directory

cw sessions --limit 10      # list recent sessions, all tools
cw sessions --limit all     # no cutoff -- same as `cw full`
cw full                     # shorthand for `cw sessions --limit all`
CW_LIMIT=30 cw              # bare `cw` lists 30 rows instead of 15 (export it in ~/.zshrc to keep)
cw sessions --tool codex    # filter to one tool
cw sessions --cwd           # only sessions started in the current directory
cw sessions --all           # include archived sessions and ones a tool started for itself

cw ui                       # pick a session interactively: type to filter, Enter resumes,
                            #   h hands off, n notes, r renames, d deletes

cw resume kimi 97946bc7     # resume by short id / prefix (resolved against real session ids)
cw resume claude            # no id -> tool's own interactive picker
cw resume 3                 # resume row 3 from the last `cw`/`cw sessions` listing
cw resume zcode <id> "..."  # continue a zcode session headlessly -- its one route in that needs no TUI
cw 3 codex                  # hand row 3's context to a new Codex session
cw 327e2ad9-210f-48cd-b     # an id where the row number goes -- the same resume, no listing needed

cw search "the nfc frequency lock issue"   # find sessions relevant to a topic
cw search "katago" --tool claude           # restrict the candidates to one tool
cw search "..." --judge pi               # use a different model to judge relevance
cw search "..." --judge step                # ... or step
cw search "..." --why                      # print each hit's reason in full, on its own line
cw search "..." --all                      # list every hit, not just the strongest 10

cw note 3                   # row 3 as a done/why/open note in your Obsidian vault
cw note 327e2ad9 --vault ~/Notes   # by id; CW_VAULT sets the vault once
cw 3 note                   # the same, row first
cw note --all               # every session with no note yet, or one that moved on since (asks first)
cw note --since 2d -y       # only the last two days, no question -- the shape for cron
cw note --index             # rebuild every project's _index.md (open items + all notes), no judge
cw note 9                   # on a folded row (⧉ N): one note for the whole topic; --session for just that one
cw context                  # this project's newest notes, to hand a new session
cw codex "$(cw context) 接着做"   # ...like this, in any of the tools

cw stats                    # session counts per tool, oldest/newest, top directories
cw stats --tool claude      # stats for one tool only
cw doctor                   # per-tool store health: is each store readable,
                            #   and how many sessions is it actually yielding
cw doctor --tool zcode      # one store only

Sessions a tool started for itself are left out of cw sessions and cw search: Codex's command-approval reviews (Guardian review or codex approval review, one per command it asks you to approve), step's own subagent-… sessions, ZCode's subagent runs (sessions with a parent_id in its store), and cw search's own judge runs. None of them is a conversation of yours, and a judge session literally contains every candidate's text, which makes it match nearly any topic. They stay reachable by id (cw resume codex <id>), and cw sessions --all lists them anyway. A Claude session that /clear left behind — no reply and nothing you typed, only the command and Claude Code's own notices, under the old session's title — is left out of cw sessions the same way.

Every cw/cw sessions listing is numbered and cached, so cw resume <N> is usually the fastest way in: run cw, glance at the row you want, cw resume 3. The cache is just the last listing you saw — it's overwritten by the next cw sessions call and doesn't try to detect if the underlying sessions changed since.

An id works wherever a row number does, and is the steadier of the two: cw <id-prefix> resolves the prefix against every store live, so it does not care what the last listing happened to be, and it survives sessions arriving or moving in the meantime. It is what cw search hands you — the ids in its output are the argument to the next command. One match resumes it (with anything after it meaning what it means after a row number: another tool hands the context off, words continue the session); several matches are listed rather than guessed at, because a bare prefix has no tool to narrow it — name one with cw resume <tool> <prefix>. A word with no digit, dash or underscore in it is not offered to the stores at all: cw session is a typo of cw sessions and gets that message, not a list of every kimi session on the box.

cw ui: the interactive picker

cw ui puts the same sessions in one scrollable list in the terminal — every tool's, newest first, with the same rows left out that cw sessions leaves out. / starts a filter (every word has to appear in the title, directory, tool or id; Chinese works), Enter resumes the highlighted session through the same path as cw resume, Esc clears the filter and then quits. Tab steps through the tools, . keeps only the sessions of the directory you are standing in, and the pane at the bottom shows the selected session's full id, turn count, whether it has a note (✎), whether a wiki page was built from it (⌗), how many sessions its topic holds (⧉ N, with their turns and span, on a folded row), and where it left off.

The highlighted row can be acted on without leaving: h hands it off to another tool (a digit picks which, any other key cancels), n writes its note, r renames it (type a title, or leave it empty for the judge to propose one), d deletes it after the usual y/N. These run the same commands as cw <N> codex, cw note, cw rename and cw delete, in the plain terminal; note, rename and delete then come back to the list, refreshed, on the same session. Because those commands take a row of the last listing, the picker writes what it shows as that listing first — after cw ui, cw resume 3 means the third row the picker had on screen.

It uses Python's own curses, so it adds nothing to install. Stock Python on Windows has no curses: there pip install windows-curses adds it, or cw sessions is the same information as a table.

What the listing shows

One table: the row number, the tool, how long ago the session ran, its id, the directory it belongs to, and how many turns it holds. ▸ (or > on a console that cannot draw it) marks the rows whose directory is the one you are standing in — the question you usually have when you type cw inside a project.

Under each row, dim, is where that session left off — the last thing anyone actually said in it. A title says where a conversation started ("fix the nfc lock"); the line under it says where it got to, which is the difference between a table and an answer to "where was I?". A trailing system reminder or a pasted log is skipped for the real last words, and a one-turn session shows nothing under its row rather than repeating its title.

The tool column carries a hue when the output is a terminal, the id/when/turns columns go dim and the header is bold, so the titles are what your eye lands on. Color is skipped when the output is a pipe or a file, when NO_COLOR is set, when TERM is dumb, or with CROSSWEAVE_COLOR=never; CROSSWEAVE_COLOR=always forces it on (useful for cw | less -R).

On a narrow terminal the directory column shrinks first and the turns column is dropped before the title loses its room. Columns are measured in display width rather than code points, so a title in Chinese keeps the table lined up — and a turn count comes from the user messages each tool records (claude's tool results are not turns).

To switch agents, put the target tool after the row number: cw 3 codex. Crossweave exports the complete textual conversation to ~/.cache/crossweave/handoffs/, changes to its original working directory, and starts a new target-tool session with a prompt that asks it to read the export, summarize it, and continue the work. If the named tool already owns that row, the command simply resumes the original session. In listings, a session started this way is titled (handoff) <topic> after the session it continues (following a chain of handoffs back to the original), rather than by its own generated "Continue codex session ..." seed.

One exception: kimi cannot open an interactive session with an initial prompt (a bare prompt parses as a subcommand name), so a handoff to it runs the seed as a one-shot kimi -p and then automatically resumes the session that run persisted (kimi -S <id>), dropping you into the interactive continuation with the summary already in its history. If the seed run fails, nothing is resumed — the error is reported, and you pick up with kimi -c.

Local browser workspace

Run cw web to start the local GUI and open it in your browser. It listens only on http://127.0.0.1:8765; cw web --port 9000 --no-open changes the port and leaves opening the browser to you. Stop it with Ctrl-C.

Search and filter sessions on the left, select one to read its saved text, or export it as Markdown. Sessions from Claude Code, Codex, Kimi, Step, Pi, and ZCode have a message box when their CLI is installed: each message continues the same saved session in its original directory. Responses appear as the CLI produces output. Sending can invoke tools and modify files, just as cw chat does. Native permission defaults are preserved; the web UI cannot answer interactive permission prompts, so operations requiring approval may be denied. OpenCode remains read-only. OpenCode’s local smoke test did not persist a discoverable session, so it is not offered for chat yet. Notes and wiki remain available through their CLI commands.

The GUI uses the Python standard library and bundled HTML/CSS/JavaScript; no frontend installation or build is required. Nothing is uploaded for browsing. Chat uses each tool’s existing provider configuration. Closing the server stops its running CLI processes. Keep the server terminal open while using the page.

For a continuous terminal conversation, run cw chat <tool> <session-id-or-prefix> with any of the six chat-capable tools above. Each line starts a headless turn in the same saved session and its original directory. /quit, /exit, or Ctrl-D exits; Ctrl-C at the prompt exits, while Ctrl-C during a turn interrupts that turn. Each turn starts the tool again, so it has startup overhead. In cw ui, Enter automatically uses this loop when this install is already known to lack @zcode/tui; /quit returns to the session list.

Read a saved conversation with cw show 3 (a row from the last listing) or cw show zcode <session-id-or-prefix>. Terminal output opens in a pager (press q to quit); redirect it with cw show 3 > session.md to save Markdown. New session notes, topic notes, and wiki source lists include cw show <tool> <session-id> commands for checking the original conversation. Existing pages receive these when regenerated; no model call is needed to view the transcript.

In cw ui, select a session and press v to view it; quit the pager to return directly to the same list position. This shows saved user and assistant text, without reasoning or tool calls/results. It starts no agent and does not modify the session. Remote rows must be viewed on the machine holding their transcript.

A zcode row can be a handoff source like any other — cw 3 claude exports its conversation and continues in Claude Code, which is the way out when a session has grown past what its model can serve. As a target it needs the zcode CLI on PATH: the CLI seeds one headless zcode -p run and resumes the session it persisted (the kimi dance); with only the desktop app installed the command refuses, since the desktop starts no session from a prompt.

Export a conversation to LLM Wiki

An LLM Wiki project is a local knowledge-base folder created in the LLM Wiki app, containing raw/sources/ and wiki/. It is not the app's source-code checkout. Create a project in the app first, then use its folder as --llm-wiki:

cw export 3 --llm-wiki ~/Documents/my-wiki
cw export zcode <session-id> --llm-wiki ~/Documents/my-wiki

The exporter keeps one file per session at raw/sources/crossweave/<tool>/<session>/session.md. Each snapshot carries its tool, session ID, source directory, content revision, export time, and the commands for viewing/resuming the original session. It contains saved user and assistant text, excluding reasoning and tool calls/results.

What a source holds is the session's cw note by default (--content notes), not its transcript: the note is the conversation already distilled into what was done, why, the commands and paths that worked, the pitfalls and what is left, and a wiki built from it gets a few solid pages per line of work instead of a page for every file name, flag and dead end the transcript passed through. A topic's source is its topic note. A session or topic with no note yet, or one whose sessions moved on after it was written, gets one written first — one judge call each, --judge as for cw note, four at a time — and the note lands in your vault like any other, so Obsidian and the wiki are fed from the same record. The source's body is the note alone: the cw show lines a note carries for Obsidian are left out, and where it came from (tools, date, sessions, cw resume) stays in the frontmatter, so the wiki does not mistake the export format for knowledge. A note is rewritten only when its sessions move on, so the source changes, and is re-ingested, less often than a transcript would be. --content transcript exports the user and assistant text as described below; both forms use the same path, so switching rewrites a source in place.

Re-exporting the same content leaves the existing file untouched. When the conversation has changed, cw first copies the file it is about to replace into its own history under ~/.cache/crossweave/export-history/<tool>/<session>/<revision>.md, then swaps the new content in atomically. That keeps one conversation as one source in LLM Wiki: earlier revisions never compete with the current one as independent evidence. Revisions written by older cw versions (<content-hash>.md beside session.md) are moved into that history on the next export, so they stop being ingested as separate sources.

Do not hand-edit session.md: the next export archives your edit into the history and replaces the file. A session.md that cw did not write is left alone and the export fails instead.

A session that belongs to a topic — the sessions you carried on from one another, joined exactly as cw folds them — is not exported on its own. The whole topic goes in as one source, raw/sources/crossweave/topic/<oldest-session>/topic.md: every member oldest first, each under its own heading with its cw show command, and the handoff seed that opens a continued session reduced to one line naming the session above it. Four DevGetter sessions handed between claude and kimi are one line of work; as four sources the wiki would read them as four witnesses agreeing with one another. The topic is named by the title most of its sessions carry (a handoff inherits its source's), so a /clear that moved on to something next to it does not rename the work. cw export 3 on any member exports the topic and says so. When a topic is written, every other cw source for its sessions — one exported alone before it was handed off, or the same topic filed under a root that is no longer its oldest session — is moved into the history and out of raw/sources. A topic is one file, so a new handoff re-ingests the whole of it; LLM Wiki splits a long source into chunks for that.

The export itself makes no model or API calls. A changed conversation keeps the same path, so the app has to re-read the file instead of waiting for a new source; --rescan is how cw asks for that. If the app only imports files it has not seen before, import the updated Markdown manually. To request a source rescan through its local API:

# Enable the API in LLM Wiki Settings → API + MCP. If required, put its token
# in the LLM_WIKI_API_TOKEN environment variable; cw never saves the token.
cw export 3 --llm-wiki ~/Documents/my-wiki --rescan

--api-url defaults to http://127.0.0.1:19828 and accepts only loopback endpoints. Before requesting the rescan, cw matches the selected folder against GET /api/v1/projects; --project-id can disambiguate an API project ID. It then calls POST /api/v1/projects/<id>/sources/rescan, following the app's local API contract. An accepted rescan is not confirmation that knowledge pages have finished generating: check progress in LLM Wiki. If the API is unavailable, the exported snapshot is retained and the command exits nonzero; retry with --rescan after fixing the connection.

To keep a wiki fed without picking rows one by one, --all exports every local session the way cw note --all picks them:

cw export --all --since 7d --llm-wiki ~/Documents/my-wiki --dry-run   # what would go in
cw export --all --since 7d --llm-wiki ~/Documents/my-wiki --rescan    # export, then one rescan
cw export --all --cwd ~/work/dg3sw --llm-wiki ~/work/dg3sw -y         # one project's sessions only

Topics go in as one source each, as above. A topic with a session still live (written to within the last five minutes) waits until it is quiet; a session of fewer than three turns that nothing continues is skipped, and so is one a tool started for itself — a judge run, an approval prompt, a codex review subagent — and one with no user or assistant text at all (a kimi session of tool calls alone counts turns but has nothing to say; LLM Wiki still wrote a page about each). A session with no text drops out of its topic, and if it went in before this check, its source is moved out of raw/sources into the history. --since keeps what was active within a span (30m, 12h, 7d, 2w); --cwd keeps what was started in a directory or below it, the current one when no directory is given. --older-than keeps only topics quiet for at least a span: a session that goes in alone and is then handed off, or /clear'd into a successor, has its source retired and its pages torn down and rebuilt from the topic, so --since 7d --older-than 1d lets work settle for a day before the wiki builds on it. Both take a topic whole when any of its sessions qualifies. A source whose content has not changed is left as it is, so running the same command again writes nothing. --rescan is requested once at the end, whether or not anything changed — that is how a rescan that failed (a missing token, the app not running) is retried: run the same command again. LLM Wiki caches ingests by content, so unchanged sources cost nothing.

The export is local and free, but each new or changed source is one ingest on LLM Wiki's model, so --all asks before writing. -y skips the question; without a terminal it cannot be asked, and the command stops unless -y is given. As with a single export, earlier revisions stay in cw's local history and never reach the wiki as separate sources.

The daily upkeep

Nothing has to be run by hand to keep the vault current. An ordinary cw — a listing (cw, cw sessions, cw full) or a fresh session (cw claude, …) — checks one small state file, and once a day starts the day's upkeep in the background and goes on at once; one stderr line says it started, what it will do and where its log is (~/.cache/crossweave/daily.log):

  1. Notes. Every session or topic that has gone quiet for a day and has no note, or one its sessions have moved on from, gets one — one judge call each, four at a time, the same picking as cw export --all (live, short, tool-started and text-less sessions are left out; a handoff chain is one topic). After the recent notes, the upkeep scans older history and fills in missing or stale notes, newest first, with at most 20 historical note attempts per vault per 24 hours (a whole topic counts as one). Successful notes are skipped on the next run; failed attempts also consume the budget, so an hourly retry after another step fails cannot start another full batch. History uses the same quiet/short/tool-started/text-less filters. Progress is the notes already saved in the vault; the budget is in daily.json, and the batch size and remaining backlog are logged in daily.log. New notes of sessions started in ~ are then sorted into the projects they are about (cw note --sort-home, below), one judge call for all of them.
  2. Project pages. The project pages those notes put behind are updated (cw wiki --projects), each an edit of the page, one judge call.
  3. LLM Wiki, only with CW_LLM_WIKI set: the notes go into it (cw export --all --older-than 1d --rescan). The notes are already written, so this step makes no judge calls of its own.

It runs with a vault (CW_VAULT, or the default folder once a note is there), an LLM Wiki, or both; the vault is the point and the LLM Wiki an optional reader of it. No daemon, no cron: the upkeep rides on the use you make of cw anyway, so a machine where cw is not used does nothing. Each run reaches back to the last successful one, with the day a topic needs to go quiet on top (seven days the first time, ninety at most), so a fortnight away loses nothing. It runs in the environment of the command that started it, so CW_VAULT and the LLM_WIKI_API_TOKEN the shell loaded reach it. A run with a failed step — a judge out of credit, the LLM Wiki app closed — still runs the other steps, is named once on the next listing with its reason and the log, and is tried again within the hour. CW_AUTO=12h changes the interval, CW_AUTO=off stops the upkeep; CW_LLM_WIKI_EXPORT=off skips the LLM Wiki step alone. Reading pages back (Pages from an LLM Wiki) depends on neither.

The token must match the service at --api-url. A separately deployed headless service can use its startup LLM_WIKI_API_TOKEN rather than the desktop app's stored token. A 401 with a token already supplied means that service rejected it. Some headless versions do not implement the project-list/source-rescan routes; a 404 on these routes requires a compatible API or manual import of the saved Markdown, rather than repeated token changes.

The same topic, again

A request that keeps coming back gets a fresh session every time, and nine sessions on one question used to look like nine unrelated rows. Two things name the repetition now.

A topic is the sessions you carried on from one another — never titles that happen to read alike. Three links count: a handoff (cw 1 codex, or h in cw ui), a Claude session started with /clear after another in the same directory (Claude records which one it follows; a /clear that moved to another project is something else and stays apart), and a codex fork you made (not the review subagents codex starts for itself). Whatever these join is one topic, however its sessions are titled: DevGetter上架与MDM分发方案 is eleven sessions across claude, kimi and step, the first of them titled Dev Getter Google Play 上架流程. Two unrelated sessions that both came out as cw 会话列表 are two topics; a session you start fresh on the same work joins only once you hand it off. The links sit at the head of each session file, so the whole history is grouped in about a tenth of a second. A bare cw folds each topic into its newest session: one row stands for the topic, its title without the (handoff) mark, followed by the count, the work and the span over the whole history — DevGetter上架与MDM分发方案 ✎ ⧉ 11 · 1078 turns · since 14d ago — and a ✎ when the topic or any of its sessions has a note. The folded sessions do not count against the limit, so fifteen rows are fifteen topics; cw resume <N> on that row continues the newest session. cw full folds nothing: every session keeps its own row, members of a topic carry ⧉ N, and one dim line under the header names each — ⧉ 11 sessions continue 'DevGetter上架与MDM分发方案' -- 1078 turns, newest row #11 — pointing at the newest member's row, since a topic's rows are spread through the time order. cw ui folds the same way: → (or space) unfolds a topic under its row, newest first, each session with its own tool, turns and ✎, and Enter on one resumes that older session; ← folds it back from any of its rows.

Starting a session in a directory where a topic keeps going — three sessions or more — prints one stderr line first:

cw: 11 sessions here continue 'DevGetter上架与MDM分发方案', newest 2d ago -- continue: `cw resume kimi 80a9a7ce`; distill: `cw note 9`

The topic is named at the moment another session is about to start beside it, with the two ways to carry it on instead: resume the newest one, or distill the topic into a note (cw note <N> on its folded row). It reads the last listing's cache rather than the stores, so it costs nothing on every launch, and it is only as current as that listing — CW_CONTEXT=off silences it, the same clean-start intent that skips the vault notes. Subcommands (cw claude doctor), print runs (cw claude -p) and tools that start no terminal session get nothing.

How cw search works

cw search runs two complementary passes:

  1. Exact pre-pass — a case-insensitive scan of conversation text, tool calls, results, and kimi background-task output logs. It ignores session metadata and injected instructions. Short alphabetic queries such as cra match whole words, so they do not match craft or crash; longer queries retain substring matching. Results print under exact matches with zero LLM cost.

  2. Semantic pass — a text-only LLM judge evaluates each candidate's tool, working directory, title, and a query-focused excerpt (or a fresh note summary). The default is Step; --judge claude or --judge pi selects another backend. Each batch makes a real model call, and retries or fallback can add more calls. Results print under semantic matches.

For each conversation, cw first looks locally for the query phrase and its identifier/Chinese term fragments. It selects up to two matching windows with adjacent text, including matches deep inside long tool output, within an 800-character excerpt budget. Fresh notes use the same query-focused selection within 600 characters; if a note omits the query detail, cw checks the original conversation before falling back to the note digest. With no lexical clue, the existing evenly sampled snippet remains available for paraphrase searches. File scans retain the existing 20,000-record bound. These are selected excerpts, not entire JSONL files sent to the judge; the local selection itself uses no model.

All judge processes run in a temporary empty directory with tools disabled, including extension/MCP tools where available. They cannot inspect the current repository or use tools to act on instructions embedded in historical messages. Codex and Kimi remain available as session/chat tools, but are not judge backends until an equivalent tool-free mode is verified. The same judge configuration is shared by cw note, cw wiki, and automatic title suggestions.

The exact pass exists because the semantic pass reasons over small sampled snippets, and a term that only appears in unsampled messages, tool calls, or past the snippet scan cap is invisible to the judge — a real aria2c search missed 4 sessions that grepping found immediately. The two passes union (a session listed as exact is not repeated under semantic), and both count for cw resume <N>.

Search skips Codex approval-review sessions whose prompts quote another agent's history. Those copies otherwise appear as duplicate matches. Row numbers continue across the exact and semantic sections, so each displayed number matches cw resume <N>.

The judge reasons about more than just keyword overlap — e.g. searching "katago" correctly pulled in sessions with generic titles like "hi" or "(no title)" that were run inside the katago project directory, which plain text search would have missed entirely.

The judge orders matches within each batch. Those batch lists are currently concatenated in batch order; this is not a global relevance ranking. The first 10 semantic matches are displayed by default (--all shows the rest).

It must also point at something concrete — a file, command, error, or version — rather than count a session whose only link is the directory it ran in. Asked for that, the same search still returns Hello and Yes go rows from android-vts, but now with the specific commit behind each (A13 VTS NFC HAL OpenAfterOpen fix), which is what makes them worth keeping.

It has to say why each match counts: the judge answers one line per match (7: upgrades the firmware from A13) rather than a bare list of numbers, which makes it commit to a link instead of ticking a box. The reason prints as a WHY column beside the hit, clipped to whatever width the terminal has left over, so ten hits stay ten lines. --why prints it in full on its own line instead. That column is what makes a hit with a useless title readable: a row titled Hello in an android-vts directory is a real A13 VTS fix (A13 VTS NFC HAL OpenAfterOpen fix committed to the A13 SDK), which nothing else in the row suggests.

Normalized flags (cw <tool> ...)

Flag Meaning claude codex kimi step pi opencode zcode
-p, --print non-interactive, print and exit -p exec -p -p -p run (not supported — desktop app; bare cw zcode opens it on the current directory, anything else is rejected rather than misinterpreted)
-c, --continue continue most recent session in cwd --continue exec resume --last -c -c -c -c (not supported)
-m, --model <model> model to use --model -m -m --model --model run -m (only with -p — the TUI has no model flag) (not supported)
--add-dir <dir> additional workspace directory (repeatable) --add-dir (repeat) --add-dir (repeat) --add-dir (repeat) (not supported — step has no per-workspace flag; --add-dir is rejected rather than silently dropped) (not supported) (not supported) (not supported)
-y, --yolo auto-approve tool calls --dangerously-skip-permissions --approve-for-me (stays sandboxed) -y --approval-mode auto + --non-interactive-approval allow (nothing to add — pi never asks before a tool call) --auto (not supported)

Anything after a literal --, or any flag this wrapper doesn't recognize, passes straight through to the underlying CLI unchanged. opencode's bare argument is a directory rather than a prompt, so words after cw opencode become its --prompt.

Kiro (cw kiro)

cw kiro starts the Kiro CLI (kiro-cli chat) on the current directory. Its sessions live in ~/.kiro/sessions, which the Kiro CLI and the Kiro VS Code extension share, so both show up in cw sessions --tool kiro.

  • cw kiro -p "question" runs one question (--no-interactive) and exits. Tool calls need -y. Without it they are refused, and only the text answer comes back.
  • cw kiro -c resumes the most recent session in this directory. -m passes the model through. --add-dir is not supported.
  • cw kiro --ide opens the Kiro IDE on this directory. It takes no session flags, because the IDE cannot open a single session from a terminal.
  • Handoffs to and from Kiro work like the other tools: the full transcript goes to an export file, and the new session reads that file.

How session listing works

cw sessions reads each tool's native session storage — no shared index, no background process:

  • claude: ~/.claude/projects/*/*.jsonl

  • codex: ~/.codex/sessions/**/*.jsonl, plus ~/.codex/session_index.jsonl for auto-generated titles

  • kimi: ~/.kimi-code/session_index.jsonl + each session's state.json / agents/main/wire.jsonl

  • step: ~/.stepcode/agent/sessions/<encoded-cwd>/<timestamp>_<session-id>.jsonl, one file per session — or $STEP_CODING_AGENT_SESSION_DIR if set. The id and cwd are the session record on the file's first line; the encoded directory is only the fallback when that record is missing. A session named with step --name or /name shows that name when its log holds no prompt to read. Sessions step started for itself (subagent-… ids) are left out unless --all asks for them.

  • pi: ~/.pi/agent/sessions/--<encoded-cwd>--/<timestamp>_<session-id>.jsonl — or $PI_CODING_AGENT_SESSION_DIR, or sessions/ under $PI_CODING_AGENT_DIR. step is built on pi and writes the same files, so pi is read by step's reader: the same session header, message entries, and session_info names (pi --name, /name, or cw rename).

  • opencode: ~/.local/share/opencode/opencode.db ($XDG_DATA_HOME/opencode when set) — opencode 2.x's SQLite store, read through a read-only connection because opencode's background service can be running. A session is a session_v2 row (cwd, opencode's own generated title, parent_id for subagent runs, time_archived); the conversation is session_message rows in seq order. Subagent and archived sessions are left out unless --all asks for them. The older 1.x layout is not read; cw doctor says so when that is what it finds.

  • zcode: ~/.zcode/cli/db/db.sqlite — a SQLite store (session/message/part tables), read through a read-only connection (mode=ro, the contract every read of a live app's store gets), so the app can be running while you list. There is no per-session transcript file: the conversation is part rows, the cwd is session.directory, and the title is one ZCode's own auto-titler keeps current — used directly, with the first genuine prompt standing in only for a session it never titled. Subagent runs (parent_id set) are left out unless --all asks for them.

    That layout is the documented session file format shared by the pi-derived CLIs, so reading these files directly is the sanctioned route rather than a hack — the same reason claude's projects/*.jsonl and codex's sessions/** are read as they are.

Titles are best-effort (scanned from the first user message / prompt in each session's log). Claude's cwd is read from the session content itself when available, falling back to a guess decoded from the project-directory name only if that's missing. Resuming a codex thread appends a new rollout file instead of extending the one it already had, so a single session id can own several; only the newest is read — for the row's timestamp, title, cwd, snippet, and any handoff. A codex fork or subagent thread has no prompt of its own, so it is named after the thread it forked from ((fork) …), the way a handoff is named after the session it continues. kimi names its own sessions too, and that name is used when its log holds no text prompt to read — but only when it is a real name, not the [image]/New Session placeholder it uses until it has one. A message relayed by a bridge (openclaw) behind its Conversation info: ⟦openclaw:ctx⟧ header is read as what was said after the header, not as the header itself.

cw doctor is the companion for the failure mode all this tolerance hides: every reader treats an unreadable store as an empty one, so when a tool changes its on-disk format, sessions silently vanish from the listing with nothing to say why. cw doctor asks each store the questions the readers swallow — is it there, does it open, how many sessions come out, and do the numbers add up (transcript files that resolve to no sessions are reported as broken, not empty). It exits non-zero when a store is broken, so it can run in a shell check.

kimi -S <id> refuses to resume a session from a different directory than the one it was created in. cw resume/cw <N> know each session's original directory already (it's the CWD column), so for all the tools they cd there automatically before resuming, rather than leaving you to do it by hand (or, for kimi, surfacing its hard error).

Pass --cwd <dir> to send it somewhere else instead, e.g. cw resume 2 --cwd /path/to/other-project. All five terminal tools tie a session's transcript to whichever directory it first ran in — claude, codex and kimi quietly keep writing to the original directory's log (confirmed by testing claude --resume from an unrelated directory: nothing was written under the new one), and step refuses outright, stopping to ask Fork this session into current directory? [y/N] (under -p there is no TTY to answer it: exit 1, nothing written) — so a session can't actually be relocated in place. If --cwd points at a directory other than the one the session already lives in, cw resume recognizes that a plain --resume there wouldn't accomplish anything (it'd work, but the conversation would still be invisible to that directory's own /resume picker) and instead does a handoff: it exports the full transcript and starts a new, freshly-seeded session in <dir> — same as cw <N> <other-tool>, but staying on the same tool. That new session is a real one rooted in <dir>, so it shows up in /resume there going forward.

ZCode ships both a desktop app and a terminal CLI under the same name, sharing this store. When the CLI is the zcode on PATH (told apart by file header — probing either with --help boots the desktop GUI), cw resume zcode <id> is a real resume (zcode --resume <id>, the TUI opening in the session's own directory), bare cw zcode opens the CLI's TUI here, and a --cwd relocation or cw <N> zcode hands off by seeding one headless zcode -p run and resuming the session it just persisted — the same two-step kimi needs. An install whose CLI bundles no @zcode/tui (one checked: the CLI delegating to the desktop's core) has no TUI at all, so a resume there lands on a hint instead of a node traceback — and the fact is remembered per install, keyed by the zcode executable's path, size and mtime so that an upgrade invalidates it by itself. After that the doomed start is skipped and the two ways forward are named outright: the desktop app's task list, or the headless zcode --resume <id> -p "<next instruction>" continuation (verified 2026-10-10 — the follow-up turn appends to the same session, context intact). cw takes that route itself when the instruction is on the command line: cw resume zcode <id> "<next instruction>", or cw resume <N> "..." by row number, which also gives words after an id a meaning, since a TUI would only reject them. Only on a machine where the desktop app is all there is does the wrapper fall back to the workspace deep link, zcode://workspace/open?path=…, which opens the right workspace but no particular session, and says so.

Notes in an Obsidian vault

Every agent keeps its own sessions, and none reads the others'. cw note carries the part worth keeping across: the judge cw search uses reads the session (the same digest cw rename titles from) and writes three short sections — what was done, why, what is still open — in the session's own language. The note lands in your vault as plain Markdown, in one folder per project (the session directory's basename; sessions started in your home directory go to _home), with frontmatter Obsidian's properties and Dataview can query: tool, session, cwd, project, updated, and the resume command that reopens it.

The vault is --vault DIR or CW_VAULT, which must already exist — or, with neither, ~/.local/share/crossweave/notes ($XDG_DATA_HOME/crossweave/notes; %LOCALAPPDATA%\crossweave\notes on Windows), made the first time a note is written. Obsidian is only a way to read the vault: it is Markdown files in a folder per project, so a machine without Obsidian — a remote box you ssh into — notes, lists ✎ and attaches context all the same. Noting a session again rewrites its note (found by its session: line) rather than adding a second one, and every session or topic note ends with a ## 我的补充 / My notes section below a <!-- cw note: ... --> marker. Put your own writing below that marker: rewrites replace the generated summary above it and preserve everything below it, including when the note has moved to another project. Older notes gain this section on their next rewrite; move any existing handwritten edits into a section below the marker before rewriting, since cw cannot distinguish those edits from the old generated summary. The marker is <!-- cw note: 下面是你自己的内容,重写时保留 / your own notes below survive rewrites -->; keep it intact.

cw note --all picks the sessions itself: every one with no note, or whose note it has outgrown (the ✎+ below), skipping sessions active in the last five minutes and ones under three turns. It says how many before starting and waits for a yes; -y skips that, and --since 2d (or 12h, 1w) narrows it to recent work. Four sessions are summarized at a time. Run from cron, it keeps the vault current on its own:

0 * * * *  PATH=$HOME/.local/bin:/usr/local/bin:/usr/bin CW_VAULT="$HOME/Documents/Obsidian Vault" cw note --since 2d -y >>$HOME/.cache/crossweave/note.log 2>&1

With a vault (CW_VAULT, or the default folder once it exists), the listing marks every session that has a note: ✎ after its title, or ✎+ (in yellow) when the session has moved on since the note was written and cw note would say something new.

Each project folder also gets an _index.md, the page to open in Obsidian for a project: the open items from its five newest notes at the top, each under a link to its note, then every note in one table with its date, tool and the cw resume command for its session. It is built from the notes alone, with no judge call, and rebuilt whenever cw note writes into that folder; cw note --index rebuilds every project's at once (after editing or deleting notes by hand, say). Like the notes it is generated, so edits to it are replaced. It has no session: line, so cw context and the ✎ marks never take it for a note.

A topic gets one note of its own. cw note <N> on a folded row (the ⧉ N rows of a bare cw, or a topic row in cw ui) reads every session of that topic — the whole history's, so a listing cached before the latest handoff still notes it all — oldest first, each from its note when that is still current and from its digest otherwise, and asks the judge for one note in four sections: where the topic stands now, the decisions that still hold, what is still open, and one line per session of how it got there (## 现状 / ## 决定 / ## 还剩什么 / ## 经过 in a Chinese topic, ## Now / ## Decisions / ## Open / ## History otherwise). It lands in the project folder as <topic>.md — no date, since there is one per topic — and noting the topic again rewrites it, found by the sessions it shares with the topic rather than by a name that changes with the newest session. Its frontmatter lists the sessions it covers and carries topic_key: (the topic's first session) rather than session:, so nothing that reads session notes mistakes it for one. The folded row's ✎ is then the topic note's, and turns ✎+ when a session joins the topic or one of its sessions moves on after the note. --session notes only the row's own session, as before. The project's _index.md lists its topic notes under ## Topics and takes their open items in place of the older ones of the sessions they cover.

cw context [DIR] reads them back: the newest three notes for that directory's project — its topic notes first, then the newest session notes no topic note covers, so three sessions of one topic no longer take every slot (the current one by default; --limit N for more), printed as one Markdown block a new session can start from — in whichever tool, since it is only text: cw claude "$(cw context) 接着做". With no notes it prints nothing and exits 1, so the substitution stays empty.

You rarely need to type it: with a vault, a fresh interactive cw claude, cw codex, cw step, or cw pi starts with those same notes already in hand — appended to the tool's system prompt (--append-system-prompt; codex's developer_instructions), so the session knows where the project stands without a message being sent or a turn spent. One stderr line says how many notes went in. It stays out of a -p run (a script's output should not change with the vault), a -c continuation (that session already knows), a subcommand (cw claude doctor), and a launch that passes its own system prompt; --no-context skips it once and CW_CONTEXT=off for good. kimi is left out: its only option, --agent-file, replaces the whole agent rather than adding to it. So is opencode, which has no system-prompt flag.

Pages from an LLM Wiki

cw export sends sessions into an LLM Wiki; CW_LLM_WIKI brings what it built back. Point it at the wiki project folder and cw context, and with it every fresh cw claude|codex|step|pi, carries up to three of the wiki's pages about the project after the notes:

export CW_LLM_WIKI=~/Documents/my-wiki
cw context                         # notes, then "# From the LLM Wiki at ..."
cw context --llm-wiki ~/work/dg3sw  # another wiki, this once

The project is the directory's name, as for notes (the home folder has none, so it gets no pages). The app's local API is asked first — POST /api/v1/projects/<id>/search, the hybrid keyword and vector search its own chat uses, with LLM_WIKI_API_TOKEN and CW_LLM_WIKI_API (default http://127.0.0.1:19828) as for --rescan. A launch waits on it for two seconds at most. When it does not answer — the app closed, no token, a 401 — the pages are matched by name in the folder itself: a page named for the project first, then one with it in its title, then by how often it says it; the header then says matched by name. The app's own index.md, log.md, overview.md and media are never among them, and each page is cut near 1500 characters. They are LLM Wiki's summaries, not the sessions: the header says they are background and can be behind what they were built from. The launch line counts them (cw: 1 note from crossweave and 3 LLM Wiki pages attached as background); --no-context and CW_CONTEXT=off keep them out with the notes.

Topic pages: cw wiki

A note is one session; a wiki page is one topic, across every session and every tool that touched it:

cw wiki "SBOM 与 Dependency-Track"   # write (or rebuild) the page
cw wiki                             # list the pages already written

It finds the sessions the way cw search does, reads each one by its note when it has a fresh one (a digest of the conversation otherwise), and asks the judge for one page: a summary, key points, commands and paths, pitfalls, and what is still open. Every bullet cites its sessions as [S1], [S2], which link to the session's note in Obsidian, and the source list under the page — with each session's cw resume command — is written by cw, so it cannot be made up. At most 12 sessions go into a page, strongest first (--max N to change it); --tool and --judge work as they do for cw search.

Pages go in $CW_VAULT/_wiki/, one per topic. Running the same topic again rebuilds the page from the sessions as they are now; whatever you write under the marker at the end of the page is kept.

Around the pages, the machinery stays light and deterministic — no judge calls:

cw wiki --stale          # the pages a source session has moved on since
cw wiki --rebuild [-y]   # rebuild those, one judge call each
cw wiki --discover [-y]  # propose topics from the vault's notes

A page records its build time and its sources in its frontmatter, so staleness is a file read, not a search: when any source session's newest write is later than the page's build — a conversation went on after the page was written from it — the bare cw wiki listing marks the page stale, cw wiki --stale names just those, and cw wiki --rebuild rebuilds them and nothing else. A session written to within the last ten minutes does not count: that conversation is still going, and its page is not behind on it. A page written in the middle of one would otherwise turn stale minutes after the build and stay that way all session; it goes stale once the conversation goes quiet. --discover is the one place the judge is asked for topics rather than pages: it reads the vault's notes (the newest 200), proposes up to 12 topics that have no page yet — strongest first, each with a one-line why, named in the notes' own language — and, after a yes, builds the pages. A vault with no notes says so and points at cw note --all first.

Every build also rewrites _wiki/_index.md, the page to open in Obsidian: one line per page with its topic, source count and build time, stale ones marked — the same generated _index.md convention the project folders follow, and like them it has no session: line, so nothing that reads notes mistakes it for one. Two kinds of links between pages are cw's own doing, not the judge's: a page that names another page links to it (in prose only — never inside code, so a command stays copyable), and pages built from a shared session point at each other under a ## 相关 / Related pages heading, with the count of sessions shared.

A project's overview page

A note is one session and a topic page one question; cw wiki --project is the page for a whole project — where it stands across every note in its vault folder:

cw wiki --project              # this directory's project
cw wiki --project ApiService   # a project folder by name
cw wiki --projects [-y]        # every project page that is missing or behind
cw wiki --projects --full -y   # every project page from scratch (after a lint, or a _schema.md change)

The first time, it reads the folder's topic notes and the session notes no topic note covers, newest first (twenty at most), and asks the judge for one page: 概要, 现状, 关键决定 (each with why), 常用步骤与命令, 踩过的坑, 还没解决 — or their English counterparts, in the language the notes use. Newer notes win where they disagree, and open items a newer note shows as done are dropped. Every bullet cites its notes as [[note|N2]], the source list under the page is cw's, and what you write under the marker at the end survives rebuilds. The page is _project.md beside _index.md, which links to it at the top; it has no session: line, so nothing that reads notes takes it for one. Folders starting with _ (_home, _unsorted, _wiki, _machines) are not projects and get none. A page is behind when a note in its folder was written or rewritten after it was built, or a new one appeared — and then it is edited, not rebuilt: the judge gets the page as it stands (its citations renumbered to the notes as they are now), the titles of all the notes, and only the new or rewritten ones in full, and folds them in — current state moved on, finished items dropped, everything still true kept. The knowledge compounds instead of being re-derived each time, and a rebuild cannot quietly lose what an older note said. A page with nothing new costs no judge call. It is built from scratch when a note it read has gone from the folder, or with --full.

Sorting _home

A session started in the home directory carries no project in its path, so its note lands in _home — where a Bluetooth bring-up, an apt lock fix and a compliance triage end up side by side, none of them with a project page. cw note --sort-home hands the judge every _home note not yet looked at (title and gist) together with the vault's projects (each with a few of its note titles), and asks where each belongs: an existing project, a new one named after the product, device or customer the work is about (Rock 5B, CRA), or keep for one-off machine housekeeping. One judge call for all of them; the plan is printed grouped by destination, and nothing moves without a yes (-y; --dry-run only shows it). A moved note gets the new folder's project:, the indexes of both folders are rebuilt, and the new project's page follows with the next upkeep. A note left in _home is marked home_sorted: true so it is not asked about again until it is rewritten. A note moved here — or by hand in Obsidian — stays put: when its session moves on, the note is rewritten where it now lives, not created again in _home; the same holds for topic notes. The daily upkeep runs this on the notes it has just written.

The vault's conventions and log

Two files at the vault's root belong to cw. _schema.md holds the conventions every generated text follows — notes, topic notes, topic pages, project pages: what to include (paths, commands, versions, decisions with their reasons, pitfalls with their fixes), what to leave out (session IDs, cw's own commands, small talk), one spelling per name, which language. Its text goes into every prompt just before the reply instruction, and where it conflicts with cw's built-in rules it wins, except for the section headings, which cw reads back (还剩什么 is how it finds open items). It is written with the defaults the first time cw generates something into the vault, so there is a file to edit; until then the defaults apply. _log.md gets one line per thing cw generated, in one shape — ## [2026-11-13 09:55] note | board | USB 枚举握手排查 (zcode) — so grep '] project |' _log.md lists every project-page update. A judge that fails writes neither.

A fresh cw claude|codex|… and cw context start from it: the overview comes first, then the newest notes. The daily upkeep writes the notes of quiet sessions and updates the pages they put behind, one judge call each.

Checking the vault, and asking it

cw wiki --lint                 # check the vault, write _lint.md
cw wiki --lint -y              # ...and let the judge review each project without asking
cw wiki --lint --no-review     # only the checks that need no judge
cw ask "Rock 5B 蓝牙固件下载要怎么设流控?"   # answer from the vault, citing its pages
cw ask "..." --save            # file the answer into _wiki/answers/

--lint is the health check of the LLM Wiki pattern. What cw can tell by itself comes first, each with the command that fixes it: project pages behind their notes, topic pages behind their sessions, notes behind their sessions (not counting a session a current topic note speaks for), how many sessions of three turns or more have no note (the tools' own sessions not counted), and links in cw's generated pages that point at no file. Then, after a yes, the judge reads each project's overview page against its newest notes — four projects at a time — for claims that contradict each other, open items or current-state claims a newer note suggests are done, and gaps the notes keep coming back to that the page does not say, each citing the notes. With CW_LLM_WIKI set, the report gains an LLM Wiki section: the app's Review queue as it stands — the items still unresolved, contradictions first, each with the pages it touches, read from its API or, when that does not answer, from the project's .llm-wiki/review.json — and its pages that may be one thing: names that differ only in case, spaces or hyphens (devgetter, dev-getter, DevGetter), and entity names one word longer than another (codex · codex-cli; a hint, since claude · claude-desktop are two things). Merge those in the app and put the one spelling into its schema.md, so the next ingest keeps to it. All of it goes into _lint.md at the vault's root, rewritten each run; nothing is changed until you run the commands it names.

cw ask reads the vault the way the pattern's index is meant to be read: the judge first sees a catalog — one line per project page, topic page, note and earlier answer, newest first, each with a short gist — picks up to eight pages, and answers from those alone, citing them as [E3]; the sources are listed under the answer with their paths. If nothing fits it says so rather than guess. An answer worth keeping (--save, or y when it asks) goes into _wiki/answers/ with its citations as Obsidian links, and from then on it is in the catalog: what was worked out once is not worked out again. Answers are not topic pages — cw wiki and its staleness never see them.

The listing marks the sessions a page was built from: ⌗ after the title, next to the ✎ a note would put there; cw ui's preview names the pages. Where ✎ says this session was written up, ⌗ says this session is part of a page — the difference between what one conversation did and what is known about the topic now.

Renaming sessions

A listing is scanned, not read, and the tools themselves name sessions well only when the first message cooperates — a conversation that opened with "hi" or "中文" is indistinguishable from every other one that did. cw rename writes a better title through to the store itself, using each tool's own rename surface, so the name is native to the tool and every listing shows it:

cw rename 12 "USB 枚举握手排查"        # row 12 from the last listing
cw 12 rename "USB 枚举握手排查"        # the same command, row first
cw 12 rename                          # no title: the judge proposes one
cw rename --auto --trivial            # propose titles for every trivial one
cw rename --trivial                   # the same -- --trivial implies --auto
cw rename --auto 3 7 -y               # only these rows; no confirmation

The row number may lead or follow the verb — cw 12 rename "..." is cw rename 12 "...", matching how cw 12 codex already reads. --auto has no one row to put first, so the sweep stays verb-first. One reading is given up for it: a bare rename after a row number is no longer passed to the tool as a continuation prompt (it used to mean "continue this session and say rename"), and cw resume 3 rename is the explicit spelling for anyone who meant that.

A row named with no title after it is a request for a suggestion, not a mistake — the row is the part that takes knowing the listing, and the title is the part the judge is better at. cw 12 rename asks the judge for one title and applies what it comes back with, printing the change; it is the single-row spelling of what --auto does for a batch, and it applies without asking because a batch of sixty is worth a look before anything is written and one row you just pointed at is not. The same two rules hold it back from writing something useless: a session with nothing in it is never asked, and a proposal that restates the title already there is reported rather than written, since a custom rename is what stops the tool's own titler from ever improving the name.

--auto and --trivial answer different questions — who writes the title, and which sessions — so cw rename --auto 3 7 names the rows and lets the judge title them, while cw rename --trivial on its own is the sweep, with --auto implied (it picks neither a title nor a row, so there is nothing else it could be asking for).

Six stores have a surface cw can write: zcode (title_source='custom', which its own auto-titler respects), codex (a newer session_index.jsonl line — the index keeps the most recent name per id), claude (a custom-title record appended to the transcript — the reader keeps the last one), step (a session_info record appended to the session file — both of step's readers keep the last one, and its own resume picker shows the name in place of the first prompt, which is what makes a session that opened with "中文" nameable), pi (the same session_info record — step's format is pi's) and kimi (title plus titleKind='custom' in the session's state.json — the kind every titler path bails on, so the name is permanent; updatedAt is left alone so a renamed session does not look freshly live). The others are refused rather than guessed at — opencode's title sits in a database its background service owns, and its CLI has no rename command. --auto extracts each candidate's content, asks the same judge cw search uses — one batched call per twenty sessions — and shows a before/after table that waits for a yes; it never proposes for a session that already has a real title, and skips sessions updated in the last five minutes, which are live conversations mid-flight with their own titler. A proposal that merely restates the title already there is shown as kept and not applied: a custom rename is, in every store, what stops the tool's own titler from ever improving the name, so writing "hi" over "hi" would freeze a bad title for good rather than leave it to be retitled. A session holding no words at all — opened and abandoned, a cancelled /resume, a launch closed before anything was typed — is never offered to the judge, because there is no topic to name and asking anyway buys an invented title. The sweep counts those on stderr and leaves them out of the table: they can never be renamed, so carrying one would spend a slot of the run's sixty on it and re-offer it on every run after. Naming one explicitly (cw rename --auto 7) still reports it rather than dropping it. Renaming a claude or step session restores the file's mtime afterwards, so a months-old conversation does not read as active a minute ago and float to the top of the listing. "A real title" is a question of shape, not length: a row titled with a pasted shell transcript, an ls -l listing, a bare URL or a CLI's startup banner says less than one titled "hi", and counts as having no title at all.

Development

pip install -e ".[test]"
pytest tests/ -v

What this isn't

Not a TUI, not a worktree manager, not a multi-agent orchestrator. If you want any of that, look at ccmanager (git-worktree-centric session manager, also supports Kimi CLI) or claude-squad.

License

MIT — see LICENSE.

Delete a session

Run cw 7 delete (or cw delete 7) to remove row 7 from the session files scanned by cw. The number refers to your last displayed list. The command shows the tool and full session ID and asks for confirmation; -y skips that prompt. Refresh with cw to get new row numbers after deletion.

Files are moved to ~/.cache/crossweave/deleted/, with a manifest.json mapping backup files to their original paths for manual recovery. Codex removal includes every rollout for the selected session. Kimi removal includes its session directory. Claude, step and pi removal moves the selected transcript. ZCode and opencode database sessions and remote rows are currently unsupported. Tool-owned database and index entries are not removed, so a tool's own history UI may still show the session.

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages