Reversible context compression for AI agents. furl-ctx shrinks large tool outputs, logs, web fetches, and RAG chunks before they fill your agent's context window, and keeps every original byte retrievable on demand.
FAQ
furl-ctx is a Claude Code plugin with 1 hand-picked skill for development work, indexed on Flowy. Install it with the command on its page. It includes furl. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
> /plugin marketplace add omar-y-abdi/furl-ctx> /plugin install furl@furl
Reversible context compression for AI agents. furl-ctx shrinks large tool outputs, logs, web fetches, and RAG chunks before they fill your agent's context window, and keeps every original byte retrievable on demand. Think prompt compression and context pruning for token optimization, without losing data. CCR, short for Compress-Cache-Retrieve, is the core: compression where every dropped byte stays retrievable.
What works today: furl-ctx is context compression for AI agents that reduces Claude Code token usage while every original byte stays retrievable, and install is two commands. Automatic hands-off compression works on Claude Code 2.1.163 and newer: the PostToolUse hook mirrors each replacement to the tool's output shape, so the harness honors it, verified live by both external audits on 2.1.212. This shape-mirroring was built in response to upstream issue #68951, where an unmirrored replacement was dropped. The manual MCP tools furl_compress, furl_retrieve, and furl_search work on every version, and the opt-out PreToolUse pipe adds automatic Bash savings when no Bash permission rules are configured. furl-ctx never touches your Read, Grep, or Glob file reads by design. See LIBRARY.md for the canonical harness status.
Keep finding yourself waiting on the next usage limit reset?
Answer: Stop making your AI agent read everything.
furl-ctx works as a context compression and retrieval layer for AI agents. It shrinks large tool outputs, logs, web fetches, and RAG chunks before they consume your agent's context window, and keeps the original data available for exact retrieval when needed.
Prerequisite: uv on your PATH (same as the official serena plugin).
Then two commands inside Claude Code:
/plugin marketplace add omar-y-abdi/furl-ctx
/plugin install furl@furl
That's it β this installs the compression hook, the MCP tools, and the skill. No pip install, no setup: Furl fetches itself on first use.
The PyPI package is furl-ctx. Do not run pip install furl, which installs an unrelated URL-manipulation library.
The same engine drops into any Python app or MCP host:
from furl_ctx import compress
messages = [{"role": "tool", "content": "..."}]
result = compress(messages, model="claude-sonnet-4")
# result.messages β compressed when content is large enough; CCR keeps originals retrievable
Install, usage, pipeline internals, prompt-caching contract, and the full FURL_* config reference live in LIBRARY.md.
furl-ctx filters out unwanted noise while the agent searches for the sections it needs, so input token usage drops while the answer stays the same.
What works today is an on-demand toolkit for Furl: Your agent calls the MCP tools directly
furl_compress β compress large payloads into an agent-readable summaryfurl_retrieve β recover exact original content by pattern, field, or line rangefurl_search β locate relevant sections inside compressed datafurl_list β inspect stored payloadsfurl_stats β view compression resultsfurl_purge β remove stored payloadsInstead of pushing thousands of irrelevant lines into the model, Furl gives the agent a compressed view of the data. If it later needs something that was omitted, it explicitly retrieves just that portionβby pattern, field, or line rangeβwithout materializing the entire payload again.
Unlike token compressors or summarizers, Furl never throws data away. Compression is reversible: every original text payload remains byte-exact and retrievable.
Compression savings vary by data type:
Where furl-ctx saves little or nothing. Repetitive text with no newlines compresses at roughly 0 percent, because the engine is line and structure oriented. Single-line high-entropy content is near 0 percent. Code and file reads are 0 percent by design, because Read, Grep, and Glob are never touched. So a coding session's expected savings come only from large structured tool outputs, for example JSON, logs, and search results from Bash, WebFetch, and sub-agent tasks.
Retrieval model: Furl is pull-based, not push-based.
Dropped content does not automatically reappear. The compressed representation intentionally removes those sections from the model-visible context. If the agent needs a specific omitted item by pattern, field, or line range, it retrieves it explicitly. The data is never lost, every retrieval is byte-exact and done by the agent.
Tradeoff is visibility:
A unique anomaly hidden inside repetitive data will not appear in the compressed summary unless the agent already knows to search for it. Furl preserves data availability, not automatic anomaly discovery.
Furl compresses what is already in context, not files on disk. It shrinks a payload your agent has already read into its context window. It cannot reach into a large file on disk to pull out the part that matters, and it cannot take a file path and return compressed output. For a genuinely large file, the first and biggest reduction comes from pre-filtering with tools like grep, awk, sed, or jq to extract the relevant slice; Furl then compresses that slice further and keeps every dropped byte retrievable. Treat the two as layers: pre-filter megabytes down to a focused excerpt, then let Furl compress the excerpt. Furl is a strong second layer on top of pre-filtering, not a replacement for it.
Why "Furl"?
To furl a sail is to roll it up and keep it out of the way until needed. Furl does the same for context: it rolls large amounts of information out of the active window while keeping it ready to unfurl when retrieval is required.
Furl is a hard fork of Headroom's compression engine, stripped and rebuilt around the reversible-compression core. About a third of the engine still has traces of Headroom (see NOTICE).
Bash / WebFetch / WebSearch / Task (sub-agent) outputs before they enter context. Fail-open: never breaks a tool call. It does not touch your Read / Grep / Glob file reads β by design, so a later Edit still sees exact file bytes; those reads (often a coding agent's largest context cost) pass through uncompressed (why). One honest limit: when an output is so large that Claude Code itself persists it to a file and hands the model only a file reference, there is no inline output for the hook to compress.furl_compress, furl_retrieve, and furl_search work on every version, and the on-by-default PreToolUse pipe adds Bash savings when no Bash permission rules exist. Disable that pipe with FURL_PRETOOL_PIPE=0. See LIBRARY.md for the canonical harness status.retrieve(hash, select_field="name", select_equals="DroppedFrame") or a numeric range β without materializing the whole thing.furl_compress, furl_retrieve, furl_stats, furl_purge (erase stored originals), furl_search (find by content substring), furl_list (list stored entries). A seventh tool, furl_read, exists but is off by default β enable with FURL_MCP_READ=1 (see LIBRARY.md).<<ccr:HASH>> retrieval flow and how to tune or disable it.Tuning, disabling with FURL_HOOK_ENABLED=0, and the full reference live in plugins/furl/README.md. Retrieval TTL differs by surface:
| Surface | Retrieval TTL |
|---|---|
| Library | 30 minutes |
furl CLI | 24 hours |
| Claude Code plugin | 24 hours |
| Bare MCP server | 1 hour session, plus 30 minutes for dropped-row originals |
The plugin sets FURL_CCR_TTL_SECONDS=86400, which governs both the hook's offloads and the MCP tools' stores; the full 24 hour window needs that env set, as the plugin ships it.
A note on version numbers: the Claude Code plugin versions independently from the furl-ctx engine it pins β a plugin release doesn't always mean an engine release, and vice versa. /plugin shows the plugin version; GitHub Releases and CHANGELOG.md track the engine version; the SessionStart banner shows both together (furl <plugin> Β· engine furl-ctx <engine>), which is the quickest way to see both numbers at once.
Token reduction on real captured data β a dated snapshot (inputs committed under benchmarks/data/ for auditability; a re-run measures the current engine, so absolute counts can drift from this table β the honest-read band below is the authoritative check).
Every number uses the engine's own tokenizer and measures compress() directly β independent of the PostToolUse hook-delivery issue noted above; needle recall is 100% (a known unique row is always recoverable, in the output or via CCR).
This table is measured with the gpt-4o model string (real tiktoken BPE, see BENCHMARKS.md). compress()'s own default model is claude-sonnet-4-5-20250929 β the shape Claude Code and the plugin actually call with β and claude-* routes through the exact same o200k_base encoding as gpt-4o, since Anthropic's own tokenizer is not publicly available. That makes this table's shape representative of what a real Claude Code run sees internally, but the counts themselves are a documented PROXY for Anthropic's tokenizer, not real Anthropic billing tokens: per Anthropic's own developer guidance, tiktoken undercounts Claude tokens by roughly 15-20% on typical text and by more on code or non-English text. Read every "token savings" percentage you see from a claude-* call, here or in your own agent, as an approximation on that basis β not an exact Anthropic token count.
Read every figure below as a best-case ceiling, not a typical β the honest read follows.
Best-case ceilings β low-entropy dev fixtures (the compressor's happy path):
| Dataset | Items | Before | After | Reduction | Info retention |
|---|---|---|---|---|---|
| code | 7 | 41,025 | 1,678 | 95.9% | 100% |
| multiturn | 135 | 14,866 | 2,073 | 86% | 100% |
| logs | 90 | 8,595 | 619 | 93% | 100% |
| search | 90 | 4,102 | 318 | 92% | 100% |
| repeated logs | 90 | 3,621 | 120 | 97% | 100% |
| disk | 9 | 694 | 279 | 60% | 100% |
Across the corpus: 93% fewer tokens (72,903 β 5,087) at 100% information retention. Full methodology and the 6-seed adversarial sweep: BENCHMARKS.md.
Information retention here means every byte is recoverable byte-exact through furl_retrieve. It does not mean the compressed view shows every row. Retrieval is pull-based, so an agent has to query for a specific dropped item to see it, and a lone anomaly will not surface in the compressed summary on its own.
Honest read: the numbers above are best-case, low-entropy ceilings measured on the dev fixtures β two independent, out-of-sample audits show they degrade by 6β43pp on fresh high-entropy / near-unique / realistic data (exactly where real logs and listings live). On genuinely high-entropy content, honest lossless savings sit in the 0β54% band, not 60β95% (code 0%, search 40%, repeated_logs 54%); read every figure here as a ceiling, not a typical, and see the tier-aware breakdown in BENCHMARKS.md.
The code row is not reversible structural compression like the logs, search, and disk rows. It is an opaque whole-blob offload: the router cannot shrink source code structurally, so it moves the whole blob to the CCR store behind one marker and leaves a small summary. The headline percent is a marker reduction, not a token saving, and the offload has no granular row index, so an agent that needs the code must retrieve the entire blob back. That round trip is net-negative: measured fresh this fixture is raw 95.9% but effective -4.1% after one retrieval. See the code row in the effective-savings section of BENCHMARKS.md; compress() also reports each opaque offload per call as result.opaque_offloads so a caller can see the round trip is net-negative before paying for it. An agent's own Read, Grep, or Glob file access bypasses the compression hook by design and passes through unchanged, at 0%.
Stability: The public API is what furl_ctx exports at the top level, including compress(), retrieve(), purge(), and resolve_markers(). Those signatures are the surface to build against. Submodule internals under furl_ctx.* may change between releases, so import from the top-level package rather than reaching into submodules. Releases have been frequent during early development, so pin a minor version if you need a fixed surface to depend on.
Automatic, hands-off compression works on Claude Code 2.1.163 and newer, because the PostToolUse hook mirrors its replacement to the tool's output shape and the harness honors it. Upstream issue #68951 is the reason the mirror was built, not an open blocker. The opt-out PreToolUse pipe gives automatic Bash savings today only if you have no Bash permission rules configured. With any Bash allow, deny, or ask rule it stays out of the way, so your rules apply exactly as native.
Questions or bug reports β open a GitHub issue (the surest way to reach the maintainer).
Maintainer note: Furl is solo-maintained today β one person handles issues, PRs, and security reports, so response times vary with availability. CONTRIBUTING.md covers how PRs get reviewed and SECURITY.md covers the vulnerability-disclosure process; both hold regardless of team size.
Apache 2.0 β see LICENSE.
.actrc
.actrc.local.example
.claude-plugin/
marketplace.json
.commitlintrc.json
.devcontainer/
devcontainer.json
Dockerfile
post-create.sh
.dockerignore
.env.act.example
.env.example
.git-blame-ignore-revs
.gitattributes
.gitguardian.yaml
.github/
act/
dry-run.json
push-feat.json
release-published.json
claude/
setup.sh
dependabot.yml
FUNDING.yml
ISSUE_TEMPLATE/
bug_report.md
config.yml
feature_request.md
PULL_REQUEST_TEMPLATE.md
workflows/
autofix.yml
ci.yml
devcontainers.yml
perf.yml
pr-health.yml
publish.yml
release-please.yml
release.yml
rust.yml
stale.yml
.gitignore
.pre-commit-config.yaml
.release-please-config.json
.release-please-manifest.json
benchmarks/
BENCHMARKS.md
__init__.py
_eval_corpora.py
agent_utility_eval.py
baseline_results.json
BASELINE.md
compare_baseline.py
data/
ci_log.raw.json
code.raw.json
diff_raw.raw.json
disk.raw.json
grep_raw.raw.json
logs.raw.json
markdown_doc.raw.json
multiturn.raw.json
repeated_logs.raw.json
search.raw.json
datasets.py
floor_guard.py
imp2_ab.py
metrics.py
needle_recall.py
rawtext_sources.py
run_bench.py
Cargo.lock
Cargo.toml
CCR-RETENTION.md
CHANGELOG.md
CODE_OF_CONDUCT.md
CODEBASE-MAP.md
conftest.py
CONTRIBUTING.md
crates/
furl-core/
benches/
ccr_store.rs
tokenizer.rs
Cargo.toml
examples/
byte_pin.rs
proptest-regressions/
transforms/
tag_protector.txt
src/
ccr/
backends/
in_memory.rs
mod.rs
markers.rs
mod.rs
persist.rs
lib.rs
relevance/
base.rs
bm25.rs
hybrid.rs
mod.rs
signals/
keyword_detector.rs
line_importance.rs
mod.rs
README.md
tokenizer/
estimator.rs
mod.rs
registry.rs
tiktoken_impl.rs
transforms/
adaptive_sizer.rs
anchor_selector.rs
detection.rs
diff_compressor.rs
log_compressor.rs
mod.rs
search_compressor.rs
smart_crusher/
analyzer.rs
anchors.rs
builder.rs
classifier.rs
compaction/
classifier.rs
compactor.rs
encodings.rs
formatter.rs
ir.rs
mod.rs
walker.rs
config.rs
crusher.rs
crushers.rs
error_keywords.rs
field_detect.rs
field_role.rs
hashing.rs
mod.rs
orchestration.rs
outliers.rs
persist.rs
planning.rs
route.rs
statistics.rs
stats_math.rs
types.rs
walk.rs
tag_protector.rs
text_crusher.rs
unidiff_detector.rs
util/
mod.rs
pyjson.rs
tests/
ccr_roundtrip.rs
tokenizer_proptest.rs
tokenizer_python_parity.rs
typed_dropped_refs.rs
furl-py/
build.rs
Cargo.toml
glibc_compat.c
src/
lib.rs
deny.toml
Dockerfile
docs/
audits/
DESIGN.md
IMPROVEMENT-LEDGER.md
furl_ctx/
__init__.py
_version.py
cache/
__init__.py
backends/
__init__.py
base.py
memory.py
sqlite.py
compression_store.py
retrieval_feedback.py
ccr/
__init__.py
compress_modes.py
marker_grammar.py
mcp_server.py
regex_budget.py
retrieve_filters.py
retrieve_spans.py
chat.py
cli.py
compress_to.py
compress.py
config.py
exceptions.py
hooks.py
host_version.py
paths.py
pipeline.py
py.typed
redaction.py
relevance/
__init__.py
base.py
bm25.py
retrieve.py
tokenizer.py
tokenizers/
__init__.py
base.py
estimator.py
registry.py
tiktoken_counter.py
tools.json
transforms/
__init__.py
_ccr_persist.py
base.py
cache_aligner.py
code_aware_compressor.py
compressor_registry.py
content_detector.py
content_router.py
cross_message_dedup.py
csv_ingest.py
csv_schema_decoder.py
diff_compressor.py
envelope_ingest.py
error_detection.py
html_ingest.py
log_compressor.py
log_template_decoder.py
log_template_format.py
log_template_miner.py
log_template.py
net_mutation_gain.py
pipeline.py
read_lifecycle.py
router_blocks.py
router_cache.py
router_ccr_mirror.py
router_debug.py
router_dispatch.py
router_engine.py
router_message_policy.py
router_policy.py
router_split.py
search_compressor.py
smart_crusher.py
text_crusher.py
utils.py
glama.json
LIBRARY.md
LICENSE
llms.txt
Makefile
NOTICE
plugins/
furl/
.claude-plugin/
plugin.json
.mcp.json
hooks/
_furl_ccr_counters.py
compress_tool_output.py
hooks.json
pipe_compress.py
pretool_pipe.py
session_start_banner.py
README.md
skills/
furl/
SKILL.md
pyproject.toml
README.md
RUST_DEV.md
rust-toolchain.toml
scripts/
build_rust_extension.sh
release_version.py
SECURITY.md
site/
0a00f339655c921b82d45aa355dee32d.txt
assets/
app.js
build-fonts.py
fonts/
fonts.css
bricolage-grotesque-700.woff2
bricolage-grotesque-800.woff2
FONTS.md
jetbrains-mono-400.woff2
jetbrains-mono-500.woff2
jetbrains-mono-700.woff2
og.png
styles.css
data/
ci.json
crash.json
csv.json
furl-data.js
generate.py
json.json
logs.json
manifest.json
pytest.json
googled2727464de4cb587.html
index.html
llms.txt
README.md
robots.txt
sitemap.xml
vercel.json
tests/
__init__.py
_fixtures.py
conftest.py
data/
apply_identity_golden.json
bm25_dead_branch_parity_golden.json
matrix/
__init__.py
_matrix.py
conftest.py
test_code_languages.py
test_encoding_shapes.py
test_result_cache_divergence.py
test_scale.py
test_secrets_rail.py
test_slices.py
test_structured_text.py
test_advertise_retrieval_tool_alias.py
test_analysis_intent_keywords.py
test_api_contract_fixes.py
test_apply_extraction_identity.py
test_apply_min_tokens_floor_characterization.py
test_apply_rejects_unknown_kwargs.py
test_audit_retrieve_surface_alpha.py
test_b3_redact_purge.py
test_benchmarks_doc_claims.py
test_benchmarks_fail_closed.py
test_benchmarks_metrics_honesty.py
test_benchmarks_rawtext_routing.py
test_bm25_dead_branch_parity.py
test_bm25_scorer.py
test_cache_aligner_block_format.py
test_cache_aligner_hardening.py
test_cache_aligner_prefix_hash.py
test_ccr_counters.py
test_ccr_durable_write_veto.py
test_ccr_eviction_loud_miss.py
test_ccr_filter_units.py
test_ccr_hash_collision_drop.py
test_ccr_hash_parity_vectors.py
test_ccr_marker_grammar_characterization.py
test_ccr_mirror_hash_verify.py
test_ccr_mirror_marker_parity.py
test_ccr_mirror_no_silent_loss.py
test_ccr_mirror_valueerror_veto.py
test_ccr_miss_message_honest.py
test_ccr_namespace_export_import.py
test_ccr_offload_fallback.py
test_ccr_persist_failure_vetoes.py
test_ccr_project_isolation.py
test_ccr_proportional_retrieval.py
test_ccr_query_numeric_fidelity.py
test_ccr_recovery_invariant.py
test_ccr_redaction_redos.py
test_ccr_row_drop_one_slot.py
test_ccr_rows_marker_removed.py
test_ccr_spill_plugin_namespace_gap.py
test_ccr_spill_tier.py
test_ccr_store_write_path_perf.py
test_ccr.py
test_chat_presets.py
test_ci_required_checks_guard.py
test_cli_persistence.py
test_cli.py
test_code_aware_compressor.py
test_code_aware_detect_language.py
test_compare_baseline.py
test_compress_api.py
test_compress_failure.py
test_compress_frozen_prefix.py
test_compress_panic_fail_open.py
test_compress_to.py
test_compression_safety_rails.py
test_compression_store_guards.py
test_compression_store_hardening.py
test_compression_store_redaction.py
test_compression_store_search_all.py
test_compression_store_search_bump.py
test_compression_store_surrogate_hash.py
test_content_kind_threading.py
test_content_router_adaptive_min_ratio.py
... 182 moreΒ© 2026 Flowy Β· Free and open source
Built for Claude Code Β· Not affiliated with Anthropic