agentleFS
open-thoughtsopen-thoughts/OpenThoughts-Agent/.agents/skills/utils-fix-permissions/SKILL.md

utils-fix-permissions

Skill309 starsChanged 4 months agoApache-2.0View on GitHub

Fix file permissions on a directory tree on an HPC cluster (Leonardo, Jupiter, TACC, etc.) so other users can read your shared data, conda envs, or work directories. Runs `scripts/permissions/fix_permissions.sh <dir>` over SSH on the target cluster — sets directories to 755, files to 644, then restores execute bits on bin/ entries, ELF binaries, and shebang scripts, and ensures all ancestor directories are traversable (o+x). Use when another user reports "Permission denied" reading your files, after creating a new conda env or shared data dir, or when a cross-user pipeline can't access your checkpoint/ eval/trace outputs.

  • Installs packages

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use chmod -R g+w <dir> when shared editing is required.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

utils-fix-permissions

Set shared-readable permissions on an HPC directory tree.

When to use

  • Another user reports "Permission denied".
  • A shared conda env or data directory needs read access.
  • A cross-user pipeline cannot read checkpoint, eval, or trace output.
  • rsync or scp preserved 600/700 permissions.

What it does

scripts/permissions/fix_permissions.sh <dir> performs these passes:

PassAction
0Ensure all ancestor directories up to / are traversable (o+x) — only touches dirs you own
1Set all directories to 755 (rwxr-xr-x)
2Set all files to 644 (rw-r--r--)
3Restore 755 on executables in bin/ directories
4Restore 755 on ELF binaries (detected by \x7f ELF magic header)
5Restore 755 on shell scripts with shebang (#!)

Files remain owner-writable; collaborators receive read and execute.

How to invoke

SSH to the target cluster and run the script from the repo root:

# Leonardo example
ssh Leonardo 'cd $WORK/OpenThoughts-Agent && bash scripts/permissions/fix_permissions.sh /leonardo_work/AIFAC_5C0_290/bfeuer00'

# TACC example (large tree — run on a compute node if login node is loaded)
ssh TACCVista 'cd $SCRATCH/OpenThoughts-Agent && bash scripts/permissions/fix_permissions.sh $SCRATCH/eval_jobs'

# Jupiter example
ssh Jupiter 'cd $DCFT && bash scripts/permissions/fix_permissions.sh /p/home/../../public'

Large directories

For big trees, use an interactive compute node:

# TACC
ssh TACCVista 'srun -p gh-dev -N 1 -n 1 -t 08:00:00 --account=CCR24067 bash -c "cd $SCRATCH/OpenThoughts-Agent && bash scripts/permissions/fix_permissions.sh $SCRATCH/miniconda3"'

# Leonardo (idev or sbatch)
ssh Leonardo 'srun -p boost --account=AIFAC_5C0_290 --time=08:00:00 -N 1 bash -c "cd $WORK/OpenThoughts-Agent && bash scripts/permissions/fix_permissions.sh $WORK"'

Gotchas

  • Use chmod -R g+w <dir> when shared editing is required.
  • Rerun after pip install for a shared conda environment.
  • Pass 0 changes only owned NFS directories.
  • Safe to rerun; it is idempotent.

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.