working-directory-resolution

working-directory-resolution is a skill for Claude Code, Codex from HKUDS/OpenSpace. It costs 18 tokens per session (681 once invoked), scanned A, original, MIT.

A workflow for resolving file-access problems by using the correct working directory before running commands.

In plain words
What is it for?
It helps locate the target folder and run file operations there using explicit directory changes.
Why use it?
Commands can fail simply because they are being run from the wrong folder, even when the requested files exist.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit It helps locate the target folder and run file operations there using explicit directory changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hkuds/openspace/working-directory-resolution
About the project

OpenSpace is a skill-management layer for AI agents that stores, retrieves, evaluates, shares, and improves reusable workflows. It is intended for people using multiple coding agents who want skills to be reused and refined based on task outcomes. The catalogue provides 200 skills for use with OpenSpace and the agents it supports.

HKUDS/OpenSpace · 8,146 stars · on GitHub

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 HKUDS/OpenSpace --skill working-directory-resolution
Clone the repo
git clone --depth 1 https://github.com/HKUDS/OpenSpace

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 working-directory-resolution

README.md
[![agentmods](https://agentmods.dev/badge/skills/hkuds/openspace/working-directory-resolution/github.svg)](https://agentmods.dev/skills/hkuds/openspace/working-directory-resolution)
Your own site
<a href="https://agentmods.dev/skills/hkuds/openspace/working-directory-resolution"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/working-directory-resolution/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 working-directory-resolution

Your own site · 80×15
<a href="https://agentmods.dev/skills/hkuds/openspace/working-directory-resolution"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/working-directory-resolution.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 681 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00018 $0.00681
Opus 5.5 $0.00007 $0.00272
Sonnet 5.5 $0.00004 $0.00136
Haiku 4.5 $0.00002 $0.00068

Measured 2mo ago against content hash 0900c301bd80, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

working-directory-resolution 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 2mo ago.

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.

benchmarks/gdpval/skills/working-directory-resolution/SKILL.md · 99 lines

How it starts

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

Working Directory Resolution Pattern

Many file operation failures occur because the tool's current working directory doesn't match where the target files are located. This skill provides a reliable pattern for resolving such issues.

Problem Symptoms

File operations fail with errors like:

  • "File not found" or "No such file or directory"
  • "Permission denied" (when path is actually relative)
  • Tools returning empty results for files that should exist

These failures often occur even when files are present in the workspace—the working directory context is simply wrong.

Solution

Always explicitly set the working directory before file operations by prepending cd to your shell commands.

Implementation Pattern

Basic Syntax

cd /path/to/target/directory && your-command-here

With run_shell

run_shell(command="cd /workspace/project && cat config.json")

Multiple Operations in Same Directory

cd /workspace/project && ls -la && cat README.md && python script.py

Conditional Directory Change

cd /workspace/project 2>/dev/null && cat file.txt || echo "Directory not found"

When to Apply

Use this pattern when:

  • read_file fails to locate an existing file
  • execute_code_sandbox can't find referenced files
  • Shell commands report missing files that should exist
  • File paths work in some contexts but not others
  • You're unsure of the tool's current working directory

Best Practices

  1. Use absolute paths when possible

    cd /workspace/project/src && python main.py
    
  2. Combine related operations to avoid repeated cd calls

    cd /workspace/project && ./build.sh && ./test.sh
    
  3. Verify directory exists before operations

    [ -d /workspace/project ] && cd /workspace/project && ls
    
  4. For scripts, set working directory at the start

    #!/bin/bash
    cd "$(dirname "$0")" || exit 1
    # Rest of script runs from script's directory
    

Read the full file on GitHub · 99 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. 2mo ago First seen · 99 lines · 18 tokens per session scan A 0900c301bd80

Subscribe to this mod's changes

working-directory-resolution is a skill published in the GitHub repository HKUDS/OpenSpace (8,146 stars, last pushed 18d ago), licensed MIT. It adds 18 tokens to every session and 681 once invoked, about $0.0001 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-09-03.

Related

working-directory-resolution compared with skills from other repositories

working-directory-resolution next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
working-directory-resolutionHKUDS/OpenSpaceSkill8.1k18d agoMITA18Claude Code, Codex
material-ui-nextjsmui/material-uiSkill99ktodayMITA76Claude Code, Codex
Developmentdanielmiessler/LifeOSSkill20k12d agoMITA0Claude Code, Codex
LifeOSHooksdanielmiessler/LifeOSSkill20k12d agoMITA114Claude Code, Codex
Hermesdanielmiessler/LifeOSSkill20k12d agoMITA0Claude Code, Codex
RootCauseAnalysisdanielmiessler/LifeOSSkill20k12d agoMITA93Claude Code, Codex
benchmark-workflowxberg-io/xbergSkill9.6ktodayMITA13Claude Code