setup

A one-time setup tool for a personal lens memory loop in Claude Code. The loop queues finished sessions, reviews them for patterns, and helps create or improve reusable lenses.

In plain words
What is it for?
It helps configure a private, non-versioned foundry for session data on Claude Code. After setup, it supports later retrospective reviews and lens creation.
Why use it?
It removes the manual work of creating the private storage folder and connecting the session-end process. It also explains that the loop is not supported in Claude Cowork.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tiltely/lens/setup
Any agent
npx skills add Tiltely/lens --skill setup
Clone the repo
git clone --depth 1 https://github.com/Tiltely/lens

Made for: Claude Code, Codex.

Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 777 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00080 $0.00777
Opus 5 $0.00040 $0.00388
Sonnet 5 $0.00016 $0.00155
Haiku 4.5 $0.00008 $0.00078

Measured yesterday against content hash b08eec255e11, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

setup scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

from other projects' sessions. Do NOT edit `~/.claude/settings.json` yourself —
skills/setup/SKILL.md · 55 lines

How it starts

The opening of the file, as written. The whole thing — 55 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lens Setup (Claude Code)

The memory loop — a SessionEnd hook that queues lens sessions, /lens:retro to mine them, /lens:new to grow your collection — is a Claude Code feature. Setup creates your foundry and wires it up. Without setup, all bundled lenses and /lens:socratic still work; setup only adds the loop.

On Claude Cowork: not supported — stop here

If you detect Cowork, do NOT set up a foundry. The memory loop does not run on Cowork: its sandbox spawns the CLI with --setting-sources user, so plugin-provided hooks (the SessionEnd queue) never fire, and the VM home is ephemeral. Tell the user plainly: on Cowork, just use the lenses and /lens:socratic directly — they work fully. Run /lens:setup on Claude Code to enable the loop there. Then stop — no foundry, no config, no folder grant.

On Claude Code: set up the loop

The foundry holds PERSONAL session data (session IDs, project/transcript paths, mined observations) — never commit it to git. Use a private, persistent, non-tracked folder.

  1. Choose the foundry location — default ~/.claude/lens-foundry/; any non-git folder is fine, but NEVER inside a git working tree. Create it with empty pending-retros.jsonl and processed-retros.jsonl, an observations.md with a one-line header ("Cross-project learnings mined by /lens:retro; append-only"), a registry.md (your lenses — same columns as ${CLAUDE_PLUGIN_ROOT}/core/registry.md, starting empty), and an empty lenses/ dir (where /lens:new writes your global lenses; /lens:socratic reads them inline).

  2. Write the config at ~/.claude/lens.json (show the user first):

    { "foundry": "<foundry path>" }
    
  3. Hand the user the cross-cwd permission rule so retro/hook writes never prompt from other projects' sessions. Do NOT edit ~/.claude/settings.json yourself — permission-widening by an agent is blocked by the auto-mode classifier by design. Print a paste-ready node -e one-liner the USER runs, merging into their settings and preserving everything else:

Read the full file on GitHub · 55 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 55 lines · 80 tokens per session scan B b08eec255e11

Subscribe to this mod's changes

setup is a skill published in the GitHub repository Tiltely/lens (5 stars, last pushed 23d ago), licensed MIT. It adds 80 tokens to every session and 777 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens