Show HN: Ctx – a /resume that works across Claude Code and Codex
TL;DR Highlight
ctx builds a local CLI tool capable of maintaining and branching conversational context between Claude Code and OpenAI Codex, benefiting developers who want seamless AI coding sessions.
Who Should Read
Developers experiencing lost context when switching between Claude Code and Codex, or when sessions are interrupted during their workflow.
Core Mechanics
- ctx manages Claude Code and OpenAI Codex conversations by grouping them into 'workstreams', binding each to both a Claude conversation ID and a Codex conversation ID.
- The Exact transcript binding feature ensures that when a workstream is reloaded, it retrieves the precise conversation history associated with that session, preventing 'transcript drift'.
- Safe branching allows developers to duplicate the current workstream state into a new branch, creating a completely isolated conversation stream.
- Stored workstreams, sessions, and entries are indexed in a SQLite DB for fast searching and visual inspection via a local browser frontend.
- The pin feature permanently includes specific entries in the context, while the exclude feature hides them from the model without removing them from search results; unwanted items can also be fully deleted.
- ctx is designed to be completely local-first, requiring no API keys or external services; data is stored in a standard SQLite file and local files.
- Installation is completed with a single command: `git clone` followed by `./setup.sh`, which creates a local project DB, installs the ctx shim in `~/.contextfun/bin`, and creates symbolic links to the skills directories for Claude and Codex.
- Inspired by Claude Code's `/resume` command, ctx differentiates itself by integrating similar functionality across both AI coding tools.
Evidence
- "One commenter stated they've never used a `/resume` function, suggesting that starting a new session is preferable to resuming if changes are made and documented, questioning the universality of the need for 'long-running context maintenance' that ctx addresses."
How to Apply
- When switching between Claude Code and OpenAI Codex, create a workstream with ctx to maintain the same working context, starting with a simple `git clone` and `./setup.sh`.
- When experimenting with a long-term AI coding project, use ctx's branching feature to safely explore new directions while preserving the original workstream.
- For architectural decisions or design documents frequently referenced across AI sessions, pin those entries in ctx to ensure they are always included in the context.
- If handing off an AI coding session to a teammate, consider sharing the SQLite DB file or waiting for the implementation of an export/import feature to transfer the workstream.
Code Example
# Installation
git clone https://github.com/dchu917/ctx.git
cd ctx
./setup.sh
# setup.sh does the following:
# - Creates ./.contextfun/context.db
# - Writes ./ctx.env
# - Installs repo-based ctx shim in ~/.contextfun/bin
# - Creates local skills links in ~/.claude/skills and ~/.codex/skills
# Usage example (based on README)
# In Claude Code
/ctx save feature-audit
# In Codex
ctx resume feature-audit
# Create a branch
ctx branch feature-audit feature-audit-v2Terminology
Related Papers
Show HN: ctx – Search the coding agent history already on your machine
Claude Code, Cursor, Codex 등 코딩 에이전트가 이전 세션의 논의·결정·실패 시도를 잊지 않도록 SQLite로 인덱싱해 재사용할 수 있게 해주는 오픈소스 CLI 도구다.
Micro-Agent: Beat Frontier Models with Collaboration Inside Model API
vLLM 팀이 단일 모델 API 호출 뒤에서 여러 모델이 협업하는 'Micro-Agent' 개념을 공개했습니다. 별도의 에이전트 코드 없이 라우터 레이어에서 모델 조합을 실행해 GPT-4급 결과를 더 저렴하게 낼 수 있다는 아이디어입니다.
Ornith-1.0: self-improving open-source models for agentic coding
Gemma 4와 Qwen 3.5를 기반으로 파인튜닝한 코딩 특화 오픈소스 모델로, RL(강화학습)을 통해 스캐폴드(에이전트 실행 구조)까지 함께 최적화하는 방식을 주장하지만, 커뮤니티에서는 벤치마크 과최적화에 불과하다는 의심을 받고 있다.
Entity Binding Failures in Tool-Augmented Agents
AI 에이전트가 올바른 도구를 선택해도 잘못된 대상에 실행하는 'Entity Binding 실패' 문제를 정의하고, 이를 막는 실행 정책을 평가한 논문.
Herdr: Agent multiplexer that lives in your terminal
여러 AI 코딩 에이전트(Claude, Codex 등)를 하나의 터미널에서 동시에 실행·관리할 수 있는 Rust 기반 오픈소스 툴로, tmux처럼 세션이 유지되고 SSH로 원격 접속도 가능해 멀티 에이전트 워크플로우를 크게 단순화해준다.
Ornith-1.0: Self-scaffolding LLMs for agentic coding
모델이 문제 풀이 전략(scaffold)을 직접 생성하고 개선하는 자기강화 학습 프레임워크를 적용한 오픈소스 코딩 특화 LLM으로, 9B 소형 모델부터 397B 대형 모델까지 라인업을 갖추고 SWE-Bench 등 주요 벤치마크에서 Claude Opus 4.7을 능가하는 성능을 보여줬다.