agentleFS
shasyasanshasyasan/claude-rein/skills/locate/SKILL.md

locate

Skill2 starsChanged 12 days agoMITView on GitHub

Find this session's context-usage record and the rein command on PATH. Use when you need to know how much of the context this session has used, or which rein command a handover request will run -- rein does not print either at session start.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. maro114510/skills★ 1same name
    2. dominionism/Playbook★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run this as-is (it prints both, or stops with the reason):

    line 12

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Finding the usage record and the rein command

rein keeps these two out of the session start on purpose: most sessions never need them, so carrying them in every context costs more than looking them up on the one turn that does. Both vary per session and per machine, so take them from the commands below, never from memory or a guess.

In a session rein launched

Run this as-is (it prints both, or stops with the reason):

: "${CLAUDE_CODE_SESSION_ID:?Claude Code did not pass this session its ID -- stop and ask the user for it}"
: "${REIN_MANAGED_CWD:?rein did not launch this session -- use the steps for a session rein did not launch}"
rein_cmd="$(command -v rein)" || { printf 'rein command: not on PATH (report this to the user)\n'; exit 1; }
printf 'rein command: %s\n' "$rein_cmd"
usage_dir="$(rein --cwd "$REIN_MANAGED_CWD" --config "$REIN_MANAGED_CONFIG_FILE" config get usage_state_dir)" || exit 1
printf 'usage record: %s/%s.json\n' "$usage_dir" "$CLAUDE_CODE_SESSION_ID"
  • The usage record is <usage_state_dir>/<session ID>.json -- the same file rein's hooks read. cat it: used_percentage is the figure, and at is when the status line last wrote it (an at far behind the clock means the number is old -- rein's hooks say so on their own once it passes usage_stale_sec).
  • The location comes from the lineage's own config. A session rein launched carries the lineage's config file in REIN_MANAGED_CONFIG_FILE, and that is what the hooks read; running rein config get without --config would read the default user config instead, which is a different file for a lineage started with --root or --config.
  • The session ID comes from CLAUDE_CODE_SESSION_ID. This rests on observation, not on a documented guarantee: Claude Code sets it in the shell its Bash tool runs, with the same value hooks receive as session_id. A subagent's shell carries its parent's ID, so a subagent reads the primary session's record. If it is unset, stop and ask -- never put another session's ID in its place (another session's record reads like a real answer).
  • The rein command is whatever rein resolves to on PATH -- the same command a handover request runs (see /rein:request). If it is not on PATH, the installation is incomplete: hand that to the user rather than substituting another path.

In a session rein did not launch

Without the variables above, name the project yourself:

command -v rein
rein --cwd <absolute path to the target project> config get usage_state_dir

The record is <printed location>/<this session's ID>.json. If you don't know this session's ID, stop and ask.

When a step fails

A non-zero exit means the location could not be resolved -- the reason is on stderr (for example, a project config nobody has decided on yet: rein config get refuses to run until it is allowed or denied). Report that reason to the user; don't fall back to a default path or a file you found by listing the directory.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.