lolipopshock/pi-clm

TypeScript

39

1 commits

updated Sep 30, 2026

See the code

See what people are saying

SourceMessageScoreDate

Y'all this is a sexy paper; context language models (r/LocalLLaMA)

[Paper linky - Context Language Models](https://arxiv.org/abs/2609.37725) The central idea of the paper is incredibly simple. Give a model the ability to edit its context on-the-go like a file has major benefits on task performance, context management (memory) and even computational efficiency…

13

Oct 5, 2026

README

pi-clm

  ____ _     __  __
 / ___| |   |  \/  |     
| |   | |   | |\/| |
| |___| |___| |  | |     
 \____|_____|_|  |_|     pi-clm — the agent that manages its own context

pi-clm is a Pi extension that lets the agent manage its own context: the language model can generate functions to modify the context (mapped as a file), and the edited version becomes its next input. Check our paper Context Language Models and research codebase.

Install

pi install npm:@lolipopshock/pi-clm

# From source, or to try it for one session without installing:
pi install git:github.com/lolipopshock/pi-clm
pi -e git:github.com/lolipopshock/pi-clm

Quick start

commandwhat it does
/clmopen the panel: overview (context size over time + compaction points)
The overview page: context size per request, with two points where the model compacted its own context
input (what the next request contains) · edits (per-revision side-by-side diff)
The edits page: a tool result before and after the model shortened it
/clm statusthree lines: next request vs budget, edits, changed settings
/clm configopen settings; /clm config <setting> <value> changes one, /clm config reset drops this session's changes
The settings page: sizes, guard, files, and every setting
/clm-compact [instructions]ask the model to compact its own context now; anything you add (e.g. what to keep) is passed along. The result shows on the edits page
/clm on / off / resetenable, use raw context, discard the projection

In the panel: 1–4 or Tab switch pages, ← → step through compaction points, z zooms the chart, Enter opens the selection, q closes.

Docs

  • How it works — the mirror, what runs without the model, the panel, safety.
  • Configuration — budget, reserve, reminders, guard, steering and the other settings.
  • Architecture — the system as implemented, design notes, known limitations.
  • Development — setup, checks, releasing.

Citation

If you use pi-clm in your research, please cite Context Language Models:

@article{shao2026context,
  title   = {Context Language Models},
  author  = {Shao, Rulin and Shen, Shannon Zejiang and Yin, Junjie Oscar and Li, Yuetai and
             Wang, Minheng and Ivison, Hamish and Poovendran, Radha and Lambert, Nathan and
             Xiao, Teng and Lewis, Mike and Yih, Wen-tau and Zettlemoyer, Luke and Koh, Pang Wei},
  journal = {arXiv preprint arXiv:2609.37725},
  year    = {2026}
}

lolipopshock/pi-clm

TypeScript

39

1 commits

updated Sep 30, 2026

See the code

See what people are saying

SourceMessageScoreDate

Y'all this is a sexy paper; context language models (r/LocalLLaMA)

[Paper linky - Context Language Models](https://arxiv.org/abs/2609.37725) The central idea of the paper is incredibly simple. Give a model the ability to edit its context on-the-go like a file has major benefits on task performance, context management (memory) and even computational efficiency…

13

Oct 5, 2026

README

pi-clm

  ____ _     __  __
 / ___| |   |  \/  |     
| |   | |   | |\/| |
| |___| |___| |  | |     
 \____|_____|_|  |_|     pi-clm — the agent that manages its own context

pi-clm is a Pi extension that lets the agent manage its own context: the language model can generate functions to modify the context (mapped as a file), and the edited version becomes its next input. Check our paper Context Language Models and research codebase.

Install

pi install npm:@lolipopshock/pi-clm

# From source, or to try it for one session without installing:
pi install git:github.com/lolipopshock/pi-clm
pi -e git:github.com/lolipopshock/pi-clm

Quick start

commandwhat it does
/clmopen the panel: overview (context size over time + compaction points)
The overview page: context size per request, with two points where the model compacted its own context
input (what the next request contains) · edits (per-revision side-by-side diff)
The edits page: a tool result before and after the model shortened it
/clm statusthree lines: next request vs budget, edits, changed settings
/clm configopen settings; /clm config <setting> <value> changes one, /clm config reset drops this session's changes
The settings page: sizes, guard, files, and every setting
/clm-compact [instructions]ask the model to compact its own context now; anything you add (e.g. what to keep) is passed along. The result shows on the edits page
/clm on / off / resetenable, use raw context, discard the projection

In the panel: 1–4 or Tab switch pages, ← → step through compaction points, z zooms the chart, Enter opens the selection, q closes.

Docs

  • How it works — the mirror, what runs without the model, the panel, safety.
  • Configuration — budget, reserve, reminders, guard, steering and the other settings.
  • Architecture — the system as implemented, design notes, known limitations.
  • Development — setup, checks, releasing.

Citation

If you use pi-clm in your research, please cite Context Language Models:

@article{shao2026context,
  title   = {Context Language Models},
  author  = {Shao, Rulin and Shen, Shannon Zejiang and Yin, Junjie Oscar and Li, Yuetai and
             Wang, Minheng and Ivison, Hamish and Poovendran, Radha and Lambert, Nathan and
             Xiao, Teng and Lewis, Mike and Yih, Wen-tau and Zettlemoyer, Luke and Koh, Pang Wei},
  journal = {arXiv preprint arXiv:2609.37725},
  year    = {2026}
}