[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2223":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":14,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},2223,"ctx","dchu917\u002Fctx","dchu917","Local context manager for Claude Code and Codex with workstreams, transcript binding, and branching.",null,"Python",121,9,118,1,0,4,3,"MIT License",false,"main",true,[23,24,25,26,27,28],"claude-code","cli","codex","context-management","developer-tools","sqlite","2026-06-12 02:00:38","# ctx\n\nLocal context manager for Claude Code and Codex.\n\nKeep exact conversation bindings, resume work cleanly, branch context without mixing streams, and optionally inspect saved workstreams in a local browser frontend.\n\n```text\nClaude Code chat          Codex chat\n      |                      |\n      v                      v\n   \u002Fctx ...               ctx ...\n          \\              \u002F\n           v            v\n      +----------------------+\n      | workstream: feature-audit |\n      |   claude:  abc123    |\n      |   codex:   def456    |\n      +----------------------+\n                 |\n                 +--> feature-audit-v2 branch\n```\n\n## Why `ctx`\n\n- Exact transcript binding: each internal ctx session can bind to the exact Claude and\u002For Codex conversation it came from.\n- No transcript drift: later pulls stay on that bound conversation instead of jumping to the newest chat on disk.\n- Safe branching: start a new workstream from the current state of another one without sharing future transcript pulls or hijacking the source conversation.\n- Indexed retrieval: saved workstreams, sessions, and entries are indexed for fast `ctx search` lookup.\n- Curated loads: pin saved entries so they always load, exclude saved entries so they stay searchable but stop getting passed back to the model, or delete them entirely.\n- Local-first: no API keys, no hosted service, plain SQLite plus local files.\n\n## Quick Install\n\nClone the repo and do the standard project-local setup:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fdchu917\u002Fctx.git\ncd ctx\n.\u002Fsetup.sh\n```\n\nThis is the main development-friendly install path.\n\nIt does the following:\n\n- creates `.\u002F.contextfun\u002Fcontext.db`\n- writes `.\u002Fctx.env`\n- installs a repo-backed `ctx` shim into `~\u002F.contextfun\u002Fbin`\n- links local skills into `~\u002F.claude\u002Fskills` and `~\u002F.codex\u002Fskills`\n\nUse this when:\n\n- you want the repo checked out locally\n- you want `ctx` to use a project-local DB by default\n- you are developing or editing the repo itself\n\n## 4-Step Demo\n\n1. Clone and set it up:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fdchu917\u002Fctx.git\ncd ctx\n.\u002Fsetup.sh\n```\n\n2. Start a new workstream:\n\nClaude Code:\n\n```text\n\u002Fctx start feature-audit --pull\n```\n\nCodex or your terminal:\n\n```bash\nctx start feature-audit --pull\n```\n\n3. Know what `--pull` means:\n\n- `ctx start feature-audit --pull` creates the workstream and pulls the existing context from the current conversation into it.\n- `ctx start feature-audit` creates the workstream starting from that point only. It does not backfill the earlier conversation.\n\n4. Come back later and continue or branch:\n\nClaude Code:\n\n```text\n\u002Fctx resume feature-audit\n\u002Fctx branch feature-audit feature-audit-v2\n```\n\nCodex:\n\n```bash\nctx resume feature-audit\nctx branch feature-audit feature-audit-v2\n```\n\n## Daily Use\n\nClaude Code:\n\n- `\u002Fctx`: show the current workstream for this repo, or tell you that none is set yet.\n- `\u002Fctx list`: list saved workstreams, with this repo first when applicable.\n- `\u002Fctx search dataset download`: search saved workstreams and entries for matching context.\n- `\u002Fctx start my-stream --pull`: create a new workstream and pull the existing context from the current conversation into it before continuing.\n- `\u002Fctx resume my-stream`: continue an existing workstream and append new context from this conversation to it.\n- `\u002Fctx rename better-name`: rename the current workstream.\n- `\u002Fctx rename better-name --from old-name`: rename a specific workstream without switching to it first.\n- `\u002Fctx delete my-stream`: delete the latest saved `ctx` session in that workstream.\n- `\u002Fctx curate my-stream`: open the saved-memory curation UI for that workstream.\n- `\u002Fctx branch source-stream target-stream`: create a new workstream seeded from the current saved state of another one.\n- `\u002Fbranch source-stream target-stream`: Claude shortcut for the same branch operation.\n\nCodex:\n\n- `ctx`: show the current workstream for this repo, or tell you that none is set yet.\n- `ctx list`: list saved workstreams.\n- `ctx list --this-repo`: list only workstreams linked to the current repo.\n- `ctx search dataset download`: search saved workstreams and entries for matching context.\n- `ctx search dataset download --this-repo`: search only workstreams linked to the current repo.\n- `ctx web --open`: open the optional local browser UI for browsing, searching, and copying continuation commands.\n- `ctx start my-stream`: create a new workstream starting from this point only.\n- `ctx start my-stream --pull`: create a new workstream and pull the existing context from the current conversation into it first.\n- `ctx resume my-stream`: continue an existing workstream.\n- `ctx resume my-stream --compress`: continue an existing workstream with a smaller load pack.\n- `ctx rename better-name`: rename the current workstream.\n- `ctx rename better-name --from old-name`: rename a specific workstream without switching to it first.\n- `ctx delete my-stream`: delete the latest saved `ctx` session in that workstream.\n- `ctx curate my-stream`: open the saved-memory curation UI for that workstream.\n- `ctx branch source-stream target-stream`: create a new workstream seeded from the current saved state of another one.\n\nCodex note:\n\nCodex does not currently support repo-defined custom slash commands like `\u002Fctx list`, so in Codex you should use the installed `ctx` command with subcommands. When `ctx start`, `ctx resume`, or `ctx branch` load context, they print a short summary of what the workstream is, the latest session being targeted, and the most recent items. They also include an explicit hint that in Codex you can inspect the full command output with `ctrl-t`, and in Claude you can expand the tool output block, plus guidance for the agent to summarize briefly and ask how you want to proceed instead of pasting the full pack back.\n\n## Other Installation Paths\n\n### Clone the repo and install a shared global setup from that clone\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fdchu917\u002Fctx.git\ncd ctx\n.\u002Fsetup.sh --global\n```\n\nThis runs the same quickstart entrypoint, but installs the pinned global release into `~\u002F.contextfun` instead of wiring the current clone as the live runtime.\n\n### Install globally without cloning first\n\n```bash\ncurl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fdchu917\u002Fctx\u002Fmain\u002Fscripts\u002Finstall.sh | bash\n```\n\nThis installs a pinned tagged release into `~\u002F.contextfun`, including the `ctx` binary, the Python package, the default DB, and the self-contained Claude\u002FCodex skills.\n\n### Install the bootstrap skill first with `skills.sh`\n\n```bash\nnpx skills add https:\u002F\u002Fgithub.com\u002Fdchu917\u002Fctx --skill ctx -y -g\n```\n\nThis installs the `ctx` bootstrap skill first, not the CLI binary directly. After that, the bundled `skills\u002Fctx\u002Fscripts\u002Fctx.sh` wrapper can run `ctx install` or auto-install the global CLI into `~\u002F.contextfun` on first use.\n\n### Bootstrap an agent shell without a full manual clone flow\n\nGlobal shell bootstrap:\n\n```bash\nsource \u003C(curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fdchu917\u002Fctx\u002Fmain\u002Fscripts\u002Fagent_bootstrap.sh)\n```\n\nProject-local shell bootstrap:\n\n```bash\nsource \u003C(curl -fsSL https:\u002F\u002Fraw.githubusercontent.com\u002Fdchu917\u002Fctx\u002Fmain\u002Fscripts\u002Fagent_setup_local_ctx.sh)\n```\n\nThese are best for Claude Code or Codex terminals.\n\n### Advanced manual wiring after cloning\n\nRepo-backed `ctx` shim:\n\n```bash\nbash scripts\u002Finstall_shims.sh\n```\n\nSkill links only:\n\n```bash\nbash scripts\u002Finstall_skills.sh\n```\n\nOverride skill directories if needed:\n\n```bash\nCODEX_SKILLS_DIR=\u002Fcustom\u002Fcodex\u002Fskills \\\nCLAUDE_SKILLS_DIR=\u002Fcustom\u002Fclaude\u002Fskills \\\nbash scripts\u002Finstall_skills.sh\n```\n\n## Documentation\n\n- [Install and Remove](docs\u002Finstall.md)\n- [Usage](docs\u002Fusage.md)\n- [Architecture](docs\u002Farchitecture.md)\n- [Integrations](docs\u002Fintegrations.md)\n- [Repo Layout](docs\u002Frepo-layout.md)\n- [Maintenance and Release](docs\u002Fmaintenance.md)\n- [Documentation Index](docs\u002FREADME.md)\n\n## Curate Saved Memory\n\nUse `ctx curate \u003Cworkstream>` to review the saved entries that feed future loads for a workstream:\n\n```bash\nctx curate my-stream\n```\n\nThe terminal UI lets you scroll saved entries, inspect a preview, and change how each entry behaves in future packs:\n\n- `j` \u002F `k` or arrow keys move through entries\n- `Enter` toggles a larger preview\n- `p` pins an entry so it always loads, even in compressed mode\n- `x` excludes an entry from future loads, but keeps it saved and searchable\n- `a` restores the default load behavior\n- `d` marks an entry for deletion, then `y` confirms the delete\n- `q` exits\n\nNotes:\n\n- This changes ctx memory only. It does not edit or delete the original Claude\u002FCodex chat.\n- If you are in a non-interactive shell, use `ctx web --open` and manage entries from the browser detail page instead.\n- `ctx delete --interactive \u003Cworkstream>` opens the same curation UI.\n- See [docs\u002Fusage.md](docs\u002Fusage.md) and [docs\u002Farchitecture.md](docs\u002Farchitecture.md) for deeper detail on load controls.\n\n## Clear Workstreams\n\nUse `ctx clear` to delete whole workstreams together with their linked sessions and saved entries:\n\n```bash\nctx clear --this-repo --yes\nctx clear --all --yes\n```\n\nNotes:\n\n- `--this-repo` deletes only workstreams linked to the current repo.\n- `--all` deletes workstreams across the entire current `ctx` DB.\n- `--yes` is required for the actual delete. Without it, `ctx` prints what would be removed and exits without deleting anything.\n- This clears ctx-managed memory, attachments, and current-workstream pointers for the deleted workstreams. It does not delete the original Claude\u002FCodex chat files.\n\n## Security\n\n`ctx` is a context layer, not a sandbox. See [SECURITY.md](SECURITY.md) for the threat-model summary and [docs\u002Fmaintenance.md](docs\u002Fmaintenance.md) for operational notes.\n\n## FAQ\n\nDo I need API keys?\n\n- No. Everything is local.\n\nCan multiple repos share the same context DB?\n\n- Yes. Set `ctx_DB` to a shared path such as `~\u002F.contextfun\u002Fcontext.db`.\n\nDoes deleting a ctx session delete the actual Claude\u002FCodex chat?\n\n- No. It only deletes the internal ctx session and its stored attachments.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","ctx 是一个用于 Claude Code 和 Codex 的本地上下文管理器，支持工作流、对话绑定和分支。其核心功能包括精确的对话绑定、无漂移的后续拉取以及安全的工作流分支，确保开发者可以在不干扰源对话的情况下创建新的工作流。此外，项目还提供了索引检索和精选加载等特性，便于快速查找和管理保存的工作流。此工具适合需要在本地环境中维护多个开发对话或任务分支的场景使用，无需依赖任何外部API密钥或服务，仅需SQLite和本地文件支持即可运行。",2,"2026-06-11 02:48:58","CREATED_QUERY"]