session-repo

session-repo is a skill for Claude Code, Codex from pigri/code-remote. It costs 132 tokens per session (1,167 once invoked), scanned A, original, Apache-2.0.

A session-restart tool for moving an agent conversation into the correct Git repository, the folder that stores a project's version history. It keeps the conversation while restoring the repository context used to show branches, changes, and pull requests.

In plain words
What is it for?
Use it when a remote session was started in the wrong directory or when the user asks to move the session into a particular repository.
Why use it?
A session started outside the repository may not show its branch, changes, or pull requests even when the work is correct. Restarting it in the right repository fixes that context.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when a remote session was started in the wrong directory or when the user asks to move the session into a particular repository.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pigri/code-remote/session-repo
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.

Any agent
npx skills add pigri/code-remote --skill session-repo
Clone the repo
git clone --depth 1 https://github.com/pigri/code-remote

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for session-repo

README.md
[![agentmods](https://agentmods.dev/badge/skills/pigri/code-remote/session-repo/github.svg)](https://agentmods.dev/skills/pigri/code-remote/session-repo)
Your own site
<a href="https://agentmods.dev/skills/pigri/code-remote/session-repo"><img src="https://agentmods.dev/badge/skills/pigri/code-remote/session-repo/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for session-repo

Your own site · 80×15
<a href="https://agentmods.dev/skills/pigri/code-remote/session-repo"><img src="https://agentmods.dev/badge/skills/pigri/code-remote/session-repo.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 132 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,167 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00132 $0.01167
Opus 5.5 $0.00053 $0.00467
Sonnet 5.5 $0.00026 $0.00233
Haiku 4.5 $0.00013 $0.00117

Measured 12d ago against content hash c5d6cef4200a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

session-repo scanned grade A with 0 findings 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 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (restart-self_test.sh, restart-self.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/session-repo/SKILL.md · 80 lines

How it starts

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

session-repo

A session registers its git repository once, at launch, from the directory it starts in. Started anywhere else (typically $HOME), it has no repository, so the Claude apps cannot show its branch, diff or pull requests - even though the work itself is fine. The fix is to restart the session inside the repo. crctl does that and resumes the same conversation; restart-self.sh (next to this file) lets the session do it to itself.

Steps

  1. Check where you are. Run restart-self.sh --check. It prints this session's id, its profile when profiles are set up, and its current directory, or says this claude is not a crctl-managed screen session - in which case stop and tell the user; there is nothing to restart.

  2. Pick the repository. Use the one the user named. Otherwise use the repo this conversation has been working in (where the commits and PRs went). If the work spans several repos, or you are not sure, ask - a session has one primary repo and a wrong guess costs a second restart. The restart marks the repo as a trusted folder for Claude (nobody can answer the trust prompt of a detached session), so only move into a repo the user works in or named. If the session already runs inside the right repo, say so and stop.

  3. Confirm the target. Run restart-self.sh --check <dir>. It resolves the repo root and its origin remote and verifies crctl supports the move. Relay any error as is; do not work around it.

  4. Wrap up, then schedule. The restart ends this turn's process, so first finish or park whatever is in flight: no half-written files, no running builds you still need. Background shells and their state do not survive; uncommitted changes in the working tree do. Tell the user in one or two lines that the session is about to restart into <repo> and will come back with the same history - and that the Claude apps will list it as a new session entry (same name), with the old entry archived.

Read the full file on GitHub · 80 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago Changed c5d6cef4200a
  2. 1mo ago Changed · +24 lines · +34 tokens per session b42e86d8f1f4
  3. 1mo ago First seen · 56 lines · 98 tokens per session scan A 18fa205918a5

Subscribe to this mod's changes

session-repo is a skill published in the GitHub repository pigri/code-remote (2 stars, last pushed 2d ago), licensed Apache-2.0. It adds 132 tokens to every session and 1,167 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-10.

Related

session-repo compared with skills from other repositories

session-repo next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
session-repopigri/code-remoteSkill22d agoApache-2.0A132Claude Code, Codex
git-workflowdimetron/pi-goSkill2343d agoMITA59Claude Code, Codex
pr-workflowdimetron/pi-goSkill2343d agoMITA65Claude Code, Codex
vhs-e2e-gifdimetron/pi-goSkill2343d agoMITA71Claude Code, Codex
rex-hunk-diffdimetron/pi-goSkill2343d agoMITA101Claude Code, Codex
check-linters-before-commitdimetron/pi-goSkill2343d agoMITA30Claude Code, Codex
ghcli/cliSkill47kyesterdayMITA32Claude Code, Codex