npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@t-oil/contx

v0.1.0

Published

Continue + Context — save and resume AI sessions across Claude CLI, GPT CLI, Gemini CLI, Cursor

Downloads

117

Readme

contx

Continue + Context — ทำงานต่อเนื่องข้าม AI tools โดยไม่ต้องอธิบายซ้ำ

npm version license

🇬🇧 Read in English


ปัญหาที่แก้

ทุกครั้งที่สลับ AI tool — Claude CLI ไป Cursor, Cursor ไป GPT CLI — context หาย ต้องเสียเวลาอธิบาย task เดิมซ้ำทุกครั้ง

Claude CLI  →  Cursor  →  GPT CLI  →  Gemini CLI
    💀 context หายทุกครั้งที่ switch

วิธีแก้

contx คือ CLI เบาๆ ที่เซฟ session state ไว้ในเครื่อง แล้ว inject เข้า AI tool ถัดไปโดยอัตโนมัติ

Claude CLI  →  Cursor  →  GPT CLI  →  Gemini CLI
    ✅ context ต่อเนื่องทุกครั้ง

การทำงาน

contx save          เซฟ session ปัจจุบัน → ~/.contx/sessions.db
contx load          โหลด context → stdout (pipe เข้า tool ได้เลย)
contx inject        เขียน context → .cursor/rules/ (Cursor อ่านอัตโนมัติ)
contx setup         เพิ่ม shell aliases สำหรับ Claude, GPT, Gemini CLI

ไม่มี daemon ไม่มี background process ไม่ใช้ network แค่ SQLite file ในเครื่อง


ติดตั้ง

git clone https://github.com/t-Oil/contx
cd contx
npm install
npm run build
npm link

หรือผ่าน npm (เมื่อ publish แล้ว):

npm install -g @t-oil/contx

เริ่มใช้งาน

ขั้นตอนที่ 1 — ตั้งค่าครั้งแรกครั้งเดียว

contx setup
source ~/.zshrc   # หรือ ~/.bashrc

ขั้นตอนที่ 2 — เซฟ context ก่อนจบ session

contx save

ระบบจะถามว่า:

  • ตอนนี้กำลังทำอะไรอยู่?
  • ขั้นตอนถัดไปคืออะไร?
  • ไฟล์ไหนที่กำลังแก้อยู่?

หรือส่งเป็น flag เพื่อข้าม prompt:

contx save --task "refactor auth middleware" --next "add tenantId to JWTPayload" --tool claude

ขั้นตอนที่ 3 — ทำงานต่อใน tool ใหม่

# Claude CLI
claude-ctx "continue"

# GPT / sgpt
gpt-ctx "continue"

# Gemini CLI
gemini-ctx "continue"

# Cursor IDE
contx inject --tool cursor
# → Cursor อ่าน .cursor/rules/contx.mdc อัตโนมัติตอน AI request ครั้งถัดไป

# Copy ไปวางใน tool ใดก็ได้
cc

ตัวอย่างการใช้งานจริง

Scenario 1 — Claude CLI → Cursor

ทำงานใน Claude CLI แล้วอยากต่อใน Cursor

ก่อนจบ session บอก Claude ว่า:

สรุป session นี้แล้ว run contx save ให้หน่อย

Claude จะ run:

contx save --task "refactor auth middleware — extracted verifyToken fn, tests passing" \
           --next "add tenantId to JWTPayload, inject into Request via middleware" \
           --tool claude

จากนั้นเปิด Cursor แล้ว inject:

contx inject --tool cursor
# เปิด Cursor → เริ่ม chat → context อยู่ที่นั่นแล้ว

Scenario 2 — Cursor → GPT CLI

ทำงานใน Cursor แล้วอยากต่อใน GPT CLI

ใน Cursor terminal เซฟก่อน:

contx save --task "fix chart rendering bug in Dashboard" \
           --next "check ResponsiveContainer width prop" \
           --tool cursor

จากนั้นต่อใน GPT CLI:

gpt-ctx "continue from where I left off"
# context inject อัตโนมัติผ่าน alias

Scenario 3 — พักงาน แล้วเปิดต่อวันถัดไป

ก่อนปิด:

contx save

เช้าวันถัดไป เปิด tool ไหนก็ได้:

cd ~/projects/my-api
claude-ctx "good morning, let's continue"
# โหลด session ของ my-api อัตโนมัติ

คำสั่งทั้งหมด

| คำสั่ง | ทำอะไร | |---|---| | contx save | เซฟ session ปัจจุบันลง local cache | | contx load | print context ออก stdout (pipeable) | | contx inject --tool cursor | เขียน context เข้า Cursor rules | | contx status | ดู sessions ล่าสุด | | contx setup | เพิ่ม shell aliases เข้า rc file |

โหมดของ contx load

| โหมด | ~Token | เหมาะกับ | |---|---|---| | --mode brief | ~300 | งานเล็ก แก้ bug | | --mode normal | ~1,000 | handoff ทั่วไป (default) | | --mode full | ~3,000 | งานใหญ่ หลายวัน |

contx load --mode brief | claude "continue"

Auto-detect Project

contx load จะตรวจจาก folder ปัจจุบันอัตโนมัติ ไม่ต้องระบุชื่อ project

cd ~/projects/my-api
contx load          # โหลด session ของ my-api อัตโนมัติ

cd ~/projects/dashboard
contx load          # โหลด session ของ dashboard อัตโนมัติ

Override ได้ตลอดด้วย --project:

contx load --project my-api

ข้อมูลเก็บที่ไหน

ทุกอย่างเก็บที่ ~/.contx/sessions.db (SQLite) ในเครื่องคุณเท่านั้น

  • ไม่มี cloud sync
  • ไม่มี telemetry
  • ไม่มี network request

Tool ที่รองรับ

| Tool | วิธีเชื่อม | Seamless | |---|---|---| | Claude CLI | claude-ctx "..." (shell alias) | ✅ | | GPT / sgpt | gpt-ctx "..." (shell alias) | ✅ | | Gemini CLI | gemini-ctx "..." (shell alias) | ✅ | | Cursor IDE | contx inject --tool cursor | ✅ อ่านอัตโนมัติ |


ร่วมพัฒนา

ยินดีรับ PR ทุกอย่าง กรุณาเปิด issue ก่อนถ้าเป็น major change

git clone https://github.com/t-Oil/contx
cd contx
npm install
npm run dev

License

MIT