diff --git a/app/kifu.py b/app/kifu.py
new file mode 100644
index 0000000..a0a0c5d
--- /dev/null
+++ b/app/kifu.py
@@ -0,0 +1,13 @@
+
+
+class Kifu:
+    
+    def __init__(self):
+        self.kifu = []
+    
+    def add(self, from_x, from_y, to_x, to_y, promote):
+        self.kifu.append((from_x, from_y, to_x, to_y, promote))
+
+    def pop(self):
+        return self.kifu.pop()
+
diff --git a/app/modules/shogi_input.py b/app/modules/shogi_input.py
index 58bea57..7996f02 100644
--- a/app/modules/shogi_input.py
+++ b/app/modules/shogi_input.py
@@ -6,6 +6,7 @@ from app.slack_utils.user import User as UserFinder
 from app.modules.shogi import Shogi as ShogiModule
 from app.modules.parse_input import ParseInput
 from app.validator import BasicUserValidator, AllPassUserValidator
+from app.kifu import Kifu
 
 
 class UserDifferentException(Exception):
@@ -136,6 +137,13 @@ class ShogiInput:
             "_shogi": shogi,
         }
 
+    @staticmethod
+    def matta(channel_id, user_id):
+        shogi = ShogiInput.manager.get_shogi(channel_id)
+        if not shogi.validate(shogi, user_id):
+            raise UserDifferentException()
+        shogi.matta()
+
 
 class Shogi:
 
@@ -150,9 +158,11 @@ class Shogi:
         self.second_user_name = users[1]["name"]
         self.id = uuid.uuid4().hex
         self._validator = validator
+        self.kifu = Kifu()
 
     def move(self, from_x, from_y, to_x, to_y, promote):
         self.shogi.move(from_x, from_y, to_x, to_y, promote)
+        self.kifu.add(from_x, from_y, to_x, to_y, promote)
 
     def drop(self, koma, to_x, to_y):
         self.shogi.drop(koma, to_x, to_y)
@@ -172,6 +182,15 @@ class Shogi:
     def set_validator(self, validator):
         self._validator = validator
 
+    def matta(self):
+        if len(self.kifu.kifu) == 0:
+            raise KomaCannotMoveException
+        self.kifu.pop()
+        self.shogi = ShogiModule()
+        for kifu in self.kifu.kifu:
+            from_x, from_y, to_x, to_y, promote = kifu
+            self.shogi.move(from_x, from_y, to_x, to_y, promote)
+
     @property
     def first(self):
         return self.shogi.first
diff --git a/app/shogi.py b/app/shogi.py
index c28afea..3173412 100644
--- a/app/shogi.py
+++ b/app/shogi.py
@@ -113,3 +113,19 @@ def resign(channel, message):
     message.send(board_str)
     ShogiInput.clear(channel.channel_id)
 
+@respond_to("待った")
+@channel_info
+@should_exist_shogi
+def matta(channel, message):
+    try:
+        ShogiInput.matta(channel.channel_id, channel.own_id)
+        message.send("mattaed")
+    except UserDifferentException:
+        message.reply("You cannot matta because *it's not your turn*")
+    except KomaCannotMoveException:
+        message.reply("You cannot matta because koma not moved")
+    finally:
+        board = ShogiInput.get_shogi_board(channel.channel_id)
+        board_str = ShogiOutput.make_board_emoji(board)
+        message.send(board_str)
+

待った に対応する
あえて 待った をありにしたい。
diff --git a/test/modules/shogi_input_test.py b/test/modules/shogi_input_test.py
index 58dca13..272b547 100644
--- a/test/modules/shogi_input_test.py
+++ b/test/modules/shogi_input_test.py
@@ -4,7 +4,6 @@ from app.modules.shogi_input import ShogiInput, UserDifferentException, KomaCann
 from app.modules.shogi import Koma
 
 
-
 class ShogiTest(unittest.TestCase):
 
     def setUp(self):
@@ -107,3 +106,48 @@ class ShogiTest(unittest.TestCase):
         ShogiInput.setAllMode(channel_id)
         ShogiInput.move("34歩", channel_id, shogi.first_user_id)
 
+    def test_matta(self):
+        channel_id = "test_matta"
+        shogi = ShogiInput.init(channel_id, [{
+            "id": "user1",
+            "name": "user1name",
+        }, {
+            "id": "user2",
+            "name": "user2name",
+        }])
+        ShogiInput.move("76歩", channel_id, shogi.first_user_id)
+        self.assertEqual(shogi.board[5][2], Koma.fu)
+        ShogiInput.matta(channel_id, shogi.second_user_id)
+        self.assertEqual(shogi.board[5][2], Koma.empty)
+        ShogiInput.move("76歩", channel_id, shogi.first_user_id)
+        self.assertEqual(shogi.board[5][2], Koma.fu)
+ 
+    def test_matta_for_UserDifferentException(self):
+        channel_id = "test_matta_for_UserDifferentException"
+        shogi = ShogiInput.init(channel_id, [{
+            "id": "user1",
+            "name": "user1name",
+        }, {
+            "id": "user2",
+            "name": "user2name",
+        }])
+        ShogiInput.move("76歩", channel_id, shogi.first_user_id)
+        self.assertEqual(shogi.board[5][2], Koma.fu)
+        with self.assertRaises(UserDifferentException):
+            ShogiInput.matta(channel_id, shogi.first_user_id)
+        ShogiInput.move("34歩", channel_id, shogi.second_user_id)
+        with self.assertRaises(UserDifferentException):
+            ShogiInput.matta(channel_id, shogi.second_user_id)
+
+    def test_matta_for_KomaCannotMoveException(self):
+        channel_id = "test_matta_for_KomaCannotMoveException"
+        shogi = ShogiInput.init(channel_id, [{
+            "id": "user1",
+            "name": "user1name",
+        }, {
+            "id": "user2",
+            "name": "user2name",
+        }])
+        with self.assertRaises(KomaCannotMoveException):
+            ShogiInput.matta(channel_id, shogi.first_user_id)
+

pip install -e .
parse_log_pytest
pytest
pytest
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi==2025.1.31
charset-normalizer==3.4.1
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
idna==3.10
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
packaging @ file:///croot/packaging_1734472117206/work
pluggy @ file:///croot/pluggy_1733169602837/work
pytest @ file:///croot/pytest_1738938843180/work
requests==2.32.3
six==1.17.0
-e git+https://github.com/setokinto/slack-shogi.git@3f692f2862e7bc2fb9fbbe8d73310c2696653e4d#egg=Slack_Shogi
slackbot==1.0.5
slacker==0.14.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
urllib3==2.3.0
websocket-client==1.6.0

name: slack-shogi
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - packaging=24.2=py39h06a4308_0
  - pip=25.0=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py39h06a4308_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - idna==3.10
      - requests==2.32.3
      - six==1.17.0
      - slackbot==1.0.5
      - slacker==0.14.0
      - urllib3==2.3.0
      - websocket-client==1.6.0
prefix: /opt/conda/envs/slack-shogi

test/modules/shogi_input_test.py::ShogiTest::test_matta test/modules/shogi_input_test.py::ShogiTest::test_matta_for_KomaCannotMoveException test/modules/shogi_input_test.py::ShogiTest::test_matta_for_UserDifferentException
test/modules/shogi_input_test.py::ShogiTest::test_clear_for_non_exists_channnel test/modules/shogi_input_test.py::ShogiTest::test_move_method_should_raise_KomaCannotMoveException test/modules/shogi_input_test.py::ShogiTest::test_move_method_should_raise_UserDifferentException test/modules/shogi_input_test.py::ShogiTest::test_move_method_should_work test/modules/shogi_input_test.py::ShogiTest::test_set_any_user_validator test/modules/shogi_input_test.py::ShogiTest::test_shogi_input_is_initable
app/modules/shogi_input.py app/shogi.py app/kifu.py
app/modules/shogi_input.py app/shogi.py app/kifu.py