session-repo

session-repo is a skill for Claude Code, Codex from pigri/code-remote. It costs 98 tokens per session (787 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 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 787 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.00098 $0.00787
Opus 5.5 $0.00039 $0.00315
Sonnet 5.5 $0.00020 $0.00157
Haiku 4.5 $0.00010 $0.00079

Measured 6d ago against content hash 18fa205918a5, 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 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (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 · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 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 and 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.

  5. Run restart-self.sh <dir> as the last action of the turn, then end the turn. The script returns immediately; a detached helper waits until the session is idle and then runs crctl restart <id> --dir <repo>. Do not run crctl restart on your own session directly - it would kill the command mid-flight - and do not keep working after scheduling, since the helper waits for idle and anything started now is cut off.

Read the full file on GitHub · 56 lines

Files

What ships with it

1 file 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. 6d 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 8d ago), licensed Apache-2.0. It adds 98 tokens to every session and 787 once invoked, about $0.0004 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

Other skills, from other repositories

vhs-e2e-gif

Record a test run, a TUI session, or any terminal command as a GIF with VHS and attach it to a GitHub PR as a release-hosted asset, never a repo commit. Use when asked to record an e2e run, demo a fix on a PR, attach a GIF or screen recording to a pull request, show a test passing visually, or produce a terminal…

dimetron/pi-go · 106 tokens

check-linters-before-commit

Before any commit, run linters, vet, tests, and build verification; do not commit until checks pass.

dimetron/pi-go · 30 tokens

gh-infra

Overview of gh-infra and command workflow (import, validate, plan, apply). Use when managing GitHub repository settings, labels, actions settings, rulesets, secrets, variables, or files declaratively via YAML manifests.

babarot/gh-infra · 49 tokens

repository-manifest

Complete YAML schema reference for Repository and RepositorySet resources. Use when writing or editing manifests for repo settings, labels, actions, branch protection, rulesets, secrets, variables, or repository defaults.

babarot/gh-infra · 43 tokens

file-manifest

Complete YAML schema reference for File and FileSet resources. Use when writing manifests to manage files (CODEOWNERS, LICENSE, CI workflows, etc.) in one or more repositories, including templating, patches, reconcile modes, delivery method, and import-into behavior.

babarot/gh-infra · 58 tokens

import-into

Use when pulling live GitHub state back into existing gh-infra manifests with gh infra import --into, especially for write/patch/skip decisions, shared file sources, template-backed files, and import safety rules.

babarot/gh-infra · 48 tokens