clank-cli 0.1.58 → 0.1.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Mapper.ts +9 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "clank-cli",
3
3
  "description": "Keep AI files in a separate overlay repository",
4
- "version": "0.1.58",
4
+ "version": "0.1.59",
5
5
  "author": "",
6
6
  "type": "module",
7
7
  "bin": {
package/src/Mapper.ts CHANGED
@@ -190,6 +190,15 @@ export function normalizeAddPath(
190
190
  }
191
191
  }
192
192
 
193
+ // If cwd is inside a .claude/ or .gemini/ directory, join directly
194
+ // (e.g., running `clank rm foo.md` from .claude/commands/)
195
+ const relCwd = relative(gitRoot, cwd);
196
+ for (const agentDir of managedAgentDirs) {
197
+ if (relCwd.startsWith(`${agentDir}/`) || relCwd === agentDir) {
198
+ return join(cwd, normalized);
199
+ }
200
+ }
201
+
193
202
  // If path already contains /clank/ in the middle, preserve its structure
194
203
  if (normalized.includes("/clank/")) {
195
204
  return join(cwd, normalized);