surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
The room only fed the decision to open: an attempt whose read found the terminal narrowed went on reading for each edit or command that landed during a read, with no room to open anything. It now ends there, and the next edit with room starts an attempt of its own. The README's `git status` sentence says where that read now happens: at the first fetch, the one an edit decides on included.
| @@ -58,8 +58,8 @@ | ||
| 58 | 58 | is open, after an edit that landed or a shell command that ran, or by the |
| 59 | 59 | fetch each edit inside the repository, with room for a pane, makes until |
| 60 | 60 | one lists a file and the pane opens on it. The one read the built-in has |
| 61 | -no counterpart for is a `git status` at a pane's first fetch, which stands | |
| 62 | -in for the change time the built-in dates a moved file by. | |
| 61 | +no counterpart for is a `git status` at the first of those fetches, which | |
| 62 | +stands in for the change time the built-in dates a moved file by. | |
| 63 | 63 | |
| 64 | 64 | `hooks/register.ts` is the module; everything under `hooks/` is its parts. |
| 65 | 65 |
| @@ -514,7 +514,9 @@ | ||
| 514 | 514 | } |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | - if (seen === landed || isOvertaken) { | |
| 517 | + const hasLostRoom = !isListing && !hasRoomFor(floor) | |
| 518 | + | |
| 519 | + if (seen === landed || isOvertaken || hasLostRoom) { | |
| 518 | 520 | return |
| 519 | 521 | } |
| 520 | 522 |
| @@ -875,6 +875,44 @@ | ||
| 875 | 875 | expect(world.opened, 'the room it read for is gone').toEqual([]) |
| 876 | 876 | }) |
| 877 | 877 | |
| 878 | + test('nor does a command landing in that read have it read again, the next edit with room does', async ($, on) => { | |
| 879 | + const world = Fixtures.inSlowRepository(on) | |
| 880 | + | |
| 881 | + const edit = () => | |
| 882 | + $.tool.call({ | |
| 883 | + tool: 'Edit', | |
| 884 | + file_path: '/work/app.ts', | |
| 885 | + old_string: '1', | |
| 886 | + new_string: '2', | |
| 887 | + }) | |
| 888 | + | |
| 889 | + on('tool.call', () => ({ result: 'done' })) | |
| 890 | + | |
| 891 | + await $.session.start(Fixtures.SESSION) | |
| 892 | + await $.ui.render(Fixtures.HINT) | |
| 893 | + await edit() | |
| 894 | + await world.clock.settle() | |
| 895 | + await $.ui.render(Fixtures.hintAt(Limits.AUTO_OPEN_MIN_COLUMNS - 1)) | |
| 896 | + await $.tool.call({ tool: 'Bash', command: 'make' }) | |
| 897 | + await world.clock.advance(Fixtures.SETTLE_MS) | |
| 898 | + | |
| 899 | + expect( | |
| 900 | + world.reads, | |
| 901 | + 'the attempt gave way with the room; it read for nothing more', | |
| 902 | + ).toEqual([0]) | |
| 903 | + | |
| 904 | + expect(world.opened).toEqual([]) | |
| 905 | + | |
| 906 | + await $.ui.render(Fixtures.HINT) | |
| 907 | + await edit() | |
| 908 | + await world.clock.advance(Fixtures.SETTLE_MS) | |
| 909 | + | |
| 910 | + expect( | |
| 911 | + world.opened.map(pane => pane.id), | |
| 912 | + 'wide again, the next edit starts an attempt of its own', | |
| 913 | + ).toEqual(['diff']) | |
| 914 | + }) | |
| 915 | + | |
| 878 | 916 | test("only the main loop's edit opens the pane", async ($, on) => { |
| 879 | 917 | const world = Fixtures.inRepository(on) |
| 880 | 918 |